Commit 866b15dd authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #16787 from D-Alex:master

parents 034a5f14 d594e725
...@@ -3323,14 +3323,16 @@ cv::Scalar Chessboard::Board::calcEdgeSharpness(cv::InputArray _img,float rise_d ...@@ -3323,14 +3323,16 @@ cv::Scalar Chessboard::Board::calcEdgeSharpness(cv::InputArray _img,float rise_d
// build vertical lines // build vertical lines
for(int col = 1;col< tcols-1;++col) for(int col = 1;col< tcols-1;++col)
{ {
std::vector<cv::Point2f>::const_iterator iter1 = centers.begin()+col; // avoid using iterators to not trigger out of range
std::vector<cv::Point2f>::const_iterator iter2 = iter1+tcols; int i1 = col;
for(int row= 0;row<trows-1;++row,iter1+=tcols,iter2+=tcols) int i2 = i1 + tcols;
pairs.push_back(std::make_pair(*iter1,*iter2)); for (int row = 0; row < trows - 1; ++row, i1 += tcols, i2 += tcols)
{
pairs.push_back(std::make_pair(centers[i1], centers[i2]));
}
} }
} }
// calc edge response for each line // calc edge response for each line
cv::Rect rect(0,0,img.cols,img.rows); cv::Rect rect(0,0,img.cols,img.rows);
std::vector<std::pair<cv::Point2f,cv::Point2f> >::const_iterator iter = pairs.begin(); std::vector<std::pair<cv::Point2f,cv::Point2f> >::const_iterator iter = pairs.begin();
......
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