@@ -1782,13 +1782,15 @@ void cv::omnidir::internal::estimateUncertainties(InputArrayOfArrays objectPoint
1782
1782
1783
1783
Mat sigma_x;
1784
1784
meanStdDev (reprojError.reshape (1 ,1 ), noArray (), sigma_x);
1785
- sigma_x *= sqrt (2.0 *(double )reprojError.total ()/(2.0 *(double )reprojError.total () - 1.0 ));
1786
- double s = sigma_x.at <double >(0 );
1787
1785
1788
1786
Mat _JTJ_inv, _JTE;
1789
1787
computeJacobian (objectPoints, imagePoints, parameters, _JTJ_inv, _JTE, flags, 0.0 );
1790
1788
sqrt (_JTJ_inv, _JTJ_inv);
1791
1789
1790
+ int nParams = _JTJ_inv.rows ;
1791
+ sigma_x *= sqrt (2.0 *(double )reprojError.total ()/(2.0 *(double )reprojError.total () - nParams));
1792
+ double s = sigma_x.at <double >(0 );
1793
+
1792
1794
errors = 3 * s * _JTJ_inv.diag ();
1793
1795
1794
1796
rms = 0 ;
@@ -1868,13 +1870,15 @@ void cv::omnidir::internal::estimateUncertaintiesStereo(InputArrayOfArrays objec
1868
1870
1869
1871
Mat sigma_x;
1870
1872
meanStdDev (reprojErrorAll.reshape (1 ,1 ), noArray (), sigma_x);
1871
- sigma_x *= sqrt (2.0 *(double )reprojErrorAll.total ()/(2.0 *(double )reprojErrorAll.total () - 1.0 ));
1872
- double s = sigma_x.at <double >(0 );
1873
1873
1874
1874
Mat _JTJ_inv, _JTE;
1875
1875
computeJacobianStereo (objectPoints, imagePoints1, imagePoints2, _parameters, _JTJ_inv, _JTE, flags, 0.0 );
1876
1876
cv::sqrt (_JTJ_inv, _JTJ_inv);
1877
1877
1878
+ int nParams = _JTJ_inv.rows ;
1879
+ sigma_x *= sqrt (2.0 *(double )reprojErrorAll.total ()/(2.0 *(double )reprojErrorAll.total () - nParams));
1880
+ double s = sigma_x.at <double >(0 );
1881
+
1878
1882
errors = 3 * s * _JTJ_inv.diag ();
1879
1883
1880
1884
rms = 0 ;
0 commit comments