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
imageInputOutputArrayinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
charucoCornersPoint2f[]vector of detected charuco corners.
charucoIdsIEnumerable<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
imageInputOutputArrayinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
charucoCornersPoint2f[]vector of detected charuco corners.
charucoIdsIEnumerable<int>list of identifiers for each corner in charucoCorners.
cornerColorScalarcolor 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
imageInputOutputArrayinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
diamondCornersPoint2f[][]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.
diamondIdsIEnumerable<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
imageInputOutputArrayinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
diamondCornersPoint2f[][]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.
diamondIdsIEnumerable<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.
borderColorScalarcolor 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
imageInputOutputArrayinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
cornersPoint2f[][]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.
idsIEnumerable<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
imageInputOutputArrayinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
cornersPoint2f[][]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.
idsIEnumerable<int>vector of identifiers for markers in markersCorners. Optional, if not provided, ids are not painted.
borderColorScalarcolor 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
nMarkersintnumber of markers in the dictionary
markerSizeintnumber of bits per dimension of each markers
baseDictionaryDictionaryInclude the markers in this dictionary at the beginning (optional)
randomSeedinta user supplied seed for theRNG()
Returns
GetPredefinedDictionary(PredefinedDictionaryType)
Returns one of the predefined dictionaries defined in PREDEFINED_DICTIONARY_NAME
public static Dictionary GetPredefinedDictionary(PredefinedDictionaryType name)
Parameters
Returns
GetPredefinedDictionary(int)
Returns one of the predefined dictionaries referenced by DICT_*.
public static Dictionary GetPredefinedDictionary(int dict)
Parameters
dictint
Returns
ReadDictionary(string)
Reads a new dictionary from FileNode.
public static Dictionary ReadDictionary(string dictionaryFile)
Parameters
dictionaryFilestringThe 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"