EstervQrCode 1.1.1
Library for qr code manipulation
Public Member Functions | Protected Attributes | List of all members

#include <charuco_detector.hpp>

Inheritance diagram for cv::aruco::CharucoDetector:
cv::Algorithm

Public Member Functions

CV_WRAP CharucoDetector (const CharucoBoard &board, const CharucoParameters &charucoParams=CharucoParameters(), const DetectorParameters &detectorParams=DetectorParameters(), const RefineParameters &refineParams=RefineParameters())
 Basic CharucoDetector constructor. More...
 
CV_WRAP const CharucoBoardgetBoard () const
 
CV_WRAP void setBoard (const CharucoBoard &board)
 
CV_WRAP const CharucoParametersgetCharucoParameters () const
 
CV_WRAP void setCharucoParameters (CharucoParameters &charucoParameters)
 
CV_WRAP const DetectorParametersgetDetectorParameters () const
 
CV_WRAP void setDetectorParameters (const DetectorParameters &detectorParameters)
 
CV_WRAP const RefineParametersgetRefineParameters () const
 
CV_WRAP void setRefineParameters (const RefineParameters &refineParameters)
 
CV_WRAP void detectBoard (InputArray image, OutputArray charucoCorners, OutputArray charucoIds, InputOutputArrayOfArrays markerCorners=noArray(), InputOutputArray markerIds=noArray()) const
 detect aruco markers and interpolate position of ChArUco board corners More...
 
CV_WRAP void detectDiamonds (InputArray image, OutputArrayOfArrays diamondCorners, OutputArray diamondIds, InputOutputArrayOfArrays markerCorners=noArray(), InputOutputArray markerIds=noArray()) const
 Detect ChArUco Diamond markers. More...
 
- Public Member Functions inherited from cv::Algorithm
 Algorithm ()
 
virtual ~Algorithm ()
 
virtual CV_WRAP void clear ()
 Clears the algorithm state. More...
 
virtual CV_WRAP void write (FileStorage &fs) const
 Stores algorithm parameters in a file storage. 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 void read (const FileNode &fn)
 Reads algorithm parameters from a file storage. More...
 
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
 

Protected Attributes

Ptr< CharucoDetectorImpl > charucoDetectorImpl
 

Additional Inherited Members

- Static Public Member Functions inherited from cv::Algorithm
template<typename _Tp >
static Ptr< _Tp > read (const FileNode &fn)
 Reads algorithm from the file node. More...
 
template<typename _Tp >
static Ptr< _Tp > load (const String &filename, const String &objname=String())
 Loads algorithm from the file. More...
 
template<typename _Tp >
static Ptr< _Tp > loadFromString (const String &strModel, const String &objname=String())
 Loads algorithm from a String. More...
 
- Protected Member Functions inherited from cv::Algorithm
void writeFormat (FileStorage &fs) const
 

Constructor & Destructor Documentation

◆ CharucoDetector()

CV_WRAP cv::aruco::CharucoDetector::CharucoDetector ( const CharucoBoard board,
const CharucoParameters charucoParams = CharucoParameters(),
const DetectorParameters detectorParams = DetectorParameters(),
const RefineParameters refineParams = RefineParameters() 
)

Basic CharucoDetector constructor.

Parameters
boardChAruco board
charucoParamscharuco detection parameters
detectorParamsmarker detection parameters
refineParamsmarker refine detection parameters

Member Function Documentation

◆ detectBoard()

CV_WRAP void cv::aruco::CharucoDetector::detectBoard ( InputArray  image,
OutputArray  charucoCorners,
OutputArray  charucoIds,
InputOutputArrayOfArrays  markerCorners = noArray(),
InputOutputArray  markerIds = noArray() 
) const

detect aruco markers and interpolate position of ChArUco board corners

