Skip to content

aruco_CharucoBoard

objdetectclassOpenCV 5.0.0
import { aruco_CharucoBoard } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSaruco_CharucoBoard
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits aruco_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.

Constructors and members

static new

CharucoBoard constructor

new(size: Size, squareLength: number, markerLength: number, dictionary: aruco_Dictionary, ids: Mat): aruco_CharucoBoard;
2 available overloads
new(size: Size, squareLength: number, markerLength: number, dictionary: aruco_Dictionary): aruco_CharucoBoard;
new(size: Size, squareLength: number, markerLength: number, dictionary: aruco_Dictionary, ids: Mat): aruco_CharucoBoard;
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.

Returns

The aruco_CharucoBoard result.

clone

Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.

clone(): this;
Returns

The this result.

setLegacyPattern

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.

setLegacyPattern(legacyPattern: boolean): void;
legacyPattern

legacy pattern argument (boolean).

getLegacyPattern

Read the legacy pattern.

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.

getLegacyPattern(): boolean;
Returns

The boolean result.

getChessboardSize

Return the chessboard size configured on this aruco_CharucoBoard object.

getChessboardSize(): Size;
Returns

The Size result.

getSquareLength

Return the square length configured on this aruco_CharucoBoard object.

getSquareLength(): number;
Returns

The number result.

getMarkerLength

Return the marker length configured on this aruco_CharucoBoard object.

getMarkerLength(): number;
Returns

The number result.

getChessboardCorners

get CharucoBoard::chessboardCorners

getChessboardCorners(): Point3fVector;
Returns

The Point3fVector result. Release returned native handles with using or delete(), including handles nested in results.

checkCharucoCornersCollinear

check whether the ChArUco markers are collinear

checkCharucoCornersCollinear(charucoIds: Mat): boolean;
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.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.