OpenCV 4.12.0
开源计算机视觉
加载中...
搜索中...
无匹配项

Dictionary 是一组大小相同的唯一 ArUco 标记。 更多...

#include <opencv2/objdetect/aruco_dictionary.hpp>

cv::aruco::Dictionary 的协作图

公共成员函数

 Dictionary ()
 
 Dictionary (const Mat &bytesList, int _markerSize, int maxcorr=0)
 基本的 ArUco 字典构造函数。
 
void generateImageMarker (int id, int sidePixels, OutputArray _img, int borderBits=1) const
 生成规范标记图像。
 
int getDistanceToId (InputArray bits, int id, bool allRotations=true) const
 返回输入位与特定 ID 的 Hamming 距离。
 
bool identify (const Mat &onlyBits, int &idx, int &rotation, double maxCorrectionRate) const
 给定一个位矩阵。返回标记是否被识别。
 
bool readDictionary (const cv::FileNode &fn)
 FileNode 读取新字典。
 
void writeDictionary (FileStorage &fs, const String &name=String())
 将字典写入 FileStorage,格式与 readDictionary() 相同。
 

静态公共成员函数

static Mat getBitsFromByteList (const Mat &byteList, int markerSize)
 将字节列表转换为位矩阵。
 
static Mat getByteListFromBits (const Mat &bits)
 将位矩阵转换为包含 4 种标记旋转的字节列表。
 

公共属性

Mat bytesList
 标记代码信息。有关更多详细信息,请参阅类描述
 
int markerSize
 每个维度的位数
 
int maxCorrectionBits
 可以校正的最大位数
 

详细描述

Dictionary 是一组大小相同的唯一 ArUco 标记。

bytesList 存储为 2 维 Mat,具有 4 个通道(使用 CV_8UC4 类型),并包含标记码字,其中

  • bytesList.rows 是字典大小
  • 每个标记使用 nbytes = ceil(markerSize*markerSize/8.) 字节编码
  • 每行包含标记的所有 4 种旋转,因此其长度为 4*nbytes
  • bytesList[i] 行中的字节顺序://无旋转字节/旋转 1 字节/旋转 2 字节/旋转 3 字节// 因此 bytesList.ptr(i)[k*nbytes + j] 是第 i 个标记的第 j 个字节,在其第 k 次旋转中。
    注意
    Python 绑定生成 `bytesList` 形状为 dictionary_size x nbytes x 4 的矩阵,但其索引方式应与 C++ 版本相同。Python 示例:对于第 i 个标记的第 j 个字节,在其第 k 次旋转中:aruco_dict.bytesList[id].ravel()[k*nbytes + j]

构造函数 & 析构函数文档

◆ Dictionary() [1/2]

cv::aruco::Dictionary::Dictionary ( )
Python
cv.aruco.Dictionary() -> <aruco_Dictionary 对象>
cv.aruco.Dictionary(bytesList, _markerSize[, maxcorr]) -> <aruco_Dictionary 对象>

◆ Dictionary() [2/2]

cv::aruco::Dictionary::Dictionary ( const Mat & bytesList,
int _markerSize,
int maxcorr = 0 )
Python
cv.aruco.Dictionary() -> <aruco_Dictionary 对象>
cv.aruco.Dictionary(bytesList, _markerSize[, maxcorr]) -> <aruco_Dictionary 对象>

基本的 ArUco 字典构造函数。

参数
bytesList字典中所有 ArUco 标记的位,请参阅类描述中的内存布局
_markerSizeArUco 标记的单位大小
maxcorr可以校正的最大位数

成员函数文档

◆ generateImageMarker()

void cv::aruco::Dictionary::generateImageMarker ( int id,
int sidePixels,
OutputArray _img,
int borderBits = 1 ) const
Python
cv.aruco.Dictionary.generateImageMarker(id, sidePixels[, _img[, borderBits]]) -> _img

生成规范标记图像。

◆ getBitsFromByteList()

static Mat cv::aruco::Dictionary::getBitsFromByteList ( const Mat & byteList,
int markerSize )
static
Python
cv.aruco.Dictionary.getBitsFromByteList(byteList, markerSize) -> retval
cv.aruco.Dictionary_getBitsFromByteList(byteList, markerSize) -> retval

将字节列表转换为位矩阵。

◆ getByteListFromBits()

static Mat cv::aruco::Dictionary::getByteListFromBits ( const Mat & bits)
static
Python
cv.aruco.Dictionary.getByteListFromBits(bits) -> retval
cv.aruco.Dictionary_getByteListFromBits(bits) -> retval

将位矩阵转换为包含 4 种标记旋转的字节列表。

◆ getDistanceToId()

int cv::aruco::Dictionary::getDistanceToId ( InputArray bits,
int id,
bool allRotations = true ) const
Python
cv.aruco.Dictionary.getDistanceToId(bits, id[, allRotations]) -> retval

返回输入位与特定 ID 的 Hamming 距离。

如果设置了 allRotations 标志,则考虑四种可能的标记旋转。

◆ identify()

bool cv::aruco::Dictionary::identify ( const Mat & onlyBits,
int & idx,
int & rotation,
double maxCorrectionRate ) const
Python
cv.aruco.Dictionary.identify(onlyBits, maxCorrectionRate) -> retval, idx, rotation

给定一个位矩阵。返回标记是否被识别。

返回字典中标记 ID 的引用(如果有)及其旋转。

◆ readDictionary()

bool cv::aruco::Dictionary::readDictionary ( const cv::FileNode & fn)
Python
cv.aruco.Dictionary.readDictionary(fn) -> retval

FileNode 读取新字典。

YAML 格式的 Dictionary 示例
nmarkers: 35
markersize: 6
maxCorrectionBits: 5
marker_0: "101011111011111001001001101100000000"
...
marker_34: "011111010000111011111110110101100101"

◆ writeDictionary()

void cv::aruco::Dictionary::writeDictionary ( FileStorage & fs,
const String & name = String() )
Python
cv.aruco.Dictionary.writeDictionary(fs[, name]) ->

将字典写入 FileStorage,格式与 readDictionary() 相同。

成员数据文档

◆ bytesList

Mat cv::aruco::Dictionary::bytesList

标记代码信息。有关更多详细信息,请参阅类描述

◆ markerSize

int cv::aruco::Dictionary::markerSize

每个维度的位数

◆ maxCorrectionBits

int cv::aruco::Dictionary::maxCorrectionBits

可以校正的最大位数


此类的文档是从以下文件生成的