Table of Contents

Class Cv2.Aruco

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

aruco module

public static class Cv2.Aruco
Inheritance
Cv2.Aruco
Inherited Members

Methods

DrawDetectedCornersCharuco(InputOutputArray, Point2f[], IEnumerable<int>?)

Draw a set of detected ChArUco Diamond markers.

public static void DrawDetectedCornersCharuco(InputOutputArray image, Point2f[] charucoCorners, IEnumerable<int>? charucoIds = null)

Parameters

image InputOutputArray

input/output image. It must have 1 or 3 channels. The number of channels is not altered.

charucoCorners Point2f[]

vector of detected charuco corners.

charucoIds IEnumerable<int>

list of identifiers for each corner in charucoCorners.

DrawDetectedCornersCharuco(InputOutputArray, Point2f[], IEnumerable<int>?, Scalar)

Draw a set of detected ChArUco Diamond markers.

public static void DrawDetectedCornersCharuco(InputOutputArray image, Point2f[] charucoCorners, IEnumerable<int>? charucoIds, Scalar cornerColor)

Parameters

image InputOutputArray

input/output image. It must have 1 or 3 channels. The number of channels is not altered.

charucoCorners Point2f[]

vector of detected charuco corners.

charucoIds IEnumerable<int>

list of identifiers for each corner in charucoCorners.

cornerColor Scalar

color of the square surrounding each corner.

DrawDetectedDiamonds(InputOutputArray, Point2f[][], IEnumerable<Vec4i>?)

Draw a set of detected ChArUco Diamond markers.

public static void DrawDetectedDiamonds(InputOutputArray image, Point2f[][] diamondCorners, IEnumerable<Vec4i>? diamondIds = null)

Parameters

image InputOutputArray

input/output image. It must have 1 or 3 channels. The number of channels is not altered.

diamondCorners Point2f[][]

positions of diamond corners in the same format returned by detectCharucoDiamond(). (e.g std::vector<std::vector<cv::Point2f>>). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.

diamondIds IEnumerable<Vec4i>

vector of identifiers for diamonds in diamondCorners, in the same format returned by detectCharucoDiamond() (e.g. std::vector<Vec4i>). Optional, if not provided, ids are not painted.

DrawDetectedDiamonds(InputOutputArray, Point2f[][], IEnumerable<Vec4i>?, Scalar)

Draw a set of detected ChArUco Diamond markers.

public static void DrawDetectedDiamonds(InputOutputArray image, Point2f[][] diamondCorners, IEnumerable<Vec4i>? diamondIds, Scalar borderColor)

Parameters

image InputOutputArray

input/output image. It must have 1 or 3 channels. The number of channels is not altered.

diamondCorners Point2f[][]

positions of diamond corners in the same format returned by detectCharucoDiamond(). (e.g std::vector<std::vector<cv::Point2f>>). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.

diamondIds IEnumerable<Vec4i>

vector of identifiers for diamonds in diamondCorners, in the same format returned by detectCharucoDiamond() (e.g. std::vector<Vec4i>). Optional, if not provided, ids are not painted.

borderColor Scalar

color of marker borders. Rest of colors (text color and first corner color) are calculated based on this one.

DrawDetectedMarkers(InputOutputArray, Point2f[][], IEnumerable<int>)

Draw detected markers in image

public static void DrawDetectedMarkers(InputOutputArray image, Point2f[][] corners, IEnumerable<int> ids)

Parameters

image InputOutputArray

input/output image. It must have 1 or 3 channels. The number of channels is not altered.

corners Point2f[][]

positions of marker corners on input image. For N detected markers, the dimensions of this array should be Nx4.The order of the corners should be clockwise.

ids IEnumerable<int>

vector of identifiers for markers in markersCorners. Optional, if not provided, ids are not painted.

DrawDetectedMarkers(InputOutputArray, Point2f[][], IEnumerable<int>?, Scalar)

Draw detected markers in image

public static void DrawDetectedMarkers(InputOutputArray image, Point2f[][] corners, IEnumerable<int>? ids, Scalar borderColor)

Parameters

image InputOutputArray

input/output image. It must have 1 or 3 channels. The number of channels is not altered.

corners Point2f[][]

positions of marker corners on input image. For N detected markers, the dimensions of this array should be Nx4.The order of the corners should be clockwise.

ids IEnumerable<int>

vector of identifiers for markers in markersCorners. Optional, if not provided, ids are not painted.

borderColor Scalar

color of marker borders. Rest of colors (text color and first corner color) are calculated based on this one to improve visualization.

ExtendDictionary(int, int, Dictionary?, int)

Extend base dictionary by new nMarkers. This function creates a new dictionary composed by nMarkers markers and each markers composed by markerSize x markerSize bits. If baseDictionary is provided, its markers are directly included and the rest are generated based on them. If the size of baseDictionary is higher than nMarkers, only the first nMarkers in baseDictionary are taken and no new marker is added.

public static Dictionary ExtendDictionary(int nMarkers, int markerSize, Dictionary? baseDictionary = null, int randomSeed = 0)

Parameters

nMarkers int

number of markers in the dictionary

markerSize int

number of bits per dimension of each markers

baseDictionary Dictionary

Include the markers in this dictionary at the beginning (optional)

randomSeed int

a user supplied seed for theRNG()

Returns

Dictionary

GetPredefinedDictionary(PredefinedDictionaryType)

Returns one of the predefined dictionaries defined in PREDEFINED_DICTIONARY_NAME

public static Dictionary GetPredefinedDictionary(PredefinedDictionaryType name)

Parameters

name PredefinedDictionaryType

Returns

Dictionary

GetPredefinedDictionary(int)

Returns one of the predefined dictionaries referenced by DICT_*.

public static Dictionary GetPredefinedDictionary(int dict)

Parameters

dict int

Returns

Dictionary

ReadDictionary(string)

Reads a new dictionary from FileNode.

public static Dictionary ReadDictionary(string dictionaryFile)

Parameters

dictionaryFile string

The path of the dictionary file

Returns

Dictionary

Instance of a Dictionary

Remarks

Dictionary format is YAML see sample below

nmarkers: 35
markersize: 6
maxCorrectionBits: 5
marker_0: "101011111011111001001001101100000000"
...
marker_34: "011111010000111011111110110101100101"