cvStereoRectify divide by zero (Patch #2099)
Description
If an idealized stereo rig is passed into cvStereoRectify, one where the cameras are already coplanar and separated along either the [1,0,0] or [0,1,0] axes, a divide-by-zero occurs in the function and the resultant matrices contains #IND and #QNAN values (Windows build).
Although one might question the utility of calling cvStereoRectify with such rig, it should not produce bad results.
It can be fixed with the following one line change to calibration.cpp:
1 if (nw > 0.0)
2 cvConvertScale(&ww, &ww, acos(fabs(c)/nt)/nw);
Associated revisions
Fixed divide by zero problem in cvStereoRectify (thanks to Philip Van Valkenberg) #2099
History
Updated by Andrey Kamaev over 12 years ago
Thanks, your patch is applied to the OpenCV trunk.
- Status changed from Open to Done
- Target version set to 2.4.2
- Assignee set to Andrey Kamaev