Table of Contents

Class ArucoDetector

Namespace
OpenCvSharp.Aruco
Assembly
OpenCvSharp.dll

The main functionality of ArucoDetector class is detection of markers in an image with detectMarkers() method.

public class ArucoDetector : CvObject, IDisposable
Inheritance
ArucoDetector
Implements
Inherited Members

Constructors

ArucoDetector(Dictionary)

Creates ArucoDetector with default parameters.

public ArucoDetector(Dictionary dictionary)

Parameters

dictionary Dictionary

ArucoDetector(Dictionary, DetectorParameters, RefineParameters)

Creates ArucoDetector.

public ArucoDetector(Dictionary dictionary, DetectorParameters detectorParams, RefineParameters refineParams)

Parameters

dictionary Dictionary
detectorParams DetectorParameters
refineParams RefineParameters

ArucoDetector(IEnumerable<Dictionary>, DetectorParameters, RefineParameters)

Creates ArucoDetector for multiple dictionaries.

public ArucoDetector(IEnumerable<Dictionary> dictionaries, DetectorParameters detectorParams, RefineParameters refineParams)

Parameters

dictionaries IEnumerable<Dictionary>

indicates the types of markers that will be searched. Empty dictionaries will throw an error.

detectorParams DetectorParameters

marker detection parameters

refineParams RefineParameters

marker refine detection parameters

Methods

DetectMarkers(InputArray, out Point2f[][], out int[], out Point2f[][])

Basic marker detection.

public void DetectMarkers(InputArray image, out Point2f[][] corners, out int[] ids, out Point2f[][] rejectedImgPoints)

Parameters

image InputArray
corners Point2f[][]
ids int[]
rejectedImgPoints Point2f[][]

DetectMarkersMultiDict(InputArray, out Point2f[][], out int[], out Point2f[][], out int[])

Basic marker detection using all configured dictionaries.

public void DetectMarkersMultiDict(InputArray image, out Point2f[][] corners, out int[] ids, out Point2f[][] rejectedImgPoints, out int[] dictIndices)

Parameters

image InputArray

input image

corners Point2f[][]

vector of detected marker corners. For each marker, its four corners are provided.

ids int[]

vector of identifiers of the detected markers.

rejectedImgPoints Point2f[][]

contains the imgPoints of those squares whose inner code has not a correct codification.

dictIndices int[]

vector of dictionary indices for each detected marker. Use GetDictionaries() to get the list of corresponding dictionaries.

DetectMarkersWithConfidence(InputArray, out Point2f[][], out int[], out float[], out Point2f[][])

Marker detection with confidence computation.

public void DetectMarkersWithConfidence(InputArray image, out Point2f[][] corners, out int[] ids, out float[] markersConfidence, out Point2f[][] rejectedImgPoints)

Parameters

image InputArray

input image

corners Point2f[][]

vector of detected marker corners. For each marker, its four corners are provided.

ids int[]

vector of identifiers of the detected markers.

markersConfidence float[]

contains the normalized confidence [0;1] of the markers' detection.

rejectedImgPoints Point2f[][]

contains the imgPoints of those squares whose inner code has not a correct codification.

GetDetectorParameters()

Gets the detector parameters currently used for marker detection.

public DetectorParameters GetDetectorParameters()

Returns

DetectorParameters

GetDictionaries()

Returns all dictionaries currently used for marker detection.

public Dictionary[] GetDictionaries()

Returns

Dictionary[]

GetDictionary()

Returns first dictionary from internal list used for marker detection.

public Dictionary GetDictionary()

Returns

Dictionary

GetRefineParameters()

Gets the marker refine detection parameters currently used.

public RefineParameters GetRefineParameters()

Returns

RefineParameters

Read(FileNode)

Reads algorithm parameters from a file storage.

public void Read(FileNode fn)

Parameters

fn FileNode

RefineDetectedMarkers(InputArray, Board, Point2f[][], int[], Point2f[][], out Point2f[][], out int[], out Point2f[][], out int[], InputArray, InputArray)

Refine not detected markers based on the already detected and the board layout. This function tries to find markers that were not detected in the basic DetectMarkers function.

public void RefineDetectedMarkers(InputArray image, Board board, Point2f[][] detectedCorners, int[] detectedIds, Point2f[][] rejectedCorners, out Point2f[][] newDetectedCorners, out int[] newDetectedIds, out Point2f[][] newRejectedCorners, out int[] recoveredIdxs, InputArray cameraMatrix = default, InputArray distCoeffs = default)

Parameters

image InputArray

input image

board Board

layout of markers in the board.

detectedCorners Point2f[][]

vector of already detected marker corners.

detectedIds int[]

vector of already detected marker identifiers.

rejectedCorners Point2f[][]

vector of rejected candidates during the marker detection process.

newDetectedCorners Point2f[][]

updated vector of detected marker corners, including any recovered markers.

newDetectedIds int[]

updated vector of detected marker identifiers, including any recovered markers.

newRejectedCorners Point2f[][]

updated vector of rejected candidates, with recovered markers removed.

recoveredIdxs int[]

the indexes of the recovered candidates in the original rejectedCorners array.

cameraMatrix InputArray

optional input 3x3 floating-point camera matrix

distCoeffs InputArray

optional vector of distortion coefficients

SetDetectorParameters(DetectorParameters)

Sets the detector parameters to be used for marker detection.

public void SetDetectorParameters(DetectorParameters detectorParameters)

Parameters

detectorParameters DetectorParameters

SetDictionaries(IEnumerable<Dictionary>)

Sets the entire collection of dictionaries to be used for marker detection, replacing any existing dictionaries. Setting an empty collection of dictionaries will throw an error.

public void SetDictionaries(IEnumerable<Dictionary> dictionaries)

Parameters

dictionaries IEnumerable<Dictionary>

SetDictionary(Dictionary)

Sets and replaces the first dictionary in internal list to be used for marker detection.

public void SetDictionary(Dictionary dictionary)

Parameters

dictionary Dictionary

SetRefineParameters(RefineParameters)

Sets the marker refine detection parameters to be used.

public void SetRefineParameters(RefineParameters refineParameters)

Parameters

refineParameters RefineParameters

Write(FileStorage)

Stores algorithm parameters in a file storage.

public void Write(FileStorage fs)

Parameters

fs FileStorage