Ask Your Question
1

Error with cv2.stereoRectify

asked Mar 8 '13

ormapper gravatar image

I'm getting the following error when trying to implement cv2.stereoRectify:

error: C:\slave\WinInstallerMegaPack\src\opencv\modules\imgproc\src\undistort.cpp:292: error: (-215) CV_IS_MAT(_distCoeffs) && (_distCoeffs->rows == 1 || _distCoeffs->cols == 1) && (_distCoeffs->rows_distCoeffs->cols == 4 || _distCoeffs->rows_distCoeffs->cols == 5 || _distCoeffs->rows*_distCoeffs->cols == 8)

My distCoeffs array looks like this:

[[-0.00716872 -0.02469766  0.00481753 -0.00261278]]

Is something wrong with it? In case it matters, I'm running OpenCV 2.44

Preview: (hide)

1 answer

Sort by » oldest newest most voted
4

answered Mar 15 '13

ormapper gravatar image

updated Mar 15 '13

I figured this out. It wasn't my distCoeffs at all but the order I had the parameters in cv2.stereoRectify.

As the cv2 version appears to be undocumented as of yet, I was following the syntax for cv.StereoRectify and the parameter order is different.

cv2.stereoRectify: (cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, ...) cv.StereoRectify: (cameraMatrix1, cameraMatrix2, distCoeffs1, distCoeffs2, imageSize, ...)

Preview: (hide)

Question Tools

Stats

Asked: Mar 8 '13

Seen: 1,887 times

Last updated: Mar 15 '13