类 CharucoBoard
- java.lang.Object
-
- org.opencv.objdetect.Board
-
- org.opencv.objdetect.CharucoBoard
-
public class CharucoBoard extends Board
ChArUco 板是一种平面棋盘,标记位于棋盘的白色方格内。 ChArUco 板的优点在于它们既提供了 ArUco 标记的通用性,又提供了棋盘角点的精度,这对于校准和姿势估计非常重要。可以使用 generateImage() 方法绘制棋盘图像。
-
-
构造函数摘要
构造函数 修饰符 构造函数 描述 保护CharucoBoard(long addr)CharucoBoard(Size size, float squareLength, float markerLength, Dictionary dictionary)CharucoBoard 构造函数CharucoBoard(Size size, float squareLength, float markerLength, Dictionary dictionary, Mat ids)CharucoBoard 构造函数
-
方法摘要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 描述 静态 CharucoBoard__fromPtr__(long addr)booleancheckCharucoCornersCollinear(Mat charucoIds)检查 ChArUco 标记是否共线protected voidfinalize()MatOfPoint3fgetChessboardCorners()获取 CharucoBoard::chessboardCornersSizegetChessboardSize()booleangetLegacyPattern()floatgetMarkerLength()floatgetSquareLength()voidsetLegacyPattern(boolean legacyPattern)设置旧版棋盘模式。-
从类继承的方法 org.opencv.objdetect.Board
generateImage, generateImage, generateImage, getDictionary, getIds, getNativeObjAddr, getObjPoints, getRightBottomCorner, matchImagePoints
-
-
-
-
构造函数详细信息
-
CharucoBoard
protected CharucoBoard(long addr)
-
CharucoBoard
public CharucoBoard(Size size, float squareLength, float markerLength, Dictionary dictionary, Mat ids)
CharucoBoard 构造函数- 参数
size- 棋盘在 x 和 y 方向上的方格数squareLength- squareLength 棋盘方格边长(通常以米为单位)markerLength- 标记边长(与 squareLength 相同的单位)dictionary- 标记字典,指示标记的类型ids- 使用的标记的 ID 数组。字典中的第一个标记用于填充白色棋盘方格。
-
CharucoBoard
public CharucoBoard(Size size, float squareLength, float markerLength, Dictionary dictionary)
CharucoBoard 构造函数- 参数
size- 棋盘在 x 和 y 方向上的方格数squareLength- squareLength 棋盘方格边长(通常以米为单位)markerLength- 标记边长(与 squareLength 相同的单位)dictionary- 标记字典,指示标记的类型。字典中的第一个标记用于填充白色棋盘方格。
-
-
方法详细信息
-
__fromPtr__
public static CharucoBoard __fromPtr__(long addr)
-
setLegacyPattern
public void setLegacyPattern(boolean legacyPattern)
设置旧版棋盘模式。如果棋盘方格的偶数行数,则旧版设置会创建从左上角白色方框开始的棋盘图案,否则从黑色方框开始。此设置确保与使用 OpenCV 4.6.0 之前的 OpenCV 版本创建的图案兼容。请参阅 https://github.com/opencv/opencv/issues/23152。默认值:false。- 参数
legacyPattern- 自动生成
-
getLegacyPattern
public boolean getLegacyPattern()
-
getChessboardSize
public Size getChessboardSize()
-
getSquareLength
public float getSquareLength()
-
getMarkerLength
public float getMarkerLength()
-
getChessboardCorners
public MatOfPoint3f getChessboardCorners()
获取 CharucoBoard::chessboardCorners- 返回
- 自动生成
-
checkCharucoCornersCollinear
public boolean checkCharucoCornersCollinear(Mat charucoIds)
检查 ChArUco 标记是否共线- 参数
charucoIds- 每个 charucoCorners 帧中每个角点的标识符列表。- 返回
- bool 值,如果检测到的角点形成一条线则为 1(真),如果不是则为 0(假)。如果角点共线(真),solvePnP、校准函数将失败。 charucoIDs 中的 ID 数应 <= 棋盘中的棋盘角点数。此函数检查 charuco 角点是否在一条直线上(如果是,则返回 true),否则返回 false。检测到轴平行线,以及对角线和其他直线。退化情况:对于 charucoIDs 的数量 <= 2,该函数返回 true。
-
-