OpenCV 4.5.3(日本語機械翻訳)
dictionary.hpp
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
142 DICT_4X4_50 = 0,
143 DICT_4X4_100,
144 DICT_4X4_250,
145 DICT_4X4_1000,
146 DICT_5X5_50,
147 DICT_5X5_100,
148 DICT_5X5_250,
149 DICT_5X5_1000,
150 DICT_6X6_50,
151 DICT_6X6_100,
152 DICT_6X6_250,
153 DICT_6X6_1000,
154 DICT_7X7_50,
155 DICT_7X7_100,
156 DICT_7X7_250,
157 DICT_7X7_1000,
158 DICT_ARUCO_ORIGINAL,
163 };
164
165
170
171
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
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:295
n-dimensional dense array class
Definition: mat.hpp:802
Dictionary/Set of markers. It contains the inner codification
Definition: dictionary.hpp:61
CV_WRAP_AS(create_from) static Ptr< Dictionary > create(int nMarkers
bool identify(const Mat &onlyBits, int &idx, int &rotation, double maxCorrectionRate) const
Given a matrix of bits. Returns whether if marker is identified or not. It returns by reference the c...
Dictionary(const Ptr< Dictionary > &_dictionary)
int getDistanceToId(InputArray bits, int id, bool allRotations=true) const
Returns the distance of the input bits to the specific id. If allRotations is true,...
CV_WRAP_AS(create) static Ptr< Dictionary > create(int nMarkers
PREDEFINED_DICTIONARY_NAME
Predefined markers dictionaries/sets Each dictionary indicates the number of bits and the number of m...
Definition: dictionary.hpp:141
CV_EXPORTS_W Ptr< Dictionary > getPredefinedDictionary(int dict)
Returns one of the predefined dictionaries referenced by DICT_*.
@ DICT_APRILTAG_25h9
5x5 bits, minimum hamming distance between any two codes = 9, 35 codes
Definition: dictionary.hpp:160
@ DICT_APRILTAG_16h5
4x4 bits, minimum hamming distance between any two codes = 5, 30 codes
Definition: dictionary.hpp:159
@ DICT_APRILTAG_36h11
6x6 bits, minimum hamming distance between any two codes = 11, 587 codes
Definition: dictionary.hpp:162
@ DICT_APRILTAG_36h10
6x6 bits, minimum hamming distance between any two codes = 10, 2320 codes
Definition: dictionary.hpp:161
CV_EXPORTS_AS(calibrateCameraExtended) double calibrateCamera(InputArrayOfArrays objectPoints
Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.
CV_EXPORTS_W void drawMarker(InputOutputArray img, Point position, const Scalar &color, int markerType=MARKER_CROSS, int markerSize=20, int thickness=1, int line_type=8)
Draws a marker on a predefined position in an image.
cv
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74