OpenCV for Unity  2.6.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.9.0/index.html ) for the details of the argument of the method.
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OpenCVForUnity.ObjdetectModule.CharucoBoard Class Reference

ChArUco board is a planar chessboard where the markers are placed inside the white squares of a chessboard. More...

Inheritance diagram for OpenCVForUnity.ObjdetectModule.CharucoBoard:
OpenCVForUnity.ObjdetectModule.Board OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableObject

Public Member Functions

 CharucoBoard (Size size, float squareLength, float markerLength, Dictionary dictionary, Mat ids)
 CharucoBoard constructor. More...
 
 CharucoBoard (Size size, float squareLength, float markerLength, Dictionary dictionary)
 CharucoBoard constructor. More...
 
void setLegacyPattern (bool legacyPattern)
 set legacy chessboard pattern. More...
 
bool getLegacyPattern ()
 
Size getChessboardSize ()
 
float getSquareLength ()
 
float getMarkerLength ()
 
MatOfPoint3f getChessboardCorners ()
 get CharucoBoard::chessboardCorners More...
 
bool checkCharucoCornersCollinear (Mat charucoIds)
 check whether the ChArUco markers are collinear More...
 
- Public Member Functions inherited from OpenCVForUnity.ObjdetectModule.Board
IntPtr getNativeObjAddr ()
 
 Board (List< Mat > objPoints, Dictionary dictionary, Mat ids)
 Common Board constructor. More...
 
Dictionary getDictionary ()
 return the Dictionary of markers employed for this board More...
 
List< MatOfPoint3fgetObjPoints ()
 return array of object points of all the marker corners in the board. More...
 
MatOfInt getIds ()
 vector of the identifiers of the markers in the board (should be the same size as objPoints) More...
 
Point3 getRightBottomCorner ()
 get coordinate of the bottom right corner of the board, is set when calling the function create() More...
 
void matchImagePoints (List< Mat > detectedCorners, Mat detectedIds, Mat objPoints, Mat imgPoints)
 Given a board configuration and a set of detected markers, returns the corresponding image points and object points, can be used in solvePnP() More...
 
void generateImage (Size outSize, Mat img, int marginSize, int borderBits)
 Draw a planar board. More...
 
void generateImage (Size outSize, Mat img, int marginSize)
 Draw a planar board. More...
 
void generateImage (Size outSize, Mat img)
 Draw a planar board. More...
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static new CharucoBoard __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.ObjdetectModule.Board
static Board __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

ChArUco board is a planar chessboard where the markers are placed inside the white squares of a chessboard.

The benefits of ChArUco boards is that they provide both, ArUco markers versatility and chessboard corner precision, which is important for calibration and pose estimation. The board image can be drawn using generateImage() method.

Constructor & Destructor Documentation

◆ CharucoBoard() [1/2]

OpenCVForUnity.ObjdetectModule.CharucoBoard.CharucoBoard ( Size  size,
float  squareLength,
float  markerLength,
Dictionary  dictionary,
Mat  ids 
)

CharucoBoard constructor.

Parameters
sizenumber of chessboard squares in x and y directions
squareLengthsquareLength chessboard square side length (normally in meters)
markerLengthmarker side length (same unit than squareLength)
dictionarydictionary of markers indicating the type of markers
idsarray of id used markers The first markers in the dictionary are used to fill the white chessboard squares.

◆ CharucoBoard() [2/2]

OpenCVForUnity.ObjdetectModule.CharucoBoard.CharucoBoard ( Size  size,
float  squareLength,
float  markerLength,
Dictionary  dictionary 
)

CharucoBoard constructor.

Parameters
sizenumber of chessboard squares in x and y directions
squareLengthsquareLength chessboard square side length (normally in meters)
markerLengthmarker side length (same unit than squareLength)
dictionarydictionary of markers indicating the type of markers
idsarray of id used markers The first markers in the dictionary are used to fill the white chessboard squares.

Member Function Documentation

◆ __fromPtr__()

static new CharucoBoard OpenCVForUnity.ObjdetectModule.CharucoBoard.__fromPtr__ ( IntPtr  addr)
static

◆ checkCharucoCornersCollinear()

bool OpenCVForUnity.ObjdetectModule.CharucoBoard.checkCharucoCornersCollinear ( Mat  charucoIds)

check whether the ChArUco markers are collinear

Parameters
charucoIdslist of identifiers for each corner in charucoCorners per frame.
Returns
bool value, 1 (true) if detected corners form a line, 0 (false) if they do not. solvePnP, calibration functions will fail if the corners are collinear (true).

The number of ids in charucoIDs should be <= the number of chessboard corners in the board. This functions checks whether the charuco corners are on a straight line (returns true, if so), or not (false). Axis parallel, as well as diagonal and other straight lines detected. Degenerate cases: for number of charucoIDs <= 2,the function returns true.

◆ Dispose()

override void OpenCVForUnity.ObjdetectModule.CharucoBoard.Dispose ( bool  disposing)
protectedvirtual

◆ getChessboardCorners()

MatOfPoint3f OpenCVForUnity.ObjdetectModule.CharucoBoard.getChessboardCorners ( )

get CharucoBoard::chessboardCorners

◆ getChessboardSize()

Size OpenCVForUnity.ObjdetectModule.CharucoBoard.getChessboardSize ( )

◆ getLegacyPattern()

bool OpenCVForUnity.ObjdetectModule.CharucoBoard.getLegacyPattern ( )

◆ getMarkerLength()

float OpenCVForUnity.ObjdetectModule.CharucoBoard.getMarkerLength ( )

◆ getSquareLength()

float OpenCVForUnity.ObjdetectModule.CharucoBoard.getSquareLength ( )

◆ setLegacyPattern()

void OpenCVForUnity.ObjdetectModule.CharucoBoard.setLegacyPattern ( bool  legacyPattern)

set legacy chessboard pattern.

Legacy setting creates chessboard patterns starting with a white box in the upper left corner if there is an even row count of chessboard boxes, otherwise it starts with a black box. This setting ensures compatibility to patterns created with OpenCV versions prior OpenCV 4.6.0. See https://github.com/opencv/opencv/issues/23152.

Default value: false.


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