Table of Contents

Class Board

Namespace
OpenCvSharp.Aruco
Assembly
OpenCvSharp.dll

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.
public class Board : CvObject, IDisposable
Inheritance
Board
Implements
Derived
Inherited Members

Constructors

Board(IEnumerable<Point3f[]>, Dictionary, IEnumerable<int>)

Common Board constructor

public Board(IEnumerable<Point3f[]> objPoints, Dictionary dictionary, IEnumerable<int> ids)

Parameters

objPoints IEnumerable<Point3f[]>

array of object points of all the marker corners in the board. Each marker must have exactly 4 corners.

dictionary Dictionary

the dictionary of markers employed for this board

ids IEnumerable<int>

vector of the identifiers of the markers in the board

Methods

GenerateImage(Size, OutputArray, int, int)

Draw a planar board. This function return the image of the board, ready to be printed.

public void GenerateImage(Size outSize, OutputArray img, int marginSize = 0, int borderBits = 1)

Parameters

outSize Size

size of the output image in pixels.

img OutputArray

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 int

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

borderBits int

width of the marker borders.

GetDictionary()

return the Dictionary of markers employed for this board

public Dictionary GetDictionary()

Returns

Dictionary

GetIds()

vector of the identifiers of the markers in the board (should be the same size as objPoints)

public int[] GetIds()

Returns

int[]

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.
public Point3f[][] GetObjPoints()

Returns

Point3f[][]

GetRightBottomCorner()

get coordinate of the bottom right corner of the board, is set when calling the function create()

public Point3f GetRightBottomCorner()

Returns

Point3f

MatchImagePoints(Point2f[][], InputArray, OutputArray, OutputArray)

Given a board configuration and a set of detected markers, returns the corresponding image points and object points, can be used in solvePnP()

public void MatchImagePoints(Point2f[][] detectedCorners, InputArray detectedIds, OutputArray objPoints, OutputArray imgPoints)

Parameters

detectedCorners Point2f[][]

List of detected marker corners of the board.

detectedIds InputArray

List of identifiers for each marker.

objPoints OutputArray

Vector of marker points in the board coordinate space.

imgPoints OutputArray

Vector of marker points in the image coordinate space.