Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Jan 28, 2023
2 parents 529131e + f18f127 commit 4035046
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions modules/ccalib/src/omnidir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1782,13 +1782,15 @@ void cv::omnidir::internal::estimateUncertainties(InputArrayOfArrays objectPoint

Mat sigma_x;
meanStdDev(reprojError.reshape(1,1), noArray(), sigma_x);
sigma_x *= sqrt(2.0*(double)reprojError.total()/(2.0*(double)reprojError.total() - 1.0));
double s = sigma_x.at<double>(0);

Mat _JTJ_inv, _JTE;
computeJacobian(objectPoints, imagePoints, parameters, _JTJ_inv, _JTE, flags, 0.0);
sqrt(_JTJ_inv, _JTJ_inv);

int nParams = _JTJ_inv.rows;
sigma_x *= sqrt(2.0*(double)reprojError.total()/(2.0*(double)reprojError.total() - nParams));
double s = sigma_x.at<double>(0);

errors = 3 * s * _JTJ_inv.diag();

rms = 0;
Expand Down Expand Up @@ -1868,13 +1870,15 @@ void cv::omnidir::internal::estimateUncertaintiesStereo(InputArrayOfArrays objec

Mat sigma_x;
meanStdDev(reprojErrorAll.reshape(1,1), noArray(), sigma_x);
sigma_x *= sqrt(2.0*(double)reprojErrorAll.total()/(2.0*(double)reprojErrorAll.total() - 1.0));
double s = sigma_x.at<double>(0);

Mat _JTJ_inv, _JTE;
computeJacobianStereo(objectPoints, imagePoints1, imagePoints2, _parameters, _JTJ_inv, _JTE, flags, 0.0);
cv::sqrt(_JTJ_inv, _JTJ_inv);

int nParams = _JTJ_inv.rows;
sigma_x *= sqrt(2.0*(double)reprojErrorAll.total()/(2.0*(double)reprojErrorAll.total() - nParams));
double s = sigma_x.at<double>(0);

errors = 3 * s * _JTJ_inv.diag();

rms = 0;
Expand Down

0 comments on commit 4035046

Please sign in to comment.