Commit fce75cd8 authored by Wenfeng CAI's avatar Wenfeng CAI

Fix failure to request stddev of non-intrinsics

Before this fix, the code would fail if only standard deviations of
extrinsic parameters are requested. While standard deviations matrix
should be computed if any set of standard deviations is requested. A
variable is added to represent this case.
parent 53ad291e
......@@ -3426,7 +3426,8 @@ double cv::calibrateCamera(InputArrayOfArrays _objectPoints,
tvecM = _tvecs.getMat();
}
if( stddev_needed || stddev_ext_needed )
bool stddev_any_needed = stddev_needed || stddev_ext_needed;
if( stddev_any_needed )
{
stdDeviationsM.create(nimages*6 + CV_CALIB_NINTRINSIC, 1, CV_64F);
}
......@@ -3447,7 +3448,7 @@ double cv::calibrateCamera(InputArrayOfArrays _objectPoints,
&c_cameraMatrix, &c_distCoeffs,
rvecs_needed ? &c_rvecM : NULL,
tvecs_needed ? &c_tvecM : NULL,
stddev_needed ? &c_stdDev : NULL,
stddev_any_needed ? &c_stdDev : NULL,
errors_needed ? &c_errors : NULL, flags, cvTermCriteria(criteria));
if( stddev_needed )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment