【问题标题】:MATLAB : epipolar lines doesn't intersect with the points (fundamental matrix)MATLAB:极线不与点相交(基本矩阵)
【发布时间】:2014-07-14 10:42:47
【问题描述】:

我在 matlab 中的基本矩阵计算和极线存在严重问题。你可以在这里看到结果图片:Matlab issue

如您所见,点和线之间存在某种偏移。我应该准确地说我尝试了与以下代码不同的方法:使用 matlab 函数(epipolarline)以及手动选择两个图像之间的点而不是检测。我还手动计算了基本矩阵 (F_8 = transpose(inv(M_B))*St*inv(M_A);) 但它没有改变任何东西。

它不应该与不包括相应图像点的极线相关联,对吧? 如果您能快速查看并帮助我,我将不胜感激!这是我的代码:

    % 8 point algorithm %
    points_A = detectHarrisFeatures(rgb2gray(imgA));
    points_B = detectHarrisFeatures(rgb2gray(imgB));
    [featuresA, valid_pointsA] = extractFeatures(rgb2gray(imgA), points_A);
    [featuresB, valid_pointsB] = extractFeatures(rgb2gray(imgB), points_B);
    indexes = matchFeatures(featuresA,featuresB, 'MaxRatio', 0.65);
    matchedPointsA = valid_pointsA(indexes(:, 1), :);
    matchedPointsB = valid_pointsB(indexes(:, 2), :);

    F_8 = estimateFundamentalMatrix(matchedPointsA, matchedPointsB,'Method','Norm8Point');

    % Epipolar lines %
    figure()
    imgB = imread('asanB.jpg');
    imshow(imgB);
    hold on;

    for i = 1:size(image_points_B,1)
        line = F_8'*[matchedPointsB.Location(i,:),1]';

        points_x = [0,size(imgB,2)];
        points_y = [(-points_x(1)*line(1)-line(3))/line(2)...
            (-points_x(2)*line(1)-line(3))/line(2)];

        plot(matchedPointsB.Location(i,1),matchedPointsB.Location(i,2),'r.','MarkerSize',20)                         
        plot(points_x,points_y);
    end;

    hold off

【问题讨论】:

    标签: matlab geometry computer-vision stereo-3d matlab-cvst


    【解决方案1】:

    这是完全正常的。基本矩阵的估计对噪声很敏感,因此对应点很少恰好在核线上。通常,您会引入一些容差阈值来消除与相应核线相距太远的不良匹配。

    从更多好的匹配开始,您可能会获得更好的结果。您可能想尝试不同的兴趣点检测器和/或不同的描述符。 extractFeatures 默认使用带有 Harris 角的 FREAK 描述符。您可以通过设置“方法”参数使其使用不同的描述符。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-04
      • 1970-01-01
      • 2012-07-28
      • 2014-03-01
      • 2017-06-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多