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

ChArUco 板是一个平面棋盘,其中标记放置在棋盘的白色方块内。 更多...

#include <opencv2/objdetect/aruco_board.hpp>

cv::aruco::CharucoBoard 的协作图

公有成员函数

 CharucoBoard ()
 
 CharucoBoard (const Size &size, float squareLength, float markerLength, const Dictionary &dictionary, InputArray ids=noArray())
 CharucoBoard 构造函数。
 
bool checkCharucoCornersCollinear (InputArray charucoIds) const
 检查 ChArUco 标记是否共线
 
std::vector< Point3fgetChessboardCorners () const
 获取 CharucoBoard::chessboardCorners
 
Size getChessboardSize () const
 
bool getLegacyPattern () const
 
float getMarkerLength () const
 
std::vector< std::vector< int > > getNearestMarkerCorners () const
 获取 CharucoBoard::nearestMarkerCorners,对于每个 ChArUco 角点,获取每个标记最近的标记角点 ID
 
std::vector< std::vector< int > > getNearestMarkerIdx () const
 获取 CharucoBoard::nearestMarkerIdx,对于每个 ChArUco 角点,获取 ids 数组中最接近的标记索引
 
float getSquareLength () const
 
void setLegacyPattern (bool legacyPattern)
 设置旧版棋盘模式。
 
- 继承自 cv::aruco::Board 的公有成员函数
 Board ()
 
 Board (InputArrayOfArrays objPoints, const Dictionary &dictionary, InputArray ids)
 通用 Board 构造函数。
 
void generateImage (Size outSize, OutputArray img, int marginSize=0, int borderBits=1) const
 绘制一个平面板。
 
const DictionarygetDictionary () const
 返回此板使用的标记字典
 
const std::vector< int > & getIds () const
 板中标记的标识符向量(应与 objPoints 大小相同)
 
const std::vector< std::vector< Point3f > > & getObjPoints () const
 返回板中所有标记角点的对象点数组。
 
const Point3fgetRightBottomCorner () const
 获取板右下角的坐标,在调用 create() 函数时设置
 
void matchImagePoints (InputArrayOfArrays detectedCorners, InputArray detectedIds, OutputArray objPoints, OutputArray imgPoints) const
 给定一个板配置和一组检测到的标记,返回相应的图像点和对象点,可用于 solvePnP()
 

额外继承的成员

- 继承自 cv::aruco::Board 的保护成员函数
 Board (const Ptr< Impl > &impl)
 
- 继承自 cv::aruco::Board 的保护属性
Ptr< Impl > impl
 

详细描述

ChArUco 板是一个平面棋盘,其中标记放置在棋盘的白色方块内。

ChArUco 板的优点在于它们同时提供了 ArUco 标记的多功能性和棋盘角点的精确性,这对于校准和姿态估计非常重要。可以使用 generateImage() 方法绘制板图像。

构造函数 & 析构函数文档

◆ CharucoBoard() [1/2]

cv::aruco::CharucoBoard::CharucoBoard ( const Size & size,
float squareLength,
float markerLength,
const Dictionary & dictionary,
InputArray ids = noArray() )
Python
cv.aruco.CharucoBoard(size, squareLength, markerLength, dictionary[, ids]) -> <aruco_CharucoBoard 对象>

CharucoBoard 构造函数。

参数
sizex 和 y 方向的棋盘格数量
squareLengthsquareLength 棋盘格边长(通常以米为单位)
markerLength标记边长(与 squareLength 单位相同)
dictionary指示标记类型的标记字典
ids已用标记 ID 数组。字典中的第一个标记用于填充白色棋盘格。
此函数的调用图如下

◆ CharucoBoard() [2/2]

cv::aruco::CharucoBoard::CharucoBoard ( )
Python
cv.aruco.CharucoBoard(size, squareLength, markerLength, dictionary[, ids]) -> <aruco_CharucoBoard 对象>

成员函数文档

◆ checkCharucoCornersCollinear()

bool cv::aruco::CharucoBoard::checkCharucoCornersCollinear ( InputArray charucoIds) const
Python
cv.aruco.CharucoBoard.checkCharucoCornersCollinear(charucoIds) -> retval

检查 ChArUco 标记是否共线

参数
charucoIds每帧 charucoCorners 中每个角点的标识符列表。
返回
布尔值,如果检测到的角点形成一条线,则为 1 (true);否则为 0 (false)。如果角点共线 (true),solvePnP 和校准函数将失败。

charucoIDs 中的 ID 数量应小于等于板中棋盘格角点的数量。此函数检查 ChArUco 角点是否在一条直线上(如果是则返回 true,否则返回 false)。检测到与轴平行、对角线和其他直线。退化情况:如果 charucoIDs 数量小于等于 2,函数返回 true。

◆ getChessboardCorners()

std::vector< Point3f > cv::aruco::CharucoBoard::getChessboardCorners ( ) const
Python
cv.aruco.CharucoBoard.getChessboardCorners() -> retval

获取 CharucoBoard::chessboardCorners

◆ getChessboardSize()

Size cv::aruco::CharucoBoard::getChessboardSize ( ) const
Python
cv.aruco.CharucoBoard.getChessboardSize() -> retval

◆ getLegacyPattern()

bool cv::aruco::CharucoBoard::getLegacyPattern ( ) const
Python
cv.aruco.CharucoBoard.getLegacyPattern() -> retval

◆ getMarkerLength()

float cv::aruco::CharucoBoard::getMarkerLength ( ) const
Python
cv.aruco.CharucoBoard.getMarkerLength() -> retval

◆ getNearestMarkerCorners()

std::vector< std::vector< int > > cv::aruco::CharucoBoard::getNearestMarkerCorners ( ) const

获取 CharucoBoard::nearestMarkerCorners,对于每个 ChArUco 角点,获取每个标记最近的标记角点 ID

◆ getNearestMarkerIdx()

std::vector< std::vector< int > > cv::aruco::CharucoBoard::getNearestMarkerIdx ( ) const

获取 CharucoBoard::nearestMarkerIdx,对于每个 ChArUco 角点,获取 ids 数组中最接近的标记索引

◆ getSquareLength()

float cv::aruco::CharucoBoard::getSquareLength ( ) const
Python
cv.aruco.CharucoBoard.getSquareLength() -> retval

◆ setLegacyPattern()

void cv::aruco::CharucoBoard::setLegacyPattern ( bool legacyPattern)
Python
cv.aruco.CharucoBoard.setLegacyPattern(legacyPattern) ->

设置旧版棋盘模式。

旧版设置在棋盘格行数为偶数时,从左上角的一个白色方框开始创建棋盘图案;否则从一个黑色方框开始。此设置确保与 OpenCV 4.6.0 之前的版本创建的图案兼容。请参阅 https://github.com/opencv/opencv/issues/23152

默认值:false。


此类的文档由以下文件生成