mirror of
https://github.com/opencv/opencv.git
synced 2025-08-01 02:18:01 +08:00
Merge pull request #24595 from MaximSmolskiy:fix-typo-inChessBoardDetector-generateQuads
Fix typo in ChessBoardDetector::generateQuads #24595 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
parent
75f619fe00
commit
34c406ea3a
@ -1730,8 +1730,8 @@ void ChessBoardDetector::generateQuads(const cv::Mat& image_, int flags)
|
|||||||
all_quads.deallocate();
|
all_quads.deallocate();
|
||||||
all_corners.deallocate();
|
all_corners.deallocate();
|
||||||
|
|
||||||
// empiric bound for minimal allowed perimeter for squares
|
// empiric bound for minimal allowed area for squares
|
||||||
int min_size = 25; //cvRound( image->cols * image->rows * .03 * 0.01 * 0.92 );
|
const int min_area = 25; //cvRound( image->cols * image->rows * .03 * 0.01 * 0.92 );
|
||||||
|
|
||||||
bool filterQuads = (flags & CALIB_CB_FILTER_QUADS) != 0;
|
bool filterQuads = (flags & CALIB_CB_FILTER_QUADS) != 0;
|
||||||
|
|
||||||
@ -1759,7 +1759,7 @@ void ChessBoardDetector::generateQuads(const cv::Mat& image_, int flags)
|
|||||||
const std::vector<Point>& contour = contours[idx];
|
const std::vector<Point>& contour = contours[idx];
|
||||||
|
|
||||||
Rect contour_rect = boundingRect(contour);
|
Rect contour_rect = boundingRect(contour);
|
||||||
if (contour_rect.area() < min_size)
|
if (contour_rect.area() < min_area)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
std::vector<Point> approx_contour;
|
std::vector<Point> approx_contour;
|
||||||
@ -1803,7 +1803,7 @@ void ChessBoardDetector::generateQuads(const cv::Mat& image_, int flags)
|
|||||||
// than rectangular and which are big enough
|
// than rectangular and which are big enough
|
||||||
double d3 = sqrt(normL2Sqr<double>(pt[0] - pt[1]));
|
double d3 = sqrt(normL2Sqr<double>(pt[0] - pt[1]));
|
||||||
double d4 = sqrt(normL2Sqr<double>(pt[1] - pt[2]));
|
double d4 = sqrt(normL2Sqr<double>(pt[1] - pt[2]));
|
||||||
if (!(d3*4 > d4 && d4*4 > d3 && d3*d4 < area*1.5 && area > min_size &&
|
if (!(d3*4 > d4 && d4*4 > d3 && d3*d4 < area*1.5 && area > min_area &&
|
||||||
d1 >= 0.15 * p && d2 >= 0.15 * p))
|
d1 >= 0.15 * p && d2 >= 0.15 * p))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user