Package org.opencv.objdetect
Class CharucoBoard
- java.lang.Object
- 
- org.opencv.objdetect.Board
- 
- org.opencv.objdetect.CharucoBoard
 
 
- 
 public class CharucoBoard extends Board 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 SummaryConstructors Modifier Constructor Description protectedCharucoBoard(long addr)CharucoBoard(Size size, float squareLength, float markerLength, Dictionary dictionary)CharucoBoard constructorCharucoBoard(Size size, float squareLength, float markerLength, Dictionary dictionary, Mat ids)CharucoBoard constructor
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CharucoBoard__fromPtr__(long addr)booleancheckCharucoCornersCollinear(Mat charucoIds)check whether the ChArUco markers are collinearprotected voidfinalize()MatOfPoint3fgetChessboardCorners()get CharucoBoard::chessboardCornersSizegetChessboardSize()booleangetLegacyPattern()floatgetMarkerLength()floatgetSquareLength()voidsetLegacyPattern(boolean legacyPattern)set legacy chessboard pattern.- 
Methods inherited from class org.opencv.objdetect.BoardgenerateImage, generateImage, generateImage, getDictionary, getIds, getNativeObjAddr, getObjPoints, getRightBottomCorner, matchImagePoints
 
- 
 
- 
- 
- 
Constructor Detail- 
CharucoBoardprotected CharucoBoard(long addr) 
 - 
CharucoBoardpublic CharucoBoard(Size size, float squareLength, float markerLength, Dictionary dictionary, Mat ids) CharucoBoard constructor- Parameters:
- size- number of chessboard squares in x and y directions
- squareLength- squareLength chessboard square side length (normally in meters)
- markerLength- marker side length (same unit than squareLength)
- dictionary- dictionary of markers indicating the type of markers
- ids- array of id used markers The first markers in the dictionary are used to fill the white chessboard squares.
 
 - 
CharucoBoardpublic CharucoBoard(Size size, float squareLength, float markerLength, Dictionary dictionary) CharucoBoard constructor- Parameters:
- size- number of chessboard squares in x and y directions
- squareLength- squareLength chessboard square side length (normally in meters)
- markerLength- marker side length (same unit than squareLength)
- dictionary- dictionary of markers indicating the type of markers The first markers in the dictionary are used to fill the white chessboard squares.
 
 
- 
 - 
Method Detail- 
__fromPtr__public static CharucoBoard __fromPtr__(long addr) 
 - 
setLegacyPatternpublic void setLegacyPattern(boolean 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.- Parameters:
- legacyPattern- automatically generated
 
 - 
getLegacyPatternpublic boolean getLegacyPattern() 
 - 
getChessboardSizepublic Size getChessboardSize() 
 - 
getSquareLengthpublic float getSquareLength() 
 - 
getMarkerLengthpublic float getMarkerLength() 
 - 
getChessboardCornerspublic MatOfPoint3f getChessboardCorners() get CharucoBoard::chessboardCorners- Returns:
- automatically generated
 
 - 
checkCharucoCornersCollinearpublic boolean checkCharucoCornersCollinear(Mat charucoIds) check whether the ChArUco markers are collinear- Parameters:
- charucoIds- list 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.
 
 
- 
 
-