Merge pull request #16787 from D-Alex:master

pull/16796/head
Alexander Alekhin 5 years ago
commit 866b15ddb8
  1. 12
      modules/calib3d/src/chessboard.cpp

@ -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();

Loading…
Cancel
Save