The main functionality of ArucoDetector class is detection of markers in an image with detectMarkers() method.
More...
#include <aruco_detector.hpp>
|
CV_WRAP | ArucoDetector (const Dictionary &dictionary=getPredefinedDictionary(cv::aruco::DICT_4X4_50), const DetectorParameters &detectorParams=DetectorParameters(), const RefineParameters &refineParams=RefineParameters()) |
| Basic ArucoDetector constructor. More...
|
|
CV_WRAP void | detectMarkers (InputArray image, OutputArrayOfArrays corners, OutputArray ids, OutputArrayOfArrays rejectedImgPoints=noArray()) const |
| Basic marker detection. More...
|
|
CV_WRAP void | refineDetectedMarkers (InputArray image, const Board &board, InputOutputArrayOfArrays detectedCorners, InputOutputArray detectedIds, InputOutputArrayOfArrays rejectedCorners, InputArray cameraMatrix=noArray(), InputArray distCoeffs=noArray(), OutputArray recoveredIdxs=noArray()) const |
| Refine not detected markers based on the already detected and the board layout. More...
|
|
CV_WRAP const Dictionary & | getDictionary () const |
|
CV_WRAP void | setDictionary (const Dictionary &dictionary) |
|
CV_WRAP const DetectorParameters & | getDetectorParameters () const |
|
CV_WRAP void | setDetectorParameters (const DetectorParameters &detectorParameters) |
|
CV_WRAP const RefineParameters & | getRefineParameters () const |
|
CV_WRAP void | setRefineParameters (const RefineParameters &refineParameters) |
|
virtual void | write (FileStorage &fs) const override |
| Stores algorithm parameters in a file storage. More...
|
|
CV_WRAP void | write (FileStorage &fs, const String &name) |
| simplified API for language bindings More...
|
|
virtual CV_WRAP void | read (const FileNode &fn) override |
| Reads algorithm parameters from a file storage. More...
|
|
| Algorithm () |
|
virtual | ~Algorithm () |
|
virtual CV_WRAP void | clear () |
| Clears the algorithm state. More...
|
|
CV_WRAP void | write (FileStorage &fs, const String &name) const |
|
void | write (const Ptr< FileStorage > &fs, const String &name=String()) const |
|
virtual CV_WRAP bool | empty () const |
| Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. More...
|
|
virtual CV_WRAP void | save (const String &filename) const |
|
virtual CV_WRAP String | getDefaultName () const |
|
The main functionality of ArucoDetector class is detection of markers in an image with detectMarkers() method.
After detecting some markers in the image, you can try to find undetected markers from this dictionary with refineDetectedMarkers() method.
- See also
- DetectorParameters, RefineParameters
◆ ArucoDetector()
Basic ArucoDetector constructor.
- Parameters
-
dictionary | indicates the type of markers that will be searched |
detectorParams | marker detection parameters |
refineParams | marker refine detection parameters |
◆ detectMarkers()
Basic marker detection.
- Parameters
-
image | input image |
corners | vector of detected marker corners. For each marker, its four corners are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array is Nx4. The order of the corners is clockwise. |
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. |
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 specific dictionary are searched. For each detected marker, it returns the 2D position of its corner in the image and its corresponding identifier. Note that this function does not perform pose estimation.
- Note
- The function does not correct lens distortion or takes it into account. It's recommended to undistort input image with corresponding camera model, if camera parameters are known
- See also
- undistort, estimatePoseSingleMarkers, estimatePoseBoard
◆ getDetectorParameters()
◆ getDictionary()
◆ getRefineParameters()
◆ read()
Reads algorithm parameters from a file storage.
Reimplemented from cv::Algorithm.
◆ refineDetectedMarkers()
Refine not detected markers based on the already detected and the board layout.
- Parameters
-
image | input image |
board | layout of markers in the board. |
detectedCorners | vector of already detected marker corners. |
detectedIds | vector of already detected marker identifiers. |
rejectedCorners | vector of rejected candidates during the marker detection process. |
cameraMatrix | optional input 3x3 floating-point camera matrix |
distCoeffs | optional vector of distortion coefficients of 4, 5, 8 or 12 elements |
recoveredIdxs | Optional array to returns the indexes of the recovered candidates in the original rejectedCorners array. |
This function tries to find markers that were not detected in the basic detecMarkers function. First, based on the current detected marker and the board layout, the function interpolates the position of the missing markers. Then it tries to find correspondence between the reprojected markers and the rejected candidates based on the minRepDistance and errorCorrectionRate parameters. If camera parameters and distortion coefficients are provided, missing markers are reprojected using projectPoint function. If not, missing marker projections are interpolated using global homography, and all the marker corners in the board must have the same Z coordinate.
◆ setDetectorParameters()
◆ setDictionary()
CV_WRAP void cv::aruco::ArucoDetector::setDictionary |
( |
const Dictionary & |
dictionary | ) |
|
◆ setRefineParameters()
◆ write() [1/2]
virtual void cv::aruco::ArucoDetector::write |
( |
FileStorage & |
fs | ) |
const |
|
overridevirtual |
Stores algorithm parameters in a file storage.
Reimplemented from cv::Algorithm.
◆ write() [2/2]
simplified API for language bindings
◆ arucoDetectorImpl
Ptr<ArucoDetectorImpl> cv::aruco::ArucoDetector::arucoDetectorImpl |
|
protected |
The documentation for this class was generated from the following file: