LPC图像拼接-代码-RMSE问题

LPC的RMSE代码

2021年cvpr-Leveraging Line-point Consistence to Preserve Structures for Wide Parallax Image Stitching(LPC)这篇论文作者给的评价指标代码。

function [ rmse ] = RMSE( img, C1, C2, pts1, pts2, mesh_X, mesh_Y, off )

X_col = linspace(1,size(img,2), C2+1); % column index of cells
Y_row = linspace(1,size(img,1), C1+1); % row index of cells
x_dis = X_col(2)-X_col(1);  % the width of scale-cell
y_dis = Y_row(2)-Y_row(1);  % the height of scale-cell

Mesh_p = zeros(4, 2);
rmse = 0;

for i=1:size(pts1, 2)
    point = [pts1(1,i), pts1(2,i)];
    px = min( find(point(1)-X_col<x_dis & point(1)-X_col>=0, 1), C2); % the x index of point's position
    py = min( find(point(2)-Y_row<y_dis & point(2)-Y_row>=0, 1), C1); % the y index of point's position
    
    Mesh_p(1:4,:) = [X_col(px), Y_row(py);     % v1
                     X_col(px+1), Y_row(py);   % v2
                     X_col(px+1), Y_row(py+1); % v3
                     X_col(px), Y_row(py+1)];  % v4
    
    coeff_mesh_p = meshGridAlign(Mesh_p, point);
    
    v1 = [mesh_X(py, px), mesh_Y(py, px)];
    v2 = [mesh_X(py, px+1), mesh_Y(py, px+1)];
    v3 = [mesh_X(py+1, px+1), mesh_Y(py+1, px+1)];
    v4 = [mesh_X(py+1, px), mesh_Y(py+1, px)];
    
    warp_point = [coeff_mesh_p(1)*v1(1)+coeff_mesh_p(2)*v2(1)+coeff_mesh_p(3)*v3(1)+coeff_mesh_p(4)*v4(1),
                  coeff_mesh_p(1)*v1(2)+coeff_mesh_p(2)*v2(2)+coeff_mesh_p(3)*v3(2)+coeff_mesh_p(4)*v4(2)];
    point_ref = [pts2(1,i); pts2(2,i)];
    rmse = rmse + norm(warp_point - point_ref);
    % 我认为的代码应该是
    % rmse = rmse + norm(warp_point - point_ref).^2;
end
rmse = rmse/size(pts1, 2);
rmse = sqrt(rmse);

作者在求出特征点之间的距离向量的范数后,没有平方。得到的实验数据下图所示:
在这里插入图片描述
APAP的实验指标是直接从APAP论文里面抄的,感觉apap的论文实验指标和他的论文指标不大一样。

实际的实验结果图:

1. APAP结果图

在这里插入图片描述
不用多说apap这个效果很好

2. SPW结果图

在这里插入图片描述
SPW房屋上有很明显重影。

3. LPC结果图

在这里插入图片描述
LPC在近景的地面上有很明显的错位。

总结

从他的实验指标上看,SPW、LPC和APAP效果差不多
但实际实验效果上,APAP 是明显好于 LPC 和SPW的。

为什么会这样?

可能因为直线匹配算法的问题,线匹配太容易出错,从直线上采样特征点,容易导致有直线的区域局部配准错误

我更改后的RMSE结果

temple 在 APAP 的 RMSE 是2.2。
temple 在SPW 的 RMSE 是5.7。
temple 在LPC中的RMSE: 3.7。

LPC 实验结果:

lcp实验结果

SPW实验结果图

在这里插入图片描述

APAP–RMSE定义:

APAP的RMSE指标定义

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 17
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 17
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值