(Depth estimation) The rectified images do not have enough common rectangle region

Hello dear people,
I am pretty new with matlab and currently trying to get a depth estimation working with the following setup.
Calibration seems to be working:
Now i want to get a depth estimation from my pictures:
If i now try to get a depth estimation with the code from the "depth estimation from stereo video" guide i get the following error:
The rectified images do not have enough common rectangle region. Switch to 'full' output view instead.
And i am not sure what my error is and how to fix it.
I attached my project files. I'm sorry if those are not enough information for you, let me know what you need.

Answers (1)

Hi,
First try the following in your code.
[frameLeftRect, frameRightRect] = rectifyStereoImages(frameLeft, frameRight, stereoParams, 'OutputView', 'Full');
By default, rectifyStereoImages crops the output images to only contain the overlap between the two frames. In this case the overlap is very small compared to the disparity.
Also, from my understanding by looking at the setup, you are using Point Grey cameras. Their baseline (distance between cameras) is too close. I would recommend increasing the stereo setup baseline to get better advantage of using Stereo Point Grey Cameras.

1 Comment

Thank you for your help and sorry for my late answer.
So you mean like that?
I1 = imread('C:\Users\pc\Desktop\matlab\bilder\bilder von 1\cam1\schraube1.bmp');
I2 = imread('C:\Users\pc\Desktop\matlab\bilder\bilder von 1\cam2\schraube2.bmp');
[frameLeftRect, frameRightRect] = rectifyStereoImages(I1, I2, stereoParams, 'OutputView', 'Full');
figure;
imshow(stereoAnaglyph(frameLeftRect, frameRightRect));
title('Rectified Video Frames');
If so I just get the following picture:
test1.bmp
I tried positionig the cameras with a distance of about 15cm from each other but unfortunately
the stereo calib app can't find the checkerboard anymore.

Sign in to comment.

Asked:

on 23 Oct 2019

Commented:

on 11 Nov 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!