matlab - "rectifyStereoImages"在 MATLAB 中不工作

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

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

我不明白为什么图像被裁剪

以下是我的代码

% 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

我使用的图像

enter image description here

enter image description here

最佳答案

尝试执行以下操作:

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

这样您就可以看到整个图像。 enter image description here

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

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

关于matlab - "rectifyStereoImages"在 MATLAB 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31147575/

相关文章:

multithreading - Matlab 'svd'在N个线程上

matlab - 从 Matlab 中的 Gumbel 分布中抽取随机数

c++ - OpenCV:为什么 ROI Mat 会失真?

android - glsl编程架构哪一部分是 "really"并行执行?

matlab - 在任何地方调用用户定义的函数? (MATLAB)

python - 如何在 Python 中打开外部 .exe 文件后打开文件菜单,然后单击其子菜单之一?

java - Java/J2ME 中的 3D 动画?

ios - 如何使用 SceneKit iOS 添加背面图像作为纹理

c++ - 如何正确地使用四元数进行旋转

matlab 代码分析器产生空的工具提示