aruco_Board
import { aruco_Board } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods.
Board of ArUco markers
A board is a set of markers in the 3D space with a common coordinate system. The common form of a board of marker is a planar (2D) board, however any 3D layout can be used. A Board object is composed by:
- The object points of the marker corners, i.e. their coordinates respect to the board system.
- The dictionary which indicates the type of markers of the board
- The identifier of all the markers in the board.
Constructors and members
static new
Common Board constructor
new(objPoints: MatVector, dictionary: aruco_Dictionary, ids: Mat): aruco_Board;objPointsarray of object points of all the marker corners in the board
dictionarythe dictionary of markers employed for this board
idsvector of the identifiers of the markers in the board
The aruco_Board 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;The this result.
getObjPoints
return array of object points of all the marker corners in the board.
Each marker include its 4 corners in this order:
- objPoints[i][0] - left-top point of i-th marker
- objPoints[i][1] - right-top point of i-th marker
- objPoints[i][2] - right-bottom point of i-th marker
- objPoints[i][3] - left-bottom point of i-th marker
Markers are placed in a certain order - row by row, left to right in every row. For M markers, the size is Mx4.
getObjPoints(): std__vector_cv__Point3fVector;The std__vector_cv__Point3fVector result. Release returned native handles with using or delete(), including handles nested in results.
getIds
vector of the identifiers of the markers in the board (should be the same size as objPoints)
getIds(): IntVector;vector of the identifiers of the markers Release returned native handles with using or delete(), including handles nested in results.
getRightBottomCorner
get coordinate of the bottom right corner of the board, is set when calling the function create()
getRightBottomCorner(): Point3f;The Point3f result.
matchImagePoints
Given a board configuration and a set of detected markers, returns the corresponding image points and object points, can be used in solvePnP()
See: solvePnP
matchImagePoints(detectedCorners: MatVector, detectedIds: Mat, objPoints: Mat, imgPoints: Mat): void;detectedCornersList of detected marker corners of the board. For cv::Board and cv::GridBoard the method expects std::vector<std::vector<Point2f>> or std::vector<Mat> with Aruco marker corners. For cv::CharucoBoard the method expects std::vector<Point2f> or Mat with ChAruco corners (chess board corners matched with Aruco markers).
detectedIdsList of identifiers for each marker or charuco corner. For any Board class the method expects std::vector<int> or Mat.
objPointsOutput destination, filled by the native operation. Vector of marker points in the board coordinate space. For any Board class the method expects std::vectorcv::Point3f objectPoints or cv::Mat
imgPointsOutput destination, filled by the native operation. Vector of marker points in the image coordinate space. For any Board class the method expects std::vectorcv::Point2f objectPoints or cv::Mat
generateImage
Draw a planar board
generateImage(outSize: Size, img: Mat, marginSize: number, borderBits: number): void;3 available overloads
generateImage(outSize: Size, img: Mat): void;generateImage(outSize: Size, img: Mat, marginSize: number): void;generateImage(outSize: Size, img: Mat, marginSize: number, borderBits: number): void;outSizesize of the output image in pixels.
imgOutput destination, filled by the native operation. 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.
marginSizeminimum margins (in pixels) of the board in the output image
borderBitswidth of the marker borders.
This function return the image of the board, ready to be printed.
getDictionary
return the Dictionary of markers employed for this board
getDictionary(): aruco_Dictionary;The aruco_Dictionary result.
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.