dictionary.hpp
Go to the documentation of this file.
1 /*
2 By downloading, copying, installing or using the software you agree to this
3 license. If you do not agree to this license, do not download, install,
4 copy or use the software.
5 
6  License Agreement
7  For Open Source Computer Vision Library
8  (3-clause BSD License)
9 
10 Copyright (C) 2013, OpenCV Foundation, all rights reserved.
11 Third party copyrights are property of their respective owners.
12 
13 Redistribution and use in source and binary forms, with or without modification,
14 are permitted provided that the following conditions are met:
15 
16  * Redistributions of source code must retain the above copyright notice,
17  this list of conditions and the following disclaimer.
18 
19  * Redistributions in binary form must reproduce the above copyright notice,
20  this list of conditions and the following disclaimer in the documentation
21  and/or other materials provided with the distribution.
22 
23  * Neither the names of the copyright holders nor the names of the contributors
24  may be used to endorse or promote products derived from this software
25  without specific prior written permission.
26 
27 This software is provided by the copyright holders and contributors "as is" and
28 any express or implied warranties, including, but not limited to, the implied
29 warranties of merchantability and fitness for a particular purpose are
30 disclaimed. In no event shall copyright holders or contributors be liable for
31 any direct, indirect, incidental, special, exemplary, or consequential damages
32 (including, but not limited to, procurement of substitute goods or services;
33 loss of use, data, or profits; or business interruption) however caused
34 and on any theory of liability, whether in contract, strict liability,
35 or tort (including negligence or otherwise) arising in any way out of
36 the use of this software, even if advised of the possibility of such damage.
37 */
38 
39 #ifndef __OPENCV_DICTIONARY_HPP__
40 #define __OPENCV_DICTIONARY_HPP__
41 
42 #include <opencv2/core.hpp>
43 
44 namespace cv {
45 namespace aruco {
46 
49 
50 
61 class CV_EXPORTS_W Dictionary {
62 
63  public:
64  CV_PROP_RW Mat bytesList; // marker code information
65  CV_PROP_RW int markerSize; // number of bits per dimension
66  CV_PROP_RW int maxCorrectionBits; // maximum number of bits that can be corrected
67 
68 
71  Dictionary(const Mat &_bytesList = Mat(), int _markerSize = 0, int _maxcorr = 0);
72 
73 
81  Dictionary(const Ptr<Dictionary> &_dictionary);
82 
83 
87  CV_WRAP_AS(create) static Ptr<Dictionary> create(int nMarkers, int markerSize, int randomSeed=0);
88 
89 
93  CV_WRAP_AS(create_from) static Ptr<Dictionary> create(int nMarkers, int markerSize,
94  const Ptr<Dictionary> &baseDictionary, int randomSeed=0);
95 
99  CV_WRAP static Ptr<Dictionary> get(int dict);
100 
105  bool identify(const Mat &onlyBits, int &idx, int &rotation, double maxCorrectionRate) const;
106 
111  int getDistanceToId(InputArray bits, int id, bool allRotations = true) const;
112 
113 
117  CV_WRAP void drawMarker(int id, int sidePixels, OutputArray _img, int borderBits = 1) const;
118 
119 
123  CV_WRAP static Mat getByteListFromBits(const Mat &bits);
124 
125 
129  CV_WRAP static Mat getBitsFromByteList(const Mat &byteList, int markerSize);
130 };
131 
132 
133 
134 
163 };
164 
165 
169 CV_EXPORTS Ptr<Dictionary> getPredefinedDictionary(PREDEFINED_DICTIONARY_NAME name);
170 
171 
175 CV_EXPORTS_W Ptr<Dictionary> getPredefinedDictionary(int dict);
176 
177 
181 CV_EXPORTS_AS(custom_dictionary) Ptr<Dictionary> generateCustomDictionary(
182  int nMarkers,
183  int markerSize,
184  int randomSeed=0);
185 
186 
200 CV_EXPORTS_AS(custom_dictionary_from) Ptr<Dictionary> generateCustomDictionary(
201  int nMarkers,
202  int markerSize,
203  const Ptr<Dictionary> &baseDictionary,
204  int randomSeed=0);
205 
206 
207 
209 }
210 }
211 
212 #endif
CV_EXPORTS_AS(calibrateCameraCharucoExtended) double calibrateCameraCharuco(InputArrayOfArrays charucoCorners
Calibrate a camera using Charuco corners.
6x6 bits, minimum hamming distance between any two codes = 11, 587 codes
Definition: dictionary.hpp:162
CV_PROP_RW int maxCorrectionBits
Definition: dictionary.hpp:66
CV_PROP_RW int markerSize
Definition: dictionary.hpp:65
5x5 bits, minimum hamming distance between any two codes = 9, 35 codes
Definition: dictionary.hpp:160
4x4 bits, minimum hamming distance between any two codes = 5, 30 codes
Definition: dictionary.hpp:159
CV_PROP_RW Mat bytesList
Definition: dictionary.hpp:64
Definition: charuco.hpp:47
CV_EXPORTS Ptr< Dictionary > getPredefinedDictionary(PREDEFINED_DICTIONARY_NAME name)
Returns one of the predefined dictionaries defined in PREDEFINED_DICTIONARY_NAME. ...
Definition: dictionary.cpp:301
PREDEFINED_DICTIONARY_NAME
Predefined markers dictionaries/sets Each dictionary indicates the number of bits and the number of m...
Definition: dictionary.hpp:141
Ptr< Dictionary > generateCustomDictionary(int nMarkers, int markerSize, const Ptr< Dictionary > &baseDictionary, int randomSeed)
Definition: dictionary.cpp:395
int int randomSeed
Definition: dictionary.hpp:184
CV_EXPORTS_W void drawMarker(const Ptr< Dictionary > &dictionary, int id, int sidePixels, OutputArray img, int borderBits=1)
Draw a canonical marker image.
Definition: aruco.cpp:1758
6x6 bits, minimum hamming distance between any two codes = 10, 2320 codes
Definition: dictionary.hpp:161
int const Ptr< Dictionary > & baseDictionary
Definition: dictionary.hpp:202
Dictionary/Set of markers. It contains the inner codification.
Definition: dictionary.hpp:61


aruco_pose
Author(s): Oleg Kalachev
autogenerated on Mon Feb 28 2022 22:08:24