【问题标题】:"rectifyStereoImages" in MATLAB not workingMATLAB 中的“rectifyStereoImages”不起作用
【发布时间】:2015-09-17 19:10:40
【问题描述】:

我是第一次在立体视觉中工作。我正在尝试纠正立体图像。以下是结果

我不明白为什么图片会被裁剪

以下是我的代码

% 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

我使用的图片

【问题讨论】:

  • 你能把图片贴出来让我们试试吗?
  • 我已添加图片
  • 可以加stereoParams吗?我们无法运行您的代码!
  • stereoParams 在变量中

标签: matlab image-processing 3d matlab-cvst stereo-3d


【解决方案1】:

尝试执行以下操作:

[J1, J2] = rectifyStereoImages(I1, I2, stereoParams, 'OutputView', 'Full');

这样您将看到整个图像。

默认情况下,rectifyStereoImages 将输出图像裁剪为仅包含两帧之间的重叠部分。在这种情况下,与视差相比,重叠非常小。

这里发生的情况是基线(相机之间的距离)太宽,而到对象的距离太短。这会导致非常大的差异,这将很难可靠地计算。我建议您要么将相机移得更近,要么将相机远离感兴趣的物体,或两者兼而有之。

【讨论】:

  • 我查过了。 I1 是左相机自己拍的
  • 感谢您发布您的图片。我已经更新了答案。
  • 我做到了。现在我可以看到整个图像。但如教程1drv.ms/1HvgXck所示,未正确纠正
  • 这很奇怪。如您所见,我从您发布的图像中得到了合理的纠正。尝试交换 I1 和 I2。
  • “矫正”表示核线是水平的,对应的点在同一像素行上。您获得多少重叠取决于相机的基线和方向。
猜你喜欢
  • 1970-01-01
  • 2015-11-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多