Ask Your Question
1

Error with cv2.stereoRectify

asked 2013-03-08 13:42:04 -0600

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
4

answered 2013-03-15 08:14:55 -0600

ormapper gravatar image

updated 2013-03-15 08:19:08 -0600

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, ...)

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-03-08 13:42:04 -0600

Seen: 1,843 times

Last updated: Mar 15 '13