【发布时间】: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