2

I am not trying to rectify a pair of stereo images but I am getting a strange error from the function

Error using rectifyStereoImages (line 106)
Not enough input arguments.

Error in RealTimeProcessing>captureButton_Callback (line 134)
[I1Rect, I2Rect] = rectifyStereoImages(I1, I2,stereoParams);

The line of code I have written is

[I1Rect, I2Rect] = rectifyStereoImages(I1, I2,stereoParams);

As you can see, the two images and the stereoParameters are present. I obtained the stereoParams by using the Stereo Camera Calibration Tool in MATLAB. Is there some input I am missing? The link to files are here. I have included the two input images and the stereoParams.

2
  • It gives me a path to rectifyStereoImages.m files /Applications/MATLAB_R2015b.app/toolbox/vision/vision/rectifyStereoImages.m Apr 24, 2016 at 14:50
  • It works when I use this tutorial. But I have calibrated my cameras so I am using this and it gives that error. Apr 24, 2016 at 14:54

1 Answer 1

2

What does class(stereoParams) return?

rectifyStereoImages function has two syntaxes: calibrated and uncalibrated. For the calibrated case it takes the two images and a stereoParameters object. For the uncalibrated case it takes the two images and two projective transformation objects of class projective2d.

From what you've written it seems that your stereoParams is actually a projective transform object. In that case, rectifyStereoImages goes into the uncalibrated mode, and expects two of them.

1
  • I ran class(stereoParams) and realized the stereoParams object I had was stored as an 1x1 object with the original stereoParams inside it. So I just replaced the line [I1Rect, I2Rect] = rectifyStereoImages(I1, I2,stereoParams); with [I1Rect, I2Rect] = rectifyStereoImages(I1, I2,stereoParams.stereoParams); It works perfectly now. Thank You. Apr 28, 2016 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.