Skip to content

Commit 7a67691

Browse files
committed
omnidir: fix wrong memory access in estimateUncertainties
1 parent f953e69 commit 7a67691

File tree

2 files changed

+1
-51
lines changed

2 files changed

+1
-51
lines changed

modules/ccalib/include/opencv2/ccalib/omnidir.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,6 @@ namespace internal
278278
double computeMeanReproErrStereo(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2, InputArray K1, InputArray K2,
279279
InputArray D1, InputArray D2, double xi1, double xi2, InputArray om, InputArray T, InputArrayOfArrays omL, InputArrayOfArrays TL);
280280

281-
void checkFixed(Mat &G, int flags, int n);
282-
283281
void subMatrix(const Mat& src, Mat& dst, const std::vector<int>& cols, const std::vector<int>& rows);
284282

285283
void flags2idx(int flags, std::vector<int>& idx, int n);
@@ -309,4 +307,4 @@ namespace internal
309307
} // omnidir
310308

311309
} //cv
312-
#endif
310+
#endif

modules/ccalib/src/omnidir.cpp

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,8 +1785,6 @@ void cv::omnidir::internal::estimateUncertainties(InputArrayOfArrays objectPoint
17851785

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

1788-
checkFixed(errors, flags, n);
1789-
17901788
rms = 0;
17911789
const Vec2d* ptr_ex = reprojError.ptr<Vec2d>();
17921790
for (int i = 0; i < (int)reprojError.total(); i++)
@@ -1995,52 +1993,6 @@ double cv::omnidir::internal::computeMeanReproErrStereo(InputArrayOfArrays objec
19951993
return reProErr;
19961994
}
19971995

1998-
void cv::omnidir::internal::checkFixed(Mat& G, int flags, int n)
1999-
{
2000-
int _flags = flags;
2001-
if(_flags >= omnidir::CALIB_FIX_CENTER)
2002-
{
2003-
G.at<double>(6*n+3) = 0;
2004-
G.at<double>(6*n+4) = 0;
2005-
_flags -= omnidir::CALIB_FIX_CENTER;
2006-
}
2007-
if(_flags >= omnidir::CALIB_FIX_GAMMA)
2008-
{
2009-
G.at<double>(6*n) = 0;
2010-
G.at<double>(6*n+1) = 0;
2011-
_flags -= omnidir::CALIB_FIX_GAMMA;
2012-
}
2013-
if(_flags >= omnidir::CALIB_FIX_XI)
2014-
{
2015-
G.at<double>(6*n + 5) = 0;
2016-
_flags -= omnidir::CALIB_FIX_XI;
2017-
}
2018-
if(_flags >= omnidir::CALIB_FIX_P2)
2019-
{
2020-
G.at<double>(6*n + 9) = 0;
2021-
_flags -= omnidir::CALIB_FIX_P2;
2022-
}
2023-
if(_flags >= omnidir::CALIB_FIX_P1)
2024-
{
2025-
G.at<double>(6*n + 8) = 0;
2026-
_flags -= omnidir::CALIB_FIX_P1;
2027-
}
2028-
if(_flags >= omnidir::CALIB_FIX_K2)
2029-
{
2030-
G.at<double>(6*n + 7) = 0;
2031-
_flags -= omnidir::CALIB_FIX_K2;
2032-
}
2033-
if(_flags >= omnidir::CALIB_FIX_K1)
2034-
{
2035-
G.at<double>(6*n + 6) = 0;
2036-
_flags -= omnidir::CALIB_FIX_K1;
2037-
}
2038-
if(_flags >= omnidir::CALIB_FIX_SKEW)
2039-
{
2040-
G.at<double>(6*n + 2) = 0;
2041-
}
2042-
}
2043-
20441996
// This function is from fisheye.cpp
20451997
void cv::omnidir::internal::subMatrix(const Mat& src, Mat& dst, const std::vector<int>& cols, const std::vector<int>& rows)
20461998
{

0 commit comments

Comments
 (0)