Parameters
imageinput image necesary for corner refinement. Note that markers are not detected and should be sent in corners and ids parameters.
charucoCornersinterpolated chessboard corners.
charucoIdsinterpolated chessboard corners identifiers.
markerCornersvector of already detected markers 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 should be Nx4. The order of the corners should be clockwise. If markerCorners and markerCorners are empty, the function detect aruco markers and ids.
markerIdslist of identifiers for each marker in corners. If markerCorners and markerCorners are empty, the function detect aruco markers and ids.

This function receives the detected markers and returns the 2D position of the chessboard corners from a ChArUco board using the detected Aruco markers.

If markerCorners and markerCorners are empty, the detectMarkers() will run and detect aruco markers and ids.

If camera parameters are provided, the process is based in an approximated pose estimation, else it is based on local homography. Only visible corners are returned. For each corner, its corresponding identifier is also returned in charucoIds.

See also
findChessboardCorners
Note
After OpenCV 4.6.0, there was an incompatible change in the ChArUco pattern generation algorithm for even row counts. Use cv::aruco::CharucoBoard::setLegacyPattern() to ensure compatibility with patterns created using OpenCV versions prior to 4.6.0. For more information, see the issue: https://github.com/opencv/opencv/issues/23152

◆ detectDiamonds()

CV_WRAP void cv::aruco::CharucoDetector::detectDiamonds ( InputArray  image,
OutputArrayOfArrays  diamondCorners,
OutputArray  diamondIds,
InputOutputArrayOfArrays  markerCorners = noArray(),
InputOutputArray  markerIds = noArray() 
) const

Detect ChArUco Diamond markers.

Parameters
imageinput image necessary for corner subpixel.
diamondCornersoutput list of detected diamond corners (4 corners per diamond). The order is the same than in marker corners: top left, top right, bottom right and bottom left. Similar format than the corners returned by detectMarkers (e.g std::vector<std::vector<cv::Point2f> > ).
diamondIdsids of the diamonds in diamondCorners. The id of each diamond is in fact of type Vec4i, so each diamond has 4 ids, which are the ids of the aruco markers composing the diamond.
markerCornerslist of detected marker corners from detectMarkers function. If markerCorners and markerCorners are empty, the function detect aruco markers and ids.
markerIdslist of marker ids in markerCorners. If markerCorners and markerCorners are empty, the function detect aruco markers and ids.

This function detects Diamond markers from the previous detected ArUco markers. The diamonds are returned in the diamondCorners and diamondIds parameters. If camera calibration parameters are provided, the diamond search is based on reprojection. If not, diamond search is based on homography. Homography is faster than reprojection, but less accurate.

◆ getBoard()

CV_WRAP const CharucoBoard& cv::aruco::CharucoDetector::getBoard ( ) const

◆ getCharucoParameters()

CV_WRAP const CharucoParameters& cv::aruco::CharucoDetector::getCharucoParameters ( ) const

◆ getDetectorParameters()

CV_WRAP const DetectorParameters& cv::aruco::CharucoDetector::getDetectorParameters ( ) const

◆ getRefineParameters()

CV_WRAP const RefineParameters& cv::aruco::CharucoDetector::getRefineParameters ( ) const

◆ setBoard()

CV_WRAP void cv::aruco::CharucoDetector::setBoard ( const CharucoBoard board)

◆ setCharucoParameters()

CV_WRAP void cv::aruco::CharucoDetector::setCharucoParameters ( CharucoParameters charucoParameters)

◆ setDetectorParameters()

CV_WRAP void cv::aruco::CharucoDetector::setDetectorParameters ( const DetectorParameters detectorParameters)

◆ setRefineParameters()

CV_WRAP void cv::aruco::CharucoDetector::setRefineParameters ( const RefineParameters refineParameters)

Member Data Documentation

◆ charucoDetectorImpl

Ptr<CharucoDetectorImpl> cv::aruco::CharucoDetector::charucoDetectorImpl
protected

The documentation for this class was generated from the following file: