123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- #ifndef __OPENCV_DICTIONARY_HPP__
- #define __OPENCV_DICTIONARY_HPP__
- #include <opencv2/core.hpp>
- namespace cv {
- namespace aruco {
- class CV_EXPORTS Dictionary {
- public:
- Mat bytesList;
- int markerSize;
- int maxCorrectionBits;
-
- Dictionary(const Mat &_bytesList = Mat(), int _markerSize = 0, int _maxcorr = 0);
-
- bool identify(const Mat &onlyBits, int &idx, int &rotation, double maxCorrectionRate) const;
-
- int getDistanceToId(InputArray bits, int id, bool allRotations = true) const;
-
- void drawMarker(int id, int sidePixels, OutputArray _img, int borderBits = 1) const;
-
- static Mat getByteListFromBits(const Mat &bits);
-
- static Mat getBitsFromByteList(const Mat &byteList, int markerSize);
- };
- enum PREDEFINED_DICTIONARY_NAME {
- DICT_4X4_50 = 0,
- DICT_4X4_100,
- DICT_4X4_250,
- DICT_4X4_1000,
- DICT_5X5_50,
- DICT_5X5_100,
- DICT_5X5_250,
- DICT_5X5_1000,
- DICT_6X6_50,
- DICT_6X6_100,
- DICT_6X6_250,
- DICT_6X6_1000,
- DICT_7X7_50,
- DICT_7X7_100,
- DICT_7X7_250,
- DICT_7X7_1000,
- DICT_ARUCO_ORIGINAL
- };
- CV_EXPORTS const Dictionary &getPredefinedDictionary(PREDEFINED_DICTIONARY_NAME name);
- CV_EXPORTS Dictionary generateCustomDictionary(int nMarkers, int markerSize,
- const Dictionary &baseDictionary = Dictionary());
- }
- }
- #endif
|