1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

add new contour filtering, test, refactoring

This commit is contained in:
Alex
2023-11-09 11:22:04 +03:00
parent e202116b56
commit 84590f96e5
6 changed files with 336 additions and 279 deletions
@@ -33,7 +33,7 @@ struct CV_EXPORTS_W_SIMPLE DetectorParameters {
polygonalApproxAccuracyRate = 0.03;
minCornerDistanceRate = 0.05;
minDistanceToBorder = 3;
minMarkerDistanceRate = 0.05;
minMarkerDistanceRate = 0.125;
cornerRefinementMethod = (int)CORNER_REFINE_NONE;
cornerRefinementWinSize = 5;
relativeCornerRefinmentWinSize = 0.3f;
@@ -100,12 +100,26 @@ struct CV_EXPORTS_W_SIMPLE DetectorParameters {
/// minimum distance of any corner to the image border for detected markers (in pixels) (default 3)
CV_PROP_RW int minDistanceToBorder;
/** @brief minimum mean distance beetween two marker corners to be considered imilar, so that the smaller one is removed.
/** @brief minimum average distance between the corners of the two markers to be grouped (default 0.125).
*
* The rate is relative to the smaller perimeter of the two markers (default 0.05).
* The rate is relative to the smaller perimeter of the two markers.
* Two markers are grouped if average distance between the corners of the two markers is less than
* min(MarkerPerimeter1, MarkerPerimeter2)*minMarkerDistanceRate.
*
* default value is 0.125 because 0.125*MarkerPerimeter = (MarkerPerimeter / 4) * 0.5 = half the side of the marker.
*
* @note default value was changed from 0.05 after 4.8.1 release, because the filtering algorithm has been changed.
* Now a few candidates from the same group can be added to the list of candidates if they are far from each other.
* @sa minGroupDistance.
*/
CV_PROP_RW double minMarkerDistanceRate;
/** @brief minimum average distance between the corners of the two markers in group to add them to the list of candidates
*
* The average distance between the corners of the two markers is calculated relative to its module size (default 0.21).
*/
CV_PROP_RW float minGroupDistance = 0.21f;
/** @brief default value CORNER_REFINE_NONE */
CV_PROP_RW int cornerRefinementMethod;