类 ArucoDetector
- java.lang.Object
-
- org.opencv.core.Algorithm
-
- org.opencv.objdetect.ArucoDetector
-
public class ArucoDetector extends Algorithm
ArucoDetector 类的主要功能是使用 detectMarkers() 方法检测图像中的标记。在图像中检测到一些标记后,您可以使用 refineDetectedMarkers() 方法尝试从该字典中查找未检测到的标记。参见:DetectorParameters, RefineParameters
-
-
构造函数摘要
构造函数 修饰符 构造函数 描述 ArucoDetector()基本的 ArucoDetector 构造函数保护ArucoDetector(long addr)ArucoDetector(Dictionary dictionary)基本的 ArucoDetector 构造函数ArucoDetector(Dictionary dictionary, DetectorParameters detectorParams)基本的 ArucoDetector 构造函数ArucoDetector(Dictionary dictionary, DetectorParameters detectorParams, RefineParameters refineParams)基本的 ArucoDetector 构造函数
-
方法摘要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 描述 static ArucoDetector__fromPtr__(long addr)voiddetectMarkers(Mat image, java.util.List<Mat> corners, Mat ids)基本标记检测voiddetectMarkers(Mat image, java.util.List<Mat> corners, Mat ids, java.util.List<Mat> rejectedImgPoints)基本标记检测voiddetectMarkersMultiDict(Mat image, java.util.List<Mat> corners, Mat ids)基本标记检测voiddetectMarkersMultiDict(Mat image, java.util.List<Mat> corners, Mat ids, java.util.List<Mat> rejectedImgPoints)基本标记检测voiddetectMarkersMultiDict(Mat image, java.util.List<Mat> corners, Mat ids, java.util.List<Mat> rejectedImgPoints, Mat dictIndices)基本标记检测protected voidfinalize()DetectorParametersgetDetectorParameters()DictionarygetDictionary()返回用于标记检测的内部列表中的第一个字典。RefineParametersgetRefineParameters()voidrefineDetectedMarkers(Mat image, Board board, java.util.List<Mat> detectedCorners, Mat detectedIds, java.util.List<Mat> rejectedCorners)根据已检测到的标记和棋盘布局,完善未检测到的标记voidrefineDetectedMarkers(Mat image, Board board, java.util.List<Mat> detectedCorners, Mat detectedIds, java.util.List<Mat> rejectedCorners, Mat cameraMatrix)根据已检测到的标记和棋盘布局,完善未检测到的标记voidrefineDetectedMarkers(Mat image, Board board, java.util.List<Mat> detectedCorners, Mat detectedIds, java.util.List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs)根据已检测到的标记和棋盘布局,完善未检测到的标记voidrefineDetectedMarkers(Mat image, Board board, java.util.List<Mat> detectedCorners, Mat detectedIds, java.util.List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs, Mat recoveredIdxs)根据已检测到的标记和棋盘布局,完善未检测到的标记voidsetDetectorParameters(DetectorParameters detectorParameters)voidsetDictionary(Dictionary dictionary)设置并替换内部列表中用于标记检测的第一个字典。voidsetRefineParameters(RefineParameters refineParameters)-
从类 org.opencv.core.Algorithm 继承的方法
clear, empty, getDefaultName, getNativeObjAddr, save
-
-
-
-
构造函数详细信息
-
ArucoDetector
protected ArucoDetector(long addr)
-
ArucoDetector
public ArucoDetector(Dictionary dictionary, DetectorParameters detectorParams, RefineParameters refineParams)
基本的 ArucoDetector 构造函数- 参数
dictionary- 指示要搜索的标记类型detectorParams- 标记检测参数refineParams- 标记细化检测参数
-
ArucoDetector
public ArucoDetector(Dictionary dictionary, DetectorParameters detectorParams)
基本的 ArucoDetector 构造函数- 参数
dictionary- 指示要搜索的标记类型detectorParams- 标记检测参数
-
ArucoDetector
public ArucoDetector(Dictionary dictionary)
基本的 ArucoDetector 构造函数- 参数
dictionary- 指示要搜索的标记类型
-
ArucoDetector
public ArucoDetector()
基本的 ArucoDetector 构造函数
-
-
方法详细信息
-
__fromPtr__
public static ArucoDetector __fromPtr__(long addr)
-
detectMarkers
public void detectMarkers(Mat image, java.util.List<Mat> corners, Mat ids, java.util.List<Mat> rejectedImgPoints)
基本标记检测- 参数
image- 输入图像corners- 检测到的标记角点的向量。对于每个标记,提供其四个角点(例如 std::vector<std::vector<cv::Point2f> >)。对于 N 个检测到的标记,此数组的维度为 Nx4。角点的顺序是顺时针。ids- 检测到的标记的标识符向量。标识符类型为 int(例如 std::vector<int>)。对于 N 个检测到的标记,ids 的大小也为 N。标识符与 imgPoints 数组中的标记具有相同的顺序。rejectedImgPoints- 包含其内部代码编码不正确的那些方形的 imgPoints。用于调试目的。在输入图像中执行标记检测。仅搜索第一个指定字典中包含的标记。对于每个检测到的标记,它返回其角点在图像中的 2D 位置及其对应的标识符。请注意,此函数不执行姿态估计。注意:此函数不纠正或考虑镜头畸变。如果相机参数已知,建议使用相应的相机模型对输入图像进行去畸变。参见:undistort, estimatePoseSingleMarkers, estimatePoseBoard
-
detectMarkers
public void detectMarkers(Mat image, java.util.List<Mat> corners, Mat ids)
基本标记检测- 参数
image- 输入图像corners- 检测到的标记角点的向量。对于每个标记,提供其四个角点(例如 std::vector<std::vector<cv::Point2f> >)。对于 N 个检测到的标记,此数组的维度为 Nx4。角点的顺序是顺时针。ids- 检测到的标记的标识符向量。标识符类型为 int(例如 std::vector<int>)。对于 N 个检测到的标记,ids 的大小也为 N。标识符与 imgPoints 数组中的标记具有相同的顺序。编码正确。用于调试目的。在输入图像中执行标记检测。仅搜索第一个指定字典中包含的标记。对于每个检测到的标记,它返回其角点在图像中的 2D 位置及其对应的标识符。请注意,此函数不执行姿态估计。注意:此函数不纠正或考虑镜头畸变。如果相机参数已知,建议使用相应的相机模型对输入图像进行去畸变。参见:undistort, estimatePoseSingleMarkers, estimatePoseBoard
-
refineDetectedMarkers
public void refineDetectedMarkers(Mat image, Board board, java.util.List<Mat> detectedCorners, Mat detectedIds, java.util.List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs, Mat recoveredIdxs)
根据已检测到的标记和棋盘布局,完善未检测到的标记- 参数
image- 输入图像board- 棋盘中标记的布局。detectedCorners- 已检测到的标记角点向量。detectedIds- 已检测到的标记标识符向量。rejectedCorners- 标记检测过程中被拒绝的候选点向量。cameraMatrix- 可选输入 3x3 浮点相机矩阵 \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)distCoeffs- 可选的畸变系数向量 \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\),包含 4、5、8 或 12 个元素recoveredIdxs- 可选数组,返回原始 rejectedCorners 数组中恢复的候选点的索引。此函数尝试查找在基本 detecMarkers 函数中未检测到的标记。首先,根据当前检测到的标记和棋盘布局,函数插值缺失标记的位置。然后,它根据 minRepDistance 和 errorCorrectionRate 参数尝试在重投影标记和被拒绝的候选点之间找到对应关系。如果提供了相机参数和畸变系数,则使用 projectPoint 函数重投影缺失的标记。否则,使用全局单应性插值缺失的标记投影,并且棋盘中所有标记的角点必须具有相同的 Z 坐标。注意:此函数假定棋盘只包含一个字典中的标记,因此只使用第一个配置的字典。它必须与棋盘的字典匹配才能正常工作。
-
refineDetectedMarkers
public void refineDetectedMarkers(Mat image, Board board, java.util.List<Mat> detectedCorners, Mat detectedIds, java.util.List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs)
根据已检测到的标记和棋盘布局,完善未检测到的标记- 参数
image- 输入图像board- 棋盘中标记的布局。detectedCorners- 已检测到的标记角点向量。detectedIds- 已检测到的标记标识符向量。rejectedCorners- 标记检测过程中被拒绝的候选点向量。cameraMatrix- 可选输入 3x3 浮点相机矩阵 \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)distCoeffs- 可选的畸变系数向量 \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\),包含 4、5、8 或 12 个元素。此函数尝试查找在基本 detecMarkers 函数中未检测到的标记。首先,根据当前检测到的标记和棋盘布局,函数插值缺失标记的位置。然后,它根据 minRepDistance 和 errorCorrectionRate 参数尝试在重投影标记和被拒绝的候选点之间找到对应关系。如果提供了相机参数和畸变系数,则使用 projectPoint 函数重投影缺失的标记。否则,使用全局单应性插值缺失的标记投影,并且棋盘中所有标记的角点必须具有相同的 Z 坐标。注意:此函数假定棋盘只包含一个字典中的标记,因此只使用第一个配置的字典。它必须与棋盘的字典匹配才能正常工作。
-
refineDetectedMarkers
public void refineDetectedMarkers(Mat image, Board board, java.util.List<Mat> detectedCorners, Mat detectedIds, java.util.List<Mat> rejectedCorners, Mat cameraMatrix)
根据已检测到的标记和棋盘布局,完善未检测到的标记- 参数
image- 输入图像board- 棋盘中标记的布局。detectedCorners- 已检测到的标记角点向量。detectedIds- 已检测到的标记标识符向量。rejectedCorners- 标记检测过程中被拒绝的候选点向量。cameraMatrix- 可选输入 3x3 浮点相机矩阵 \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\),包含 4、5、8 或 12 个元素。此函数尝试查找在基本 detecMarkers 函数中未检测到的标记。首先,根据当前检测到的标记和棋盘布局,函数插值缺失标记的位置。然后,它根据 minRepDistance 和 errorCorrectionRate 参数尝试在重投影标记和被拒绝的候选点之间找到对应关系。如果提供了相机参数和畸变系数,则使用 projectPoint 函数重投影缺失的标记。否则,使用全局单应性插值缺失的标记投影,并且棋盘中所有标记的角点必须具有相同的 Z 坐标。注意:此函数假定棋盘只包含一个字典中的标记,因此只使用第一个配置的字典。它必须与棋盘的字典匹配才能正常工作。
-
refineDetectedMarkers
public void refineDetectedMarkers(Mat image, Board board, java.util.List<Mat> detectedCorners, Mat detectedIds, java.util.List<Mat> rejectedCorners)
根据已检测到的标记和棋盘布局,完善未检测到的标记- 参数
image- 输入图像board- 棋盘中标记的布局。detectedCorners- 已检测到的标记角点向量。detectedIds- 已检测到的标记标识符向量。rejectedCorners- 标记检测过程中被拒绝的候选点向量。\(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\),包含 4、5、8 或 12 个元素。此函数尝试查找在基本 detecMarkers 函数中未检测到的标记。首先,根据当前检测到的标记和棋盘布局,函数插值缺失标记的位置。然后,它根据 minRepDistance 和 errorCorrectionRate 参数尝试在重投影标记和被拒绝的候选点之间找到对应关系。如果提供了相机参数和畸变系数,则使用 projectPoint 函数重投影缺失的标记。否则,使用全局单应性插值缺失的标记投影,并且棋盘中所有标记的角点必须具有相同的 Z 坐标。注意:此函数假定棋盘只包含一个字典中的标记,因此只使用第一个配置的字典。它必须与棋盘的字典匹配才能正常工作。
-
detectMarkersMultiDict
public void detectMarkersMultiDict(Mat image, java.util.List<Mat> corners, Mat ids, java.util.List<Mat> rejectedImgPoints, Mat dictIndices)
基本标记检测- 参数
image- 输入图像corners- 检测到的标记角点的向量。对于每个标记,提供其四个角点(例如 std::vector<std::vector<cv::Point2f> >)。对于 N 个检测到的标记,此数组的维度为 Nx4。角点的顺序是顺时针。ids- 检测到的标记的标识符向量。标识符类型为 int(例如 std::vector<int>)。对于 N 个检测到的标记,ids 的大小也为 N。标识符与 imgPoints 数组中的标记具有相同的顺序。rejectedImgPoints- 包含其内部代码编码不正确的那些方形的 imgPoints。用于调试目的。dictIndices- 每个检测到的标记的字典索引向量。使用 getDictionaries() 获取相应字典列表。在输入图像中执行标记检测。仅搜索特定字典中包含的标记。对于每个检测到的标记,它返回其角点在图像中的 2D 位置及其对应的标识符。请注意,此函数不执行姿态估计。注意:此函数不纠正或考虑镜头畸变。如果相机参数已知,建议使用相应的相机模型对输入图像进行去畸变。参见:undistort, estimatePoseSingleMarkers, estimatePoseBoard
-
detectMarkersMultiDict
public void detectMarkersMultiDict(Mat image, java.util.List<Mat> corners, Mat ids, java.util.List<Mat> rejectedImgPoints)
基本标记检测- 参数
image- 输入图像corners- 检测到的标记角点的向量。对于每个标记,提供其四个角点(例如 std::vector<std::vector<cv::Point2f> >)。对于 N 个检测到的标记,此数组的维度为 Nx4。角点的顺序是顺时针。ids- 检测到的标记的标识符向量。标识符类型为 int(例如 std::vector<int>)。对于 N 个检测到的标记,ids 的大小也为 N。标识符与 imgPoints 数组中的标记具有相同的顺序。rejectedImgPoints- 包含其内部代码编码不正确的那些方形的 imgPoints。用于调试目的。相应的字典列表。在输入图像中执行标记检测。仅搜索特定字典中包含的标记。对于每个检测到的标记,它返回其角点在图像中的 2D 位置及其对应的标识符。请注意,此函数不执行姿态估计。注意:此函数不纠正或考虑镜头畸变。如果相机参数已知,建议使用相应的相机模型对输入图像进行去畸变。参见:undistort, estimatePoseSingleMarkers, estimatePoseBoard
-
detectMarkersMultiDict
public void detectMarkersMultiDict(Mat image, java.util.List<Mat> corners, Mat ids)
基本标记检测- 参数
image- 输入图像corners- 检测到的标记角点的向量。对于每个标记,提供其四个角点(例如 std::vector<std::vector<cv::Point2f> >)。对于 N 个检测到的标记,此数组的维度为 Nx4。角点的顺序是顺时针。ids- 检测到的标记的标识符向量。标识符类型为 int(例如 std::vector<int>)。对于 N 个检测到的标记,ids 的大小也为 N。标识符与 imgPoints 数组中的标记具有相同的顺序。编码正确。用于调试目的。相应的字典列表。在输入图像中执行标记检测。仅搜索特定字典中包含的标记。对于每个检测到的标记,它返回其角点在图像中的 2D 位置及其对应的标识符。请注意,此函数不执行姿态估计。注意:此函数不纠正或考虑镜头畸变。如果相机参数已知,建议使用相应的相机模型对输入图像进行去畸变。参见:undistort, estimatePoseSingleMarkers, estimatePoseBoard
-
getDictionary
public Dictionary getDictionary()
返回用于标记检测的内部列表中的第一个字典。- 返回
- 来自已配置 ArucoDetector 的第一个字典。
-
setDictionary
public void setDictionary(Dictionary dictionary)
设置并替换内部列表中用于标记检测的第一个字典。- 参数
dictionary- 将替换内部列表中第一个字典的新字典。
-
getDetectorParameters
public DetectorParameters getDetectorParameters()
-
setDetectorParameters
public void setDetectorParameters(DetectorParameters detectorParameters)
-
getRefineParameters
public RefineParameters getRefineParameters()
-
setRefineParameters
public void setRefineParameters(RefineParameters refineParameters)
-
-