cvStereoRectify divide by zero (Patch #2099)


Added by Philip Van Valkenberg over 12 years ago. Updated over 12 years ago.


Status:Done Start date:2012-06-27
Priority:Low Due date:
Assignee:Andrey Kamaev % Done:

0%

Category:calibration, 3d
Target version:2.4.2
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

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

Revision 6c3137a8
Added by Andrey Kamaev over 12 years ago

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

Also available in: Atom PDF