mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-19 11:21:39 +08:00
making minRepDistance not quadratically dependent on the image pizel size anymore
This commit is contained in:
@@ -738,7 +738,7 @@ void detectCharucoDiamond(InputArray _image, InputArrayOfArrays _markerCorners,
|
|||||||
|
|
||||||
CV_Assert(_markerIds.total() > 0 && _markerIds.total() == _markerCorners.total());
|
CV_Assert(_markerIds.total() > 0 && _markerIds.total() == _markerCorners.total());
|
||||||
|
|
||||||
const float minRepDistanceRate = 0.12f;
|
const float minRepDistanceRate = 1.302455f;
|
||||||
|
|
||||||
// create Charuco board layout for diamond (3x3 layout)
|
// create Charuco board layout for diamond (3x3 layout)
|
||||||
Ptr<Dictionary> dict = getPredefinedDictionary(PREDEFINED_DICTIONARY_NAME(0));
|
Ptr<Dictionary> dict = getPredefinedDictionary(PREDEFINED_DICTIONARY_NAME(0));
|
||||||
@@ -771,7 +771,7 @@ void detectCharucoDiamond(InputArray _image, InputArrayOfArrays _markerCorners,
|
|||||||
perimeterSq += edge.x*edge.x + edge.y*edge.y;
|
perimeterSq += edge.x*edge.x + edge.y*edge.y;
|
||||||
}
|
}
|
||||||
// maximum reprojection error relative to perimeter
|
// maximum reprojection error relative to perimeter
|
||||||
float minRepDistance = perimeterSq * minRepDistanceRate * minRepDistanceRate;
|
float minRepDistance = sqrt(perimeterSq) * minRepDistanceRate;
|
||||||
|
|
||||||
int currentId = _markerIds.getMat().at< int >(i);
|
int currentId = _markerIds.getMat().at< int >(i);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user