CharucoBoard

Objective-C

@interface CharucoBoard : Board

Swift

class CharucoBoard : Board

ChArUco board Specific class for ChArUco boards. A ChArUco board is a planar board 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. This class also allows the easy creation and drawing of ChArUco boards.

Member of Aruco

Methods

  • Create a CharucoBoard object

    This functions creates a CharucoBoard object given the number of squares in each direction and the size of the markers and chessboard squares.

    Declaration

    Objective-C

    + (nonnull CharucoBoard *)create:(int)squaresX
                            squaresY:(int)squaresY
                        squareLength:(float)squareLength
                        markerLength:(float)markerLength
                          dictionary:(nonnull Dictionary *)dictionary;

    Swift

    class func create(squaresX: Int32, squaresY: Int32, squareLength: Float, markerLength: Float, dictionary: Dictionary) -> CharucoBoard

    Parameters

    squaresX

    number of chessboard squares in X direction

    squaresY

    number of chessboard squares in Y direction

    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.

    Return Value

    the output CharucoBoard object

  • Declaration

    Objective-C

    - (Size2i*)getChessboardSize NS_SWIFT_NAME(getChessboardSize());

    Swift

    func getChessboardSize() -> Size2i
  • Declaration

    Objective-C

    - (float)getMarkerLength NS_SWIFT_NAME(getMarkerLength());

    Swift

    func getMarkerLength() -> Float
  • Declaration

    Objective-C

    - (float)getSquareLength NS_SWIFT_NAME(getSquareLength());

    Swift

    func getSquareLength() -> Float
  • Draw a ChArUco board

    This function return the image of the ChArUco board, ready to be printed.

    Declaration

    Objective-C

    - (void)draw:(nonnull Size2i *)outSize
               img:(nonnull Mat *)img
        marginSize:(int)marginSize
        borderBits:(int)borderBits;

    Swift

    func draw(outSize: Size2i, img: Mat, marginSize: Int32, borderBits: Int32)

    Parameters

    outSize

    size of the output image in pixels.

    img

    output image with the board. The size of this image will be outSize and the board will be on the center, keeping the board proportions.

    marginSize

    minimum margins (in pixels) of the board in the output image

    borderBits

    width of the marker borders.

  • Draw a ChArUco board

    This function return the image of the ChArUco board, ready to be printed.

    Declaration

    Objective-C

    - (void)draw:(nonnull Size2i *)outSize
               img:(nonnull Mat *)img
        marginSize:(int)marginSize;

    Swift

    func draw(outSize: Size2i, img: Mat, marginSize: Int32)

    Parameters

    outSize

    size of the output image in pixels.

    img

    output image with the board. The size of this image will be outSize and the board will be on the center, keeping the board proportions.

    marginSize

    minimum margins (in pixels) of the board in the output image

  • Draw a ChArUco board

    This function return the image of the ChArUco board, ready to be printed.

    Declaration

    Objective-C

    - (void)draw:(nonnull Size2i *)outSize img:(nonnull Mat *)img;

    Swift

    func draw(outSize: Size2i, img: Mat)

    Parameters

    outSize

    size of the output image in pixels.

    img

    output image with the board. The size of this image will be outSize and the board will be on the center, keeping the board proportions.

  • Declaration

    Objective-C

    @property (readonly) Point3f* chessboardCorners

    Swift

    var chessboardCorners: Point3f { get }
  • Declaration

    Objective-C

    @property (readonly) IntVector* nearestMarkerIdx

    Swift

    var nearestMarkerIdx: IntVector { get }
  • Declaration

    Objective-C

    @property (readonly) IntVector* nearestMarkerCorners

    Swift

    var nearestMarkerCorners: IntVector { get }