markerUnc as required outputArray when calling detectMarkersWithUnc

This commit is contained in:
jonas 2025-03-18 19:12:31 +01:00
parent 9f137b16e3
commit 3314b7d085
3 changed files with 7 additions and 7 deletions

View File

@ -327,11 +327,11 @@ public:
* @param ids vector of identifiers of the detected markers. The identifier is of type int
* (e.g. std::vector<int>). For N detected markers, the size of ids is also N.
* The identifiers have the same order than the markers in the imgPoints array.
* @param rejectedImgPoints contains the imgPoints of those squares whose inner code has not a
* correct codification. Useful for debugging purposes.
* @param markersUnc contains the normalized uncertainty [0;1] of the markers' detection,
* defined as percentage of incorrect pixel detections, with 0 describing a pixel perfect detection.
* The uncertainties are of type float (e.g. std::vector<float>)
* @param rejectedImgPoints contains the imgPoints of those squares whose inner code has not a
* correct codification. Useful for debugging purposes.
*
* Performs marker detection in the input image. Only markers included in the first specified dictionary
* are searched. For each detected marker, it returns the 2D position of its corner in the image
@ -341,8 +341,8 @@ public:
* input image with corresponding camera model, if camera parameters are known
* @sa undistort, estimatePoseSingleMarkers, estimatePoseBoard
*/
CV_WRAP void detectMarkersWithUnc(InputArray image, OutputArrayOfArrays corners, OutputArray ids,
OutputArrayOfArrays rejectedImgPoints = noArray(), OutputArray markersUnc = noArray()) const;
CV_WRAP void detectMarkersWithUnc(InputArray image, OutputArrayOfArrays corners, OutputArray ids, OutputArray markersUnc,
OutputArrayOfArrays rejectedImgPoints = noArray()) const;
/** @brief Refine not detected markers based on the already detected and the board layout
*

View File

@ -1174,8 +1174,8 @@ ArucoDetector::ArucoDetector(const vector<Dictionary> &_dictionaries,
arucoDetectorImpl = makePtr<ArucoDetectorImpl>(_dictionaries, _detectorParams, _refineParams);
}
void ArucoDetector::detectMarkersWithUnc(InputArray _image, OutputArrayOfArrays _corners, OutputArray _ids,
OutputArrayOfArrays _rejectedImgPoints, OutputArray _markersUnc) const {
void ArucoDetector::detectMarkersWithUnc(InputArray _image, OutputArrayOfArrays _corners, OutputArray _ids, OutputArray _markersUnc,
OutputArrayOfArrays _rejectedImgPoints) const {
arucoDetectorImpl->detectMarkers(_image, _corners, _ids, _rejectedImgPoints, noArray(), _markersUnc, DictionaryMode::Single);
}

View File

@ -539,7 +539,7 @@ void CV_ArucoDetectionUnc::run(int) {
vector<vector<Point2f>> corners, rejected;
vector<int> ids;
vector<float> markerUnc;
detector.detectMarkersWithUnc(img, corners, ids, rejected, markerUnc);
detector.detectMarkersWithUnc(img, corners, ids, markerUnc, rejected);
// Verify that every marker is detected and its uncertainty is within tolerance.
for (size_t m = 0; m < groundTruthIds.size(); m++) {