我是第一次在立体视觉中工作。我正在尝试纠正立体图像。以下是结果
我不明白为什么图像被裁剪
以下是我的代码
% Read in the stereo pair of images.
I1 = imread('sceneReconstructionLeft.jpg');
I2 = imread('sceneReconstructionRight.jpg');
% Rectify the images.
[J1, J2] = rectifyStereoImages(I1, I2, stereoParams);
% Display the images before rectification.
figure;
imshow(stereoAnaglyph(I1, I2), 'InitialMagnification', 50);
title('Before Rectification');
% Display the images after rectification.
figure;
imshow(stereoAnaglyph(J1, J2), 'InitialMagnification', 50);
title('After Rectification');
我正在尝试遵循本指南
http://www.mathworks.com/help/vision/examples/stereo-calibration-and-scene-reconstruction.html
我使用的图像
最佳答案
尝试执行以下操作:
[J1, J2] = rectifyStereoImages(I1, I2, stereoParams, 'OutputView', 'Full');
这样您就可以看到整个图像。
默认情况下,rectifyStereoImages
会将输出图像裁剪为仅包含两个帧之间的重叠部分。在这种情况下,与视差相比,重叠非常小。
这里发生的情况是基线(摄像机之间的距离)太宽,而到物体的距离太短。这会导致非常大的差异,很难可靠地计算。我建议您将相机移得更近,或将相机移得远离感兴趣的对象,或两者兼而有之。
关于matlab - "rectifyStereoImages"在 MATLAB 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31147575/