Learning Feature Descriptors using Camera Pose Supervision(2020)(十)

本文要解决的问题:
        本文主要是提出一种新的方法提取descriptor,由于一般descriptor的训练都需要标注匹配数据,这件事比较难,
        因此本方法的创新之处就在于仅仅通过relative pose就可以训练网络学习descriptor,不需要标注match。
 
本方案需要使用别的算法提供离散的detector。
 
符号定义:

        :两张匹配图

        :分为表示两张图上的像素坐标

        :分别表示I1和I2图片通过网络输出的dense的feature map(W*H*128)

             :表示的是x1像素坐标处从feature map中取出来的特征向量(descriptor)

                 :relative pose(fundamental matrix)
    

下边来看具体实现

        1. loss

            定义无监督的匹配(既然不需要标注匹配那么是如何实现的呢,请往下看):

            

上图中M1表示image1输出的dense 的feature map,M2表示image2输出的dense的feature map,

首先计算x1在M2中的匹配的分布情况,那么可以得到:

            

    其中分母表示x1和M2中的所有detector的descriptor计算距离(向量积)之和,分子表示和M2中的某个detector

     计算距离,可以知道,越是正确的匹配上述p越大,因此得到的这个概率可以认为是x1和M2种的x的匹配的概率

  那么如何无监督的得到x1在M2中的匹配x2呢??有了概率求期望啊,期望就是“匹配”的位置啊:

            (x1的匹配的期望的位置)

 

            好了已经有了“匹配”了,而且这个匹配还是可微的,那么可以通过relative pose计算loss了(Fx1是极线),

        

  看上图,所谓loss,其实就是误差,有relative pose,想当然的就可以使用极线约束来计算误差呀!!!

            1. 1 假设有匹配的image pair, 他们之间的relative pose F,有极线约束:

                    这样就可以计算右边这张图中的x2到x1投影过来的极线的距离就是误差,有:

                    

                    dist表示点到直线的距离h1->2表示上述的到的x2的位置

            1. 2 有了上述极线还不够,更强的约束是x2的反投影应该距离x1很近,那么有:

                    

Ok,最终的loss:

            

另外文中还在这个loss之前增加了一个均方根的权重,很简单理解。

另外文中在训练的时候为了加速,先在coarse的feature map上得到上述loss,然后再在一个小窗口中得到fine的dense map的loss(提速)都很容易理解

效果提升的也可以

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Nearest neighbor matching with ratio test is a simple and effective technique to filter out incorrect matches between feature descriptors. It works by comparing the distances between a descriptor in the first image and its two nearest neighbors in the second image. If the ratio of the distances is below a certain threshold, the match is considered correct. The ratio test is used to ensure that the nearest neighbor match is significantly closer to the descriptor than the second nearest neighbor. The threshold value for the ratio test is usually set between 0.7 and 0.8, depending on the specific application. Here is an example of how to perform nearest neighbor matching with ratio test in MATLAB: ```matlab % Load feature descriptors for two images descriptors1 = load('descriptors1.mat'); descriptors2 = load('descriptors2.mat'); % Find nearest neighbors using knnsearch idx = knnsearch(descriptors2, descriptors1, 'K', 2); % Apply ratio test threshold = 0.8; matches = []; for i = 1:size(descriptors1, 1) ratio = norm(descriptors1(i,:) - descriptors2(idx(i,1),:)) / norm(descriptors1(i,:) - descriptors2(idx(i,2),:)); if ratio < threshold matches = [matches; i, idx(i,1)]; end end % Visualize matches figure; showMatchedFeatures(image1, image2, points1(matches(:,1),:), points2(matches(:,2),:)); ``` In this example, the knnsearch function is used to find the two nearest neighbors of each descriptor in the second image for each descriptor in the first image. Then, for each descriptor in the first image, the ratio of the distances between the descriptor and its two nearest neighbors in the second image is computed. If the ratio is below the threshold, the match is considered correct and added to the matches matrix. Finally, the matched keypoints are visualized using the showMatchedFeatures function.

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值