Class Aruco


  • public class Aruco
    extends java.lang.Object
    • Constructor Detail

      • Aruco

        public Aruco()
    • Method Detail

      • detectMarkers

        public static void detectMarkers​(Mat image,
                                         Dictionary dictionary,
                                         java.util.List<Mat> corners,
                                         Mat ids,
                                         DetectorParameters parameters,
                                         java.util.List<Mat> rejectedImgPoints,
                                         Mat cameraMatrix,
                                         Mat distCoeff)
        Basic marker detection
        Parameters:
        image - input image
        dictionary - indicates the type of markers that will be searched
        corners - vector of detected marker corners. For each marker, its four corners are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array is Nx4. The order of the corners is clockwise.
        ids - vector of identifiers of the detected markers. The identifier is of type int (e.g. std::vector<int>). For N detected markers, the size of ids is also N. The identifiers have the same order than the markers in the imgPoints array.
        parameters - marker detection parameters
        rejectedImgPoints - contains the imgPoints of those squares whose inner code has not a correct codification. Useful for debugging purposes.
        cameraMatrix - optional input 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeff - optional vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements Performs marker detection in the input image. Only markers included in the specific dictionary are searched. For each detected marker, it returns the 2D position of its corner in the image and its corresponding identifier. Note that this function does not perform pose estimation. SEE: estimatePoseSingleMarkers, estimatePoseBoard
      • detectMarkers

        public static void detectMarkers​(Mat image,
                                         Dictionary dictionary,
                                         java.util.List<Mat> corners,
                                         Mat ids,
                                         DetectorParameters parameters,
                                         java.util.List<Mat> rejectedImgPoints,
                                         Mat cameraMatrix)
        Basic marker detection
        Parameters:
        image - input image
        dictionary - indicates the type of markers that will be searched
        corners - vector of detected marker corners. For each marker, its four corners are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array is Nx4. The order of the corners is clockwise.
        ids - vector of identifiers of the detected markers. The identifier is of type int (e.g. std::vector<int>). For N detected markers, the size of ids is also N. The identifiers have the same order than the markers in the imgPoints array.
        parameters - marker detection parameters
        rejectedImgPoints - contains the imgPoints of those squares whose inner code has not a correct codification. Useful for debugging purposes.
        cameraMatrix - optional input 3x3 floating-point camera matrix \(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]])\) of 4, 5, 8 or 12 elements Performs marker detection in the input image. Only markers included in the specific dictionary are searched. For each detected marker, it returns the 2D position of its corner in the image and its corresponding identifier. Note that this function does not perform pose estimation. SEE: estimatePoseSingleMarkers, estimatePoseBoard
      • detectMarkers

        public static void detectMarkers​(Mat image,
                                         Dictionary dictionary,
                                         java.util.List<Mat> corners,
                                         Mat ids,
                                         DetectorParameters parameters,
                                         java.util.List<Mat> rejectedImgPoints)
        Basic marker detection
        Parameters:
        image - input image
        dictionary - indicates the type of markers that will be searched
        corners - vector of detected marker corners. For each marker, its four corners are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array is Nx4. The order of the corners is clockwise.
        ids - vector of identifiers of the detected markers. The identifier is of type int (e.g. std::vector<int>). For N detected markers, the size of ids is also N. The identifiers have the same order than the markers in the imgPoints array.
        parameters - marker detection parameters
        rejectedImgPoints - contains the imgPoints of those squares whose inner code has not a correct codification. Useful for debugging purposes. \(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]])\) of 4, 5, 8 or 12 elements Performs marker detection in the input image. Only markers included in the specific dictionary are searched. For each detected marker, it returns the 2D position of its corner in the image and its corresponding identifier. Note that this function does not perform pose estimation. SEE: estimatePoseSingleMarkers, estimatePoseBoard
      • detectMarkers

        public static void detectMarkers​(Mat image,
                                         Dictionary dictionary,
                                         java.util.List<Mat> corners,
                                         Mat ids,
                                         DetectorParameters parameters)
        Basic marker detection
        Parameters:
        image - input image
        dictionary - indicates the type of markers that will be searched
        corners - vector of detected marker corners. For each marker, its four corners are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array is Nx4. The order of the corners is clockwise.
        ids - vector of identifiers of the detected markers. The identifier is of type int (e.g. std::vector<int>). For N detected markers, the size of ids is also N. The identifiers have the same order than the markers in the imgPoints array.
        parameters - marker detection parameters correct codification. Useful for debugging purposes. \(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]])\) of 4, 5, 8 or 12 elements Performs marker detection in the input image. Only markers included in the specific dictionary are searched. For each detected marker, it returns the 2D position of its corner in the image and its corresponding identifier. Note that this function does not perform pose estimation. SEE: estimatePoseSingleMarkers, estimatePoseBoard
      • detectMarkers

        public static void detectMarkers​(Mat image,
                                         Dictionary dictionary,
                                         java.util.List<Mat> corners,
                                         Mat ids)
        Basic marker detection
        Parameters:
        image - input image
        dictionary - indicates the type of markers that will be searched
        corners - vector of detected marker corners. For each marker, its four corners are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array is Nx4. The order of the corners is clockwise.
        ids - vector of identifiers of the detected markers. The identifier is of type int (e.g. std::vector<int>). For N detected markers, the size of ids is also N. The identifiers have the same order than the markers in the imgPoints array. correct codification. Useful for debugging purposes. \(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]])\) of 4, 5, 8 or 12 elements Performs marker detection in the input image. Only markers included in the specific dictionary are searched. For each detected marker, it returns the 2D position of its corner in the image and its corresponding identifier. Note that this function does not perform pose estimation. SEE: estimatePoseSingleMarkers, estimatePoseBoard
      • estimatePoseSingleMarkers

        public static void estimatePoseSingleMarkers​(java.util.List<Mat> corners,
                                                     float markerLength,
                                                     Mat cameraMatrix,
                                                     Mat distCoeffs,
                                                     Mat rvecs,
                                                     Mat tvecs,
                                                     Mat _objPoints)
        Pose estimation for single markers
        Parameters:
        corners - vector of already detected markers corners. For each marker, its four corners are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise. SEE: detectMarkers
        markerLength - the length of the markers' side. The returning translation vectors will be in the same unit. Normally, unit is meters.
        cameraMatrix - input 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        rvecs - array of output rotation vectors (SEE: Rodrigues) (e.g. std::vector<cv::Vec3d>). Each element in rvecs corresponds to the specific marker in imgPoints.
        tvecs - array of output translation vectors (e.g. std::vector<cv::Vec3d>). Each element in tvecs corresponds to the specific marker in imgPoints.
        _objPoints - array of object points of all the marker corners This function receives the detected markers and returns their pose estimation respect to the camera individually. So for each marker, one rotation and translation vector is returned. The returned transformation is the one that transforms points from each marker coordinate system to the camera coordinate system. The marker corrdinate system is centered on the middle of the marker, with the Z axis perpendicular to the marker plane. The coordinates of the four corners of the marker in its own coordinate system are: (-markerLength/2, markerLength/2, 0), (markerLength/2, markerLength/2, 0), (markerLength/2, -markerLength/2, 0), (-markerLength/2, -markerLength/2, 0)
      • estimatePoseSingleMarkers

        public static void estimatePoseSingleMarkers​(java.util.List<Mat> corners,
                                                     float markerLength,
                                                     Mat cameraMatrix,
                                                     Mat distCoeffs,
                                                     Mat rvecs,
                                                     Mat tvecs)
        Pose estimation for single markers
        Parameters:
        corners - vector of already detected markers corners. For each marker, its four corners are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise. SEE: detectMarkers
        markerLength - the length of the markers' side. The returning translation vectors will be in the same unit. Normally, unit is meters.
        cameraMatrix - input 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        rvecs - array of output rotation vectors (SEE: Rodrigues) (e.g. std::vector<cv::Vec3d>). Each element in rvecs corresponds to the specific marker in imgPoints.
        tvecs - array of output translation vectors (e.g. std::vector<cv::Vec3d>). Each element in tvecs corresponds to the specific marker in imgPoints. This function receives the detected markers and returns their pose estimation respect to the camera individually. So for each marker, one rotation and translation vector is returned. The returned transformation is the one that transforms points from each marker coordinate system to the camera coordinate system. The marker corrdinate system is centered on the middle of the marker, with the Z axis perpendicular to the marker plane. The coordinates of the four corners of the marker in its own coordinate system are: (-markerLength/2, markerLength/2, 0), (markerLength/2, markerLength/2, 0), (markerLength/2, -markerLength/2, 0), (-markerLength/2, -markerLength/2, 0)
      • estimatePoseBoard

        public static int estimatePoseBoard​(java.util.List<Mat> corners,
                                            Mat ids,
                                            Board board,
                                            Mat cameraMatrix,
                                            Mat distCoeffs,
                                            Mat rvec,
                                            Mat tvec,
                                            boolean useExtrinsicGuess)
        Pose estimation for a board of markers
        Parameters:
        corners - vector of already detected markers corners. For each marker, its four corners are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.
        ids - list of identifiers for each marker in corners
        board - layout of markers in the board. The layout is composed by the marker identifiers and the positions of each marker corner in the board reference system.
        cameraMatrix - input 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        rvec - Output vector (e.g. cv::Mat) corresponding to the rotation vector of the board (see cv::Rodrigues). Used as initial guess if not empty.
        tvec - Output vector (e.g. cv::Mat) corresponding to the translation vector of the board.
        useExtrinsicGuess - defines whether initial guess for \b rvec and \b tvec will be used or not. Used as initial guess if not empty. This function receives the detected markers and returns the pose of a marker board composed by those markers. A Board of marker has a single world coordinate system which is defined by the board layout. The returned transformation is the one that transforms points from the board coordinate system to the camera coordinate system. Input markers that are not included in the board layout are ignored. The function returns the number of markers from the input employed for the board pose estimation. Note that returning a 0 means the pose has not been estimated.
        Returns:
        automatically generated
      • estimatePoseBoard

        public static int estimatePoseBoard​(java.util.List<Mat> corners,
                                            Mat ids,
                                            Board board,
                                            Mat cameraMatrix,
                                            Mat distCoeffs,
                                            Mat rvec,
                                            Mat tvec)
        Pose estimation for a board of markers
        Parameters:
        corners - vector of already detected markers corners. For each marker, its four corners are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.
        ids - list of identifiers for each marker in corners
        board - layout of markers in the board. The layout is composed by the marker identifiers and the positions of each marker corner in the board reference system.
        cameraMatrix - input 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        rvec - Output vector (e.g. cv::Mat) corresponding to the rotation vector of the board (see cv::Rodrigues). Used as initial guess if not empty.
        tvec - Output vector (e.g. cv::Mat) corresponding to the translation vector of the board. Used as initial guess if not empty. This function receives the detected markers and returns the pose of a marker board composed by those markers. A Board of marker has a single world coordinate system which is defined by the board layout. The returned transformation is the one that transforms points from the board coordinate system to the camera coordinate system. Input markers that are not included in the board layout are ignored. The function returns the number of markers from the input employed for the board pose estimation. Note that returning a 0 means the pose has not been estimated.
        Returns:
        automatically generated
      • refineDetectedMarkers

        public static void refineDetectedMarkers​(Mat image,
                                                 Board board,
                                                 java.util.List<Mat> detectedCorners,
                                                 Mat detectedIds,
                                                 java.util.List<Mat> rejectedCorners,
                                                 Mat cameraMatrix,
                                                 Mat distCoeffs,
                                                 float minRepDistance,
                                                 float errorCorrectionRate,
                                                 boolean checkAllOrders,
                                                 Mat recoveredIdxs,
                                                 DetectorParameters parameters)
        Refind not detected markers based on the already detected and the board layout
        Parameters:
        image - input image
        board - layout of markers in the board.
        detectedCorners - vector of already detected marker corners.
        detectedIds - vector of already detected marker identifiers.
        rejectedCorners - vector of rejected candidates during the marker detection process.
        cameraMatrix - optional input 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - optional vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        minRepDistance - minimum distance between the corners of the rejected candidate and the reprojected marker in order to consider it as a correspondence.
        errorCorrectionRate - rate of allowed erroneous bits respect to the error correction capability of the used dictionary. -1 ignores the error correction step.
        checkAllOrders - Consider the four posible corner orders in the rejectedCorners array. If it set to false, only the provided corner order is considered (default true).
        recoveredIdxs - Optional array to returns the indexes of the recovered candidates in the original rejectedCorners array.
        parameters - marker detection parameters This function tries to find markers that were not detected in the basic detecMarkers function. First, based on the current detected marker and the board layout, the function interpolates the position of the missing markers. Then it tries to find correspondence between the reprojected markers and the rejected candidates based on the minRepDistance and errorCorrectionRate parameters. If camera parameters and distortion coefficients are provided, missing markers are reprojected using projectPoint function. If not, missing marker projections are interpolated using global homography, and all the marker corners in the board must have the same Z coordinate.
      • refineDetectedMarkers

        public static void refineDetectedMarkers​(Mat image,
                                                 Board board,
                                                 java.util.List<Mat> detectedCorners,
                                                 Mat detectedIds,
                                                 java.util.List<Mat> rejectedCorners,
                                                 Mat cameraMatrix,
                                                 Mat distCoeffs,
                                                 float minRepDistance,
                                                 float errorCorrectionRate,
                                                 boolean checkAllOrders,
                                                 Mat recoveredIdxs)
        Refind not detected markers based on the already detected and the board layout
        Parameters:
        image - input image
        board - layout of markers in the board.
        detectedCorners - vector of already detected marker corners.
        detectedIds - vector of already detected marker identifiers.
        rejectedCorners - vector of rejected candidates during the marker detection process.
        cameraMatrix - optional input 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - optional vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        minRepDistance - minimum distance between the corners of the rejected candidate and the reprojected marker in order to consider it as a correspondence.
        errorCorrectionRate - rate of allowed erroneous bits respect to the error correction capability of the used dictionary. -1 ignores the error correction step.
        checkAllOrders - Consider the four posible corner orders in the rejectedCorners array. If it set to false, only the provided corner order is considered (default true).
        recoveredIdxs - Optional array to returns the indexes of the recovered candidates in the original rejectedCorners array. This function tries to find markers that were not detected in the basic detecMarkers function. First, based on the current detected marker and the board layout, the function interpolates the position of the missing markers. Then it tries to find correspondence between the reprojected markers and the rejected candidates based on the minRepDistance and errorCorrectionRate parameters. If camera parameters and distortion coefficients are provided, missing markers are reprojected using projectPoint function. If not, missing marker projections are interpolated using global homography, and all the marker corners in the board must have the same Z coordinate.
      • refineDetectedMarkers

        public static void refineDetectedMarkers​(Mat image,
                                                 Board board,
                                                 java.util.List<Mat> detectedCorners,
                                                 Mat detectedIds,
                                                 java.util.List<Mat> rejectedCorners,
                                                 Mat cameraMatrix,
                                                 Mat distCoeffs,
                                                 float minRepDistance,
                                                 float errorCorrectionRate,
                                                 boolean checkAllOrders)
        Refind not detected markers based on the already detected and the board layout
        Parameters:
        image - input image
        board - layout of markers in the board.
        detectedCorners - vector of already detected marker corners.
        detectedIds - vector of already detected marker identifiers.
        rejectedCorners - vector of rejected candidates during the marker detection process.
        cameraMatrix - optional input 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - optional vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        minRepDistance - minimum distance between the corners of the rejected candidate and the reprojected marker in order to consider it as a correspondence.
        errorCorrectionRate - rate of allowed erroneous bits respect to the error correction capability of the used dictionary. -1 ignores the error correction step.
        checkAllOrders - Consider the four posible corner orders in the rejectedCorners array. If it set to false, only the provided corner order is considered (default true). original rejectedCorners array. This function tries to find markers that were not detected in the basic detecMarkers function. First, based on the current detected marker and the board layout, the function interpolates the position of the missing markers. Then it tries to find correspondence between the reprojected markers and the rejected candidates based on the minRepDistance and errorCorrectionRate parameters. If camera parameters and distortion coefficients are provided, missing markers are reprojected using projectPoint function. If not, missing marker projections are interpolated using global homography, and all the marker corners in the board must have the same Z coordinate.
      • refineDetectedMarkers

        public static void refineDetectedMarkers​(Mat image,
                                                 Board board,
                                                 java.util.List<Mat> detectedCorners,
                                                 Mat detectedIds,
                                                 java.util.List<Mat> rejectedCorners,
                                                 Mat cameraMatrix,
                                                 Mat distCoeffs,
                                                 float minRepDistance,
                                                 float errorCorrectionRate)
        Refind not detected markers based on the already detected and the board layout
        Parameters:
        image - input image
        board - layout of markers in the board.
        detectedCorners - vector of already detected marker corners.
        detectedIds - vector of already detected marker identifiers.
        rejectedCorners - vector of rejected candidates during the marker detection process.
        cameraMatrix - optional input 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - optional vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        minRepDistance - minimum distance between the corners of the rejected candidate and the reprojected marker in order to consider it as a correspondence.
        errorCorrectionRate - rate of allowed erroneous bits respect to the error correction capability of the used dictionary. -1 ignores the error correction step. If it set to false, only the provided corner order is considered (default true). original rejectedCorners array. This function tries to find markers that were not detected in the basic detecMarkers function. First, based on the current detected marker and the board layout, the function interpolates the position of the missing markers. Then it tries to find correspondence between the reprojected markers and the rejected candidates based on the minRepDistance and errorCorrectionRate parameters. If camera parameters and distortion coefficients are provided, missing markers are reprojected using projectPoint function. If not, missing marker projections are interpolated using global homography, and all the marker corners in the board must have the same Z coordinate.
      • refineDetectedMarkers

        public static void refineDetectedMarkers​(Mat image,
                                                 Board board,
                                                 java.util.List<Mat> detectedCorners,
                                                 Mat detectedIds,
                                                 java.util.List<Mat> rejectedCorners,
                                                 Mat cameraMatrix,
                                                 Mat distCoeffs,
                                                 float minRepDistance)
        Refind not detected markers based on the already detected and the board layout
        Parameters:
        image - input image
        board - layout of markers in the board.
        detectedCorners - vector of already detected marker corners.
        detectedIds - vector of already detected marker identifiers.
        rejectedCorners - vector of rejected candidates during the marker detection process.
        cameraMatrix - optional input 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - optional vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        minRepDistance - minimum distance between the corners of the rejected candidate and the reprojected marker in order to consider it as a correspondence. capability of the used dictionary. -1 ignores the error correction step. If it set to false, only the provided corner order is considered (default true). original rejectedCorners array. This function tries to find markers that were not detected in the basic detecMarkers function. First, based on the current detected marker and the board layout, the function interpolates the position of the missing markers. Then it tries to find correspondence between the reprojected markers and the rejected candidates based on the minRepDistance and errorCorrectionRate parameters. If camera parameters and distortion coefficients are provided, missing markers are reprojected using projectPoint function. If not, missing marker projections are interpolated using global homography, and all the marker corners in the board must have the same Z coordinate.
      • refineDetectedMarkers

        public static void refineDetectedMarkers​(Mat image,
                                                 Board board,
                                                 java.util.List<Mat> detectedCorners,
                                                 Mat detectedIds,
                                                 java.util.List<Mat> rejectedCorners,
                                                 Mat cameraMatrix,
                                                 Mat distCoeffs)
        Refind not detected markers based on the already detected and the board layout
        Parameters:
        image - input image
        board - layout of markers in the board.
        detectedCorners - vector of already detected marker corners.
        detectedIds - vector of already detected marker identifiers.
        rejectedCorners - vector of rejected candidates during the marker detection process.
        cameraMatrix - optional input 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - optional vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements reprojected marker in order to consider it as a correspondence. capability of the used dictionary. -1 ignores the error correction step. If it set to false, only the provided corner order is considered (default true). original rejectedCorners array. This function tries to find markers that were not detected in the basic detecMarkers function. First, based on the current detected marker and the board layout, the function interpolates the position of the missing markers. Then it tries to find correspondence between the reprojected markers and the rejected candidates based on the minRepDistance and errorCorrectionRate parameters. If camera parameters and distortion coefficients are provided, missing markers are reprojected using projectPoint function. If not, missing marker projections are interpolated using global homography, and all the marker corners in the board must have the same Z coordinate.
      • refineDetectedMarkers

        public static void refineDetectedMarkers​(Mat image,
                                                 Board board,
                                                 java.util.List<Mat> detectedCorners,
                                                 Mat detectedIds,
                                                 java.util.List<Mat> rejectedCorners,
                                                 Mat cameraMatrix)
        Refind not detected markers based on the already detected and the board layout
        Parameters:
        image - input image
        board - layout of markers in the board.
        detectedCorners - vector of already detected marker corners.
        detectedIds - vector of already detected marker identifiers.
        rejectedCorners - vector of rejected candidates during the marker detection process.
        cameraMatrix - optional input 3x3 floating-point camera matrix \(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]])\) of 4, 5, 8 or 12 elements reprojected marker in order to consider it as a correspondence. capability of the used dictionary. -1 ignores the error correction step. If it set to false, only the provided corner order is considered (default true). original rejectedCorners array. This function tries to find markers that were not detected in the basic detecMarkers function. First, based on the current detected marker and the board layout, the function interpolates the position of the missing markers. Then it tries to find correspondence between the reprojected markers and the rejected candidates based on the minRepDistance and errorCorrectionRate parameters. If camera parameters and distortion coefficients are provided, missing markers are reprojected using projectPoint function. If not, missing marker projections are interpolated using global homography, and all the marker corners in the board must have the same Z coordinate.
      • refineDetectedMarkers

        public static void refineDetectedMarkers​(Mat image,
                                                 Board board,
                                                 java.util.List<Mat> detectedCorners,
                                                 Mat detectedIds,
                                                 java.util.List<Mat> rejectedCorners)
        Refind not detected markers based on the already detected and the board layout
        Parameters:
        image - input image
        board - layout of markers in the board.
        detectedCorners - vector of already detected marker corners.
        detectedIds - vector of already detected marker identifiers.
        rejectedCorners - vector of rejected candidates during the marker detection process. \(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]])\) of 4, 5, 8 or 12 elements reprojected marker in order to consider it as a correspondence. capability of the used dictionary. -1 ignores the error correction step. If it set to false, only the provided corner order is considered (default true). original rejectedCorners array. This function tries to find markers that were not detected in the basic detecMarkers function. First, based on the current detected marker and the board layout, the function interpolates the position of the missing markers. Then it tries to find correspondence between the reprojected markers and the rejected candidates based on the minRepDistance and errorCorrectionRate parameters. If camera parameters and distortion coefficients are provided, missing markers are reprojected using projectPoint function. If not, missing marker projections are interpolated using global homography, and all the marker corners in the board must have the same Z coordinate.
      • drawDetectedMarkers

        public static void drawDetectedMarkers​(Mat image,
                                               java.util.List<Mat> corners,
                                               Mat ids,
                                               Scalar borderColor)
        Draw detected markers in image
        Parameters:
        image - input/output image. It must have 1 or 3 channels. The number of channels is not altered.
        corners - positions of marker corners on input image. (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.
        ids - vector of identifiers for markers in markersCorners . Optional, if not provided, ids are not painted.
        borderColor - color of marker borders. Rest of colors (text color and first corner color) are calculated based on this one to improve visualization. Given an array of detected marker corners and its corresponding ids, this functions draws the markers in the image. The marker borders are painted and the markers identifiers if provided. Useful for debugging purposes.
      • drawDetectedMarkers

        public static void drawDetectedMarkers​(Mat image,
                                               java.util.List<Mat> corners,
                                               Mat ids)
        Draw detected markers in image
        Parameters:
        image - input/output image. It must have 1 or 3 channels. The number of channels is not altered.
        corners - positions of marker corners on input image. (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.
        ids - vector of identifiers for markers in markersCorners . Optional, if not provided, ids are not painted. are calculated based on this one to improve visualization. Given an array of detected marker corners and its corresponding ids, this functions draws the markers in the image. The marker borders are painted and the markers identifiers if provided. Useful for debugging purposes.
      • drawDetectedMarkers

        public static void drawDetectedMarkers​(Mat image,
                                               java.util.List<Mat> corners)
        Draw detected markers in image
        Parameters:
        image - input/output image. It must have 1 or 3 channels. The number of channels is not altered.
        corners - positions of marker corners on input image. (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise. Optional, if not provided, ids are not painted. are calculated based on this one to improve visualization. Given an array of detected marker corners and its corresponding ids, this functions draws the markers in the image. The marker borders are painted and the markers identifiers if provided. Useful for debugging purposes.
      • drawAxis

        @Deprecated
        public static void drawAxis​(Mat image,
                                    Mat cameraMatrix,
                                    Mat distCoeffs,
                                    Mat rvec,
                                    Mat tvec,
                                    float length)
        Deprecated.
        use cv::drawFrameAxes
        Draw coordinate system axis from pose estimation
        Parameters:
        image - input/output image. It must have 1 or 3 channels. The number of channels is not altered.
        cameraMatrix - input 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        rvec - rotation vector of the coordinate system that will be drawn. (SEE: Rodrigues).
        tvec - translation vector of the coordinate system that will be drawn.
        length - length of the painted axis in the same unit than tvec (usually in meters) Given the pose estimation of a marker or board, this function draws the axis of the world coordinate system, i.e. the system centered on the marker/board. Useful for debugging purposes.
      • drawMarker

        public static void drawMarker​(Dictionary dictionary,
                                      int id,
                                      int sidePixels,
                                      Mat img,
                                      int borderBits)
        Draw a canonical marker image
        Parameters:
        dictionary - dictionary of markers indicating the type of markers
        id - identifier of the marker that will be returned. It has to be a valid id in the specified dictionary.
        sidePixels - size of the image in pixels
        img - output image with the marker
        borderBits - width of the marker border. This function returns a marker image in its canonical form (i.e. ready to be printed)
      • drawMarker

        public static void drawMarker​(Dictionary dictionary,
                                      int id,
                                      int sidePixels,
                                      Mat img)
        Draw a canonical marker image
        Parameters:
        dictionary - dictionary of markers indicating the type of markers
        id - identifier of the marker that will be returned. It has to be a valid id in the specified dictionary.
        sidePixels - size of the image in pixels
        img - output image with the marker This function returns a marker image in its canonical form (i.e. ready to be printed)
      • drawPlanarBoard

        public static void drawPlanarBoard​(Board board,
                                           Size outSize,
                                           Mat img,
                                           int marginSize,
                                           int borderBits)
        Draw a planar board SEE: _drawPlanarBoardImpl
        Parameters:
        board - layout of the board that will be drawn. The board should be planar, z coordinate is ignored
        outSize - size of the output image in pixels.
        img - output image with the board. The size of this image will be outSize and the board will be on the center, keeping the board proportions.
        marginSize - minimum margins (in pixels) of the board in the output image
        borderBits - width of the marker borders. This function return the image of a planar board, ready to be printed. It assumes the Board layout specified is planar by ignoring the z coordinates of the object points.
      • drawPlanarBoard

        public static void drawPlanarBoard​(Board board,
                                           Size outSize,
                                           Mat img,
                                           int marginSize)
        Draw a planar board SEE: _drawPlanarBoardImpl
        Parameters:
        board - layout of the board that will be drawn. The board should be planar, z coordinate is ignored
        outSize - size of the output image in pixels.
        img - output image with the board. The size of this image will be outSize and the board will be on the center, keeping the board proportions.
        marginSize - minimum margins (in pixels) of the board in the output image This function return the image of a planar board, ready to be printed. It assumes the Board layout specified is planar by ignoring the z coordinates of the object points.
      • drawPlanarBoard

        public static void drawPlanarBoard​(Board board,
                                           Size outSize,
                                           Mat img)
        Draw a planar board SEE: _drawPlanarBoardImpl
        Parameters:
        board - layout of the board that will be drawn. The board should be planar, z coordinate is ignored
        outSize - size of the output image in pixels.
        img - output image with the board. The size of this image will be outSize and the board will be on the center, keeping the board proportions. This function return the image of a planar board, ready to be printed. It assumes the Board layout specified is planar by ignoring the z coordinates of the object points.
      • calibrateCameraArucoExtended

        public static double calibrateCameraArucoExtended​(java.util.List<Mat> corners,
                                                          Mat ids,
                                                          Mat counter,
                                                          Board board,
                                                          Size imageSize,
                                                          Mat cameraMatrix,
                                                          Mat distCoeffs,
                                                          java.util.List<Mat> rvecs,
                                                          java.util.List<Mat> tvecs,
                                                          Mat stdDeviationsIntrinsics,
                                                          Mat stdDeviationsExtrinsics,
                                                          Mat perViewErrors,
                                                          int flags,
                                                          TermCriteria criteria)
        Calibrate a camera using aruco markers
        Parameters:
        corners - vector of detected marker corners in all frames. The corners should have the same format returned by detectMarkers (see #detectMarkers).
        ids - list of identifiers for each marker in corners
        counter - number of markers in each frame so that corners and ids can be split
        board - Marker Board layout
        imageSize - Size of the image used only to initialize the intrinsic camera matrix.
        cameraMatrix - Output 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) . If CV\_CALIB\_USE\_INTRINSIC\_GUESS and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be initialized before calling the function.
        distCoeffs - Output vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        rvecs - Output vector of rotation vectors (see Rodrigues ) estimated for each board view (e.g. std::vector<cv::Mat>>). That is, each k-th rotation vector together with the corresponding k-th translation vector (see the next output parameter description) brings the board pattern from the model coordinate space (in which object points are specified) to the world coordinate space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1).
        tvecs - Output vector of translation vectors estimated for each pattern view.
        stdDeviationsIntrinsics - Output vector of standard deviations estimated for intrinsic parameters. Order of deviations values: \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3, s_4, \tau_x, \tau_y)\) If one of parameters is not estimated, it's deviation is equals to zero.
        stdDeviationsExtrinsics - Output vector of standard deviations estimated for extrinsic parameters. Order of deviations values: \((R_1, T_1, \dotsc , R_M, T_M)\) where M is number of pattern views, \(R_i, T_i\) are concatenated 1x3 vectors.
        perViewErrors - Output vector of average re-projection errors estimated for each pattern view.
        flags - flags Different flags for the calibration process (see #calibrateCamera for details).
        criteria - Termination criteria for the iterative optimization algorithm. This function calibrates a camera using an Aruco Board. The function receives a list of detected markers from several views of the Board. The process is similar to the chessboard calibration in calibrateCamera(). The function returns the final re-projection error.
        Returns:
        automatically generated
      • calibrateCameraArucoExtended

        public static double calibrateCameraArucoExtended​(java.util.List<Mat> corners,
                                                          Mat ids,
                                                          Mat counter,
                                                          Board board,
                                                          Size imageSize,
                                                          Mat cameraMatrix,
                                                          Mat distCoeffs,
                                                          java.util.List<Mat> rvecs,
                                                          java.util.List<Mat> tvecs,
                                                          Mat stdDeviationsIntrinsics,
                                                          Mat stdDeviationsExtrinsics,
                                                          Mat perViewErrors,
                                                          int flags)
        Calibrate a camera using aruco markers
        Parameters:
        corners - vector of detected marker corners in all frames. The corners should have the same format returned by detectMarkers (see #detectMarkers).
        ids - list of identifiers for each marker in corners
        counter - number of markers in each frame so that corners and ids can be split
        board - Marker Board layout
        imageSize - Size of the image used only to initialize the intrinsic camera matrix.
        cameraMatrix - Output 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) . If CV\_CALIB\_USE\_INTRINSIC\_GUESS and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be initialized before calling the function.
        distCoeffs - Output vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        rvecs - Output vector of rotation vectors (see Rodrigues ) estimated for each board view (e.g. std::vector<cv::Mat>>). That is, each k-th rotation vector together with the corresponding k-th translation vector (see the next output parameter description) brings the board pattern from the model coordinate space (in which object points are specified) to the world coordinate space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1).
        tvecs - Output vector of translation vectors estimated for each pattern view.
        stdDeviationsIntrinsics - Output vector of standard deviations estimated for intrinsic parameters. Order of deviations values: \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3, s_4, \tau_x, \tau_y)\) If one of parameters is not estimated, it's deviation is equals to zero.
        stdDeviationsExtrinsics - Output vector of standard deviations estimated for extrinsic parameters. Order of deviations values: \((R_1, T_1, \dotsc , R_M, T_M)\) where M is number of pattern views, \(R_i, T_i\) are concatenated 1x3 vectors.
        perViewErrors - Output vector of average re-projection errors estimated for each pattern view.
        flags - flags Different flags for the calibration process (see #calibrateCamera for details). This function calibrates a camera using an Aruco Board. The function receives a list of detected markers from several views of the Board. The process is similar to the chessboard calibration in calibrateCamera(). The function returns the final re-projection error.
        Returns:
        automatically generated
      • calibrateCameraArucoExtended

        public static double calibrateCameraArucoExtended​(java.util.List<Mat> corners,
                                                          Mat ids,
                                                          Mat counter,
                                                          Board board,
                                                          Size imageSize,
                                                          Mat cameraMatrix,
                                                          Mat distCoeffs,
                                                          java.util.List<Mat> rvecs,
                                                          java.util.List<Mat> tvecs,
                                                          Mat stdDeviationsIntrinsics,
                                                          Mat stdDeviationsExtrinsics,
                                                          Mat perViewErrors)
        Calibrate a camera using aruco markers
        Parameters:
        corners - vector of detected marker corners in all frames. The corners should have the same format returned by detectMarkers (see #detectMarkers).
        ids - list of identifiers for each marker in corners
        counter - number of markers in each frame so that corners and ids can be split
        board - Marker Board layout
        imageSize - Size of the image used only to initialize the intrinsic camera matrix.
        cameraMatrix - Output 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) . If CV\_CALIB\_USE\_INTRINSIC\_GUESS and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be initialized before calling the function.
        distCoeffs - Output vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        rvecs - Output vector of rotation vectors (see Rodrigues ) estimated for each board view (e.g. std::vector<cv::Mat>>). That is, each k-th rotation vector together with the corresponding k-th translation vector (see the next output parameter description) brings the board pattern from the model coordinate space (in which object points are specified) to the world coordinate space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1).
        tvecs - Output vector of translation vectors estimated for each pattern view.
        stdDeviationsIntrinsics - Output vector of standard deviations estimated for intrinsic parameters. Order of deviations values: \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3, s_4, \tau_x, \tau_y)\) If one of parameters is not estimated, it's deviation is equals to zero.
        stdDeviationsExtrinsics - Output vector of standard deviations estimated for extrinsic parameters. Order of deviations values: \((R_1, T_1, \dotsc , R_M, T_M)\) where M is number of pattern views, \(R_i, T_i\) are concatenated 1x3 vectors.
        perViewErrors - Output vector of average re-projection errors estimated for each pattern view. This function calibrates a camera using an Aruco Board. The function receives a list of detected markers from several views of the Board. The process is similar to the chessboard calibration in calibrateCamera(). The function returns the final re-projection error.
        Returns:
        automatically generated
      • calibrateCameraAruco

        public static double calibrateCameraAruco​(java.util.List<Mat> corners,
                                                  Mat ids,
                                                  Mat counter,
                                                  Board board,
                                                  Size imageSize,
                                                  Mat cameraMatrix,
                                                  Mat distCoeffs,
                                                  java.util.List<Mat> rvecs,
                                                  java.util.List<Mat> tvecs,
                                                  int flags,
                                                  TermCriteria criteria)
        It's the same function as #calibrateCameraAruco but without calibration error estimation.
        Parameters:
        corners - automatically generated
        ids - automatically generated
        counter - automatically generated
        board - automatically generated
        imageSize - automatically generated
        cameraMatrix - automatically generated
        distCoeffs - automatically generated
        rvecs - automatically generated
        tvecs - automatically generated
        flags - automatically generated
        criteria - automatically generated
        Returns:
        automatically generated
      • calibrateCameraAruco

        public static double calibrateCameraAruco​(java.util.List<Mat> corners,
                                                  Mat ids,
                                                  Mat counter,
                                                  Board board,
                                                  Size imageSize,
                                                  Mat cameraMatrix,
                                                  Mat distCoeffs,
                                                  java.util.List<Mat> rvecs,
                                                  java.util.List<Mat> tvecs,
                                                  int flags)
        It's the same function as #calibrateCameraAruco but without calibration error estimation.
        Parameters:
        corners - automatically generated
        ids - automatically generated
        counter - automatically generated
        board - automatically generated
        imageSize - automatically generated
        cameraMatrix - automatically generated
        distCoeffs - automatically generated
        rvecs - automatically generated
        tvecs - automatically generated
        flags - automatically generated
        Returns:
        automatically generated
      • calibrateCameraAruco

        public static double calibrateCameraAruco​(java.util.List<Mat> corners,
                                                  Mat ids,
                                                  Mat counter,
                                                  Board board,
                                                  Size imageSize,
                                                  Mat cameraMatrix,
                                                  Mat distCoeffs,
                                                  java.util.List<Mat> rvecs,
                                                  java.util.List<Mat> tvecs)
        It's the same function as #calibrateCameraAruco but without calibration error estimation.
        Parameters:
        corners - automatically generated
        ids - automatically generated
        counter - automatically generated
        board - automatically generated
        imageSize - automatically generated
        cameraMatrix - automatically generated
        distCoeffs - automatically generated
        rvecs - automatically generated
        tvecs - automatically generated
        Returns:
        automatically generated
      • calibrateCameraAruco

        public static double calibrateCameraAruco​(java.util.List<Mat> corners,
                                                  Mat ids,
                                                  Mat counter,
                                                  Board board,
                                                  Size imageSize,
                                                  Mat cameraMatrix,
                                                  Mat distCoeffs,
                                                  java.util.List<Mat> rvecs)
        It's the same function as #calibrateCameraAruco but without calibration error estimation.
        Parameters:
        corners - automatically generated
        ids - automatically generated
        counter - automatically generated
        board - automatically generated
        imageSize - automatically generated
        cameraMatrix - automatically generated
        distCoeffs - automatically generated
        rvecs - automatically generated
        Returns:
        automatically generated
      • calibrateCameraAruco

        public static double calibrateCameraAruco​(java.util.List<Mat> corners,
                                                  Mat ids,
                                                  Mat counter,
                                                  Board board,
                                                  Size imageSize,
                                                  Mat cameraMatrix,
                                                  Mat distCoeffs)
        It's the same function as #calibrateCameraAruco but without calibration error estimation.
        Parameters:
        corners - automatically generated
        ids - automatically generated
        counter - automatically generated
        board - automatically generated
        imageSize - automatically generated
        cameraMatrix - automatically generated
        distCoeffs - automatically generated
        Returns:
        automatically generated
      • getBoardObjectAndImagePoints

        public static void getBoardObjectAndImagePoints​(Board board,
                                                        java.util.List<Mat> detectedCorners,
                                                        Mat detectedIds,
                                                        Mat objPoints,
                                                        Mat imgPoints)
        Given a board configuration and a set of detected markers, returns the corresponding image points and object points to call solvePnP
        Parameters:
        board - Marker board layout.
        detectedCorners - List of detected marker corners of the board.
        detectedIds - List of identifiers for each marker.
        objPoints - Vector of vectors of board marker points in the board coordinate space.
        imgPoints - Vector of vectors of the projections of board marker corner points.
      • getPredefinedDictionary

        public static Dictionary getPredefinedDictionary​(int dict)
        Returns one of the predefined dictionaries referenced by DICT_*.
        Parameters:
        dict - automatically generated
        Returns:
        automatically generated
      • custom_dictionary

        public static Dictionary custom_dictionary​(int nMarkers,
                                                   int markerSize,
                                                   int randomSeed)
        SEE: generateCustomDictionary
        Parameters:
        nMarkers - automatically generated
        markerSize - automatically generated
        randomSeed - automatically generated
        Returns:
        automatically generated
      • custom_dictionary

        public static Dictionary custom_dictionary​(int nMarkers,
                                                   int markerSize)
        SEE: generateCustomDictionary
        Parameters:
        nMarkers - automatically generated
        markerSize - automatically generated
        Returns:
        automatically generated
      • custom_dictionary_from

        public static Dictionary custom_dictionary_from​(int nMarkers,
                                                        int markerSize,
                                                        Dictionary baseDictionary,
                                                        int randomSeed)
        Generates a new customizable marker dictionary
        Parameters:
        nMarkers - number of markers in the dictionary
        markerSize - number of bits per dimension of each markers
        baseDictionary - Include the markers in this dictionary at the beginning (optional)
        randomSeed - a user supplied seed for theRNG() This function creates a new dictionary composed by nMarkers markers and each markers composed by markerSize x markerSize bits. If baseDictionary is provided, its markers are directly included and the rest are generated based on them. If the size of baseDictionary is higher than nMarkers, only the first nMarkers in baseDictionary are taken and no new marker is added.
        Returns:
        automatically generated
      • custom_dictionary_from

        public static Dictionary custom_dictionary_from​(int nMarkers,
                                                        int markerSize,
                                                        Dictionary baseDictionary)
        Generates a new customizable marker dictionary
        Parameters:
        nMarkers - number of markers in the dictionary
        markerSize - number of bits per dimension of each markers
        baseDictionary - Include the markers in this dictionary at the beginning (optional) This function creates a new dictionary composed by nMarkers markers and each markers composed by markerSize x markerSize bits. If baseDictionary is provided, its markers are directly included and the rest are generated based on them. If the size of baseDictionary is higher than nMarkers, only the first nMarkers in baseDictionary are taken and no new marker is added.
        Returns:
        automatically generated
      • interpolateCornersCharuco

        public static int interpolateCornersCharuco​(java.util.List<Mat> markerCorners,
                                                    Mat markerIds,
                                                    Mat image,
                                                    CharucoBoard board,
                                                    Mat charucoCorners,
                                                    Mat charucoIds,
                                                    Mat cameraMatrix,
                                                    Mat distCoeffs,
                                                    int minMarkers)
        Interpolate position of ChArUco board corners
        Parameters:
        markerCorners - vector of already detected markers corners. For each marker, its four corners are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.
        markerIds - list of identifiers for each marker in corners
        image - input image necesary for corner refinement. Note that markers are not detected and should be sent in corners and ids parameters.
        board - layout of ChArUco board.
        charucoCorners - interpolated chessboard corners
        charucoIds - interpolated chessboard corners identifiers
        cameraMatrix - optional 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - optional vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        minMarkers - number of adjacent markers that must be detected to return a charuco corner This function receives the detected markers and returns the 2D position of the chessboard corners from a ChArUco board using the detected Aruco markers. If camera parameters are provided, the process is based in an approximated pose estimation, else it is based on local homography. Only visible corners are returned. For each corner, its corresponding identifier is also returned in charucoIds. The function returns the number of interpolated corners.
        Returns:
        automatically generated
      • interpolateCornersCharuco

        public static int interpolateCornersCharuco​(java.util.List<Mat> markerCorners,
                                                    Mat markerIds,
                                                    Mat image,
                                                    CharucoBoard board,
                                                    Mat charucoCorners,
                                                    Mat charucoIds,
                                                    Mat cameraMatrix,
                                                    Mat distCoeffs)
        Interpolate position of ChArUco board corners
        Parameters:
        markerCorners - vector of already detected markers corners. For each marker, its four corners are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.
        markerIds - list of identifiers for each marker in corners
        image - input image necesary for corner refinement. Note that markers are not detected and should be sent in corners and ids parameters.
        board - layout of ChArUco board.
        charucoCorners - interpolated chessboard corners
        charucoIds - interpolated chessboard corners identifiers
        cameraMatrix - optional 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - optional vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements This function receives the detected markers and returns the 2D position of the chessboard corners from a ChArUco board using the detected Aruco markers. If camera parameters are provided, the process is based in an approximated pose estimation, else it is based on local homography. Only visible corners are returned. For each corner, its corresponding identifier is also returned in charucoIds. The function returns the number of interpolated corners.
        Returns:
        automatically generated
      • interpolateCornersCharuco

        public static int interpolateCornersCharuco​(java.util.List<Mat> markerCorners,
                                                    Mat markerIds,
                                                    Mat image,
                                                    CharucoBoard board,
                                                    Mat charucoCorners,
                                                    Mat charucoIds,
                                                    Mat cameraMatrix)
        Interpolate position of ChArUco board corners
        Parameters:
        markerCorners - vector of already detected markers corners. For each marker, its four corners are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.
        markerIds - list of identifiers for each marker in corners
        image - input image necesary for corner refinement. Note that markers are not detected and should be sent in corners and ids parameters.
        board - layout of ChArUco board.
        charucoCorners - interpolated chessboard corners
        charucoIds - interpolated chessboard corners identifiers
        cameraMatrix - optional 3x3 floating-point camera matrix \(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]])\) of 4, 5, 8 or 12 elements This function receives the detected markers and returns the 2D position of the chessboard corners from a ChArUco board using the detected Aruco markers. If camera parameters are provided, the process is based in an approximated pose estimation, else it is based on local homography. Only visible corners are returned. For each corner, its corresponding identifier is also returned in charucoIds. The function returns the number of interpolated corners.
        Returns:
        automatically generated
      • interpolateCornersCharuco

        public static int interpolateCornersCharuco​(java.util.List<Mat> markerCorners,
                                                    Mat markerIds,
                                                    Mat image,
                                                    CharucoBoard board,
                                                    Mat charucoCorners,
                                                    Mat charucoIds)
        Interpolate position of ChArUco board corners
        Parameters:
        markerCorners - vector of already detected markers corners. For each marker, its four corners are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.
        markerIds - list of identifiers for each marker in corners
        image - input image necesary for corner refinement. Note that markers are not detected and should be sent in corners and ids parameters.
        board - layout of ChArUco board.
        charucoCorners - interpolated chessboard corners
        charucoIds - interpolated chessboard corners identifiers \(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]])\) of 4, 5, 8 or 12 elements This function receives the detected markers and returns the 2D position of the chessboard corners from a ChArUco board using the detected Aruco markers. If camera parameters are provided, the process is based in an approximated pose estimation, else it is based on local homography. Only visible corners are returned. For each corner, its corresponding identifier is also returned in charucoIds. The function returns the number of interpolated corners.
        Returns:
        automatically generated
      • estimatePoseCharucoBoard

        public static boolean estimatePoseCharucoBoard​(Mat charucoCorners,
                                                       Mat charucoIds,
                                                       CharucoBoard board,
                                                       Mat cameraMatrix,
                                                       Mat distCoeffs,
                                                       Mat rvec,
                                                       Mat tvec,
                                                       boolean useExtrinsicGuess)
        Pose estimation for a ChArUco board given some of their corners
        Parameters:
        charucoCorners - vector of detected charuco corners
        charucoIds - list of identifiers for each corner in charucoCorners
        board - layout of ChArUco board.
        cameraMatrix - input 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        rvec - Output vector (e.g. cv::Mat) corresponding to the rotation vector of the board (see cv::Rodrigues).
        tvec - Output vector (e.g. cv::Mat) corresponding to the translation vector of the board.
        useExtrinsicGuess - defines whether initial guess for \b rvec and \b tvec will be used or not. This function estimates a Charuco board pose from some detected corners. The function checks if the input corners are enough and valid to perform pose estimation. If pose estimation is valid, returns true, else returns false.
        Returns:
        automatically generated
      • estimatePoseCharucoBoard

        public static boolean estimatePoseCharucoBoard​(Mat charucoCorners,
                                                       Mat charucoIds,
                                                       CharucoBoard board,
                                                       Mat cameraMatrix,
                                                       Mat distCoeffs,
                                                       Mat rvec,
                                                       Mat tvec)
        Pose estimation for a ChArUco board given some of their corners
        Parameters:
        charucoCorners - vector of detected charuco corners
        charucoIds - list of identifiers for each corner in charucoCorners
        board - layout of ChArUco board.
        cameraMatrix - input 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
        distCoeffs - vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        rvec - Output vector (e.g. cv::Mat) corresponding to the rotation vector of the board (see cv::Rodrigues).
        tvec - Output vector (e.g. cv::Mat) corresponding to the translation vector of the board. This function estimates a Charuco board pose from some detected corners. The function checks if the input corners are enough and valid to perform pose estimation. If pose estimation is valid, returns true, else returns false.
        Returns:
        automatically generated
      • drawDetectedCornersCharuco

        public static void drawDetectedCornersCharuco​(Mat image,
                                                      Mat charucoCorners,
                                                      Mat charucoIds,
                                                      Scalar cornerColor)
        Draws a set of Charuco corners
        Parameters:
        image - input/output image. It must have 1 or 3 channels. The number of channels is not altered.
        charucoCorners - vector of detected charuco corners
        charucoIds - list of identifiers for each corner in charucoCorners
        cornerColor - color of the square surrounding each corner This function draws a set of detected Charuco corners. If identifiers vector is provided, it also draws the id of each corner.
      • drawDetectedCornersCharuco

        public static void drawDetectedCornersCharuco​(Mat image,
                                                      Mat charucoCorners,
                                                      Mat charucoIds)
        Draws a set of Charuco corners
        Parameters:
        image - input/output image. It must have 1 or 3 channels. The number of channels is not altered.
        charucoCorners - vector of detected charuco corners
        charucoIds - list of identifiers for each corner in charucoCorners This function draws a set of detected Charuco corners. If identifiers vector is provided, it also draws the id of each corner.
      • drawDetectedCornersCharuco

        public static void drawDetectedCornersCharuco​(Mat image,
                                                      Mat charucoCorners)
        Draws a set of Charuco corners
        Parameters:
        image - input/output image. It must have 1 or 3 channels. The number of channels is not altered.
        charucoCorners - vector of detected charuco corners This function draws a set of detected Charuco corners. If identifiers vector is provided, it also draws the id of each corner.
      • calibrateCameraCharucoExtended

        public static double calibrateCameraCharucoExtended​(java.util.List<Mat> charucoCorners,
                                                            java.util.List<Mat> charucoIds,
                                                            CharucoBoard board,
                                                            Size imageSize,
                                                            Mat cameraMatrix,
                                                            Mat distCoeffs,
                                                            java.util.List<Mat> rvecs,
                                                            java.util.List<Mat> tvecs,
                                                            Mat stdDeviationsIntrinsics,
                                                            Mat stdDeviationsExtrinsics,
                                                            Mat perViewErrors,
                                                            int flags,
                                                            TermCriteria criteria)
        Calibrate a camera using Charuco corners
        Parameters:
        charucoCorners - vector of detected charuco corners per frame
        charucoIds - list of identifiers for each corner in charucoCorners per frame
        board - Marker Board layout
        imageSize - input image size
        cameraMatrix - Output 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) . If CV\_CALIB\_USE\_INTRINSIC\_GUESS and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be initialized before calling the function.
        distCoeffs - Output vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        rvecs - Output vector of rotation vectors (see Rodrigues ) estimated for each board view (e.g. std::vector<cv::Mat>>). That is, each k-th rotation vector together with the corresponding k-th translation vector (see the next output parameter description) brings the board pattern from the model coordinate space (in which object points are specified) to the world coordinate space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1).
        tvecs - Output vector of translation vectors estimated for each pattern view.
        stdDeviationsIntrinsics - Output vector of standard deviations estimated for intrinsic parameters. Order of deviations values: \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3, s_4, \tau_x, \tau_y)\) If one of parameters is not estimated, it's deviation is equals to zero.
        stdDeviationsExtrinsics - Output vector of standard deviations estimated for extrinsic parameters. Order of deviations values: \((R_1, T_1, \dotsc , R_M, T_M)\) where M is number of pattern views, \(R_i, T_i\) are concatenated 1x3 vectors.
        perViewErrors - Output vector of average re-projection errors estimated for each pattern view.
        flags - flags Different flags for the calibration process (see #calibrateCamera for details).
        criteria - Termination criteria for the iterative optimization algorithm. This function calibrates a camera using a set of corners of a Charuco Board. The function receives a list of detected corners and its identifiers from several views of the Board. The function returns the final re-projection error.
        Returns:
        automatically generated
      • calibrateCameraCharucoExtended

        public static double calibrateCameraCharucoExtended​(java.util.List<Mat> charucoCorners,
                                                            java.util.List<Mat> charucoIds,
                                                            CharucoBoard board,
                                                            Size imageSize,
                                                            Mat cameraMatrix,
                                                            Mat distCoeffs,
                                                            java.util.List<Mat> rvecs,
                                                            java.util.List<Mat> tvecs,
                                                            Mat stdDeviationsIntrinsics,
                                                            Mat stdDeviationsExtrinsics,
                                                            Mat perViewErrors,
                                                            int flags)
        Calibrate a camera using Charuco corners
        Parameters:
        charucoCorners - vector of detected charuco corners per frame
        charucoIds - list of identifiers for each corner in charucoCorners per frame
        board - Marker Board layout
        imageSize - input image size
        cameraMatrix - Output 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) . If CV\_CALIB\_USE\_INTRINSIC\_GUESS and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be initialized before calling the function.
        distCoeffs - Output vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        rvecs - Output vector of rotation vectors (see Rodrigues ) estimated for each board view (e.g. std::vector<cv::Mat>>). That is, each k-th rotation vector together with the corresponding k-th translation vector (see the next output parameter description) brings the board pattern from the model coordinate space (in which object points are specified) to the world coordinate space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1).
        tvecs - Output vector of translation vectors estimated for each pattern view.
        stdDeviationsIntrinsics - Output vector of standard deviations estimated for intrinsic parameters. Order of deviations values: \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3, s_4, \tau_x, \tau_y)\) If one of parameters is not estimated, it's deviation is equals to zero.
        stdDeviationsExtrinsics - Output vector of standard deviations estimated for extrinsic parameters. Order of deviations values: \((R_1, T_1, \dotsc , R_M, T_M)\) where M is number of pattern views, \(R_i, T_i\) are concatenated 1x3 vectors.
        perViewErrors - Output vector of average re-projection errors estimated for each pattern view.
        flags - flags Different flags for the calibration process (see #calibrateCamera for details). This function calibrates a camera using a set of corners of a Charuco Board. The function receives a list of detected corners and its identifiers from several views of the Board. The function returns the final re-projection error.
        Returns:
        automatically generated
      • calibrateCameraCharucoExtended

        public static double calibrateCameraCharucoExtended​(java.util.List<Mat> charucoCorners,
                                                            java.util.List<Mat> charucoIds,
                                                            CharucoBoard board,
                                                            Size imageSize,
                                                            Mat cameraMatrix,
                                                            Mat distCoeffs,
                                                            java.util.List<Mat> rvecs,
                                                            java.util.List<Mat> tvecs,
                                                            Mat stdDeviationsIntrinsics,
                                                            Mat stdDeviationsExtrinsics,
                                                            Mat perViewErrors)
        Calibrate a camera using Charuco corners
        Parameters:
        charucoCorners - vector of detected charuco corners per frame
        charucoIds - list of identifiers for each corner in charucoCorners per frame
        board - Marker Board layout
        imageSize - input image size
        cameraMatrix - Output 3x3 floating-point camera matrix \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) . If CV\_CALIB\_USE\_INTRINSIC\_GUESS and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be initialized before calling the function.
        distCoeffs - Output vector of distortion coefficients \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
        rvecs - Output vector of rotation vectors (see Rodrigues ) estimated for each board view (e.g. std::vector<cv::Mat>>). That is, each k-th rotation vector together with the corresponding k-th translation vector (see the next output parameter description) brings the board pattern from the model coordinate space (in which object points are specified) to the world coordinate space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1).
        tvecs - Output vector of translation vectors estimated for each pattern view.
        stdDeviationsIntrinsics - Output vector of standard deviations estimated for intrinsic parameters. Order of deviations values: \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3, s_4, \tau_x, \tau_y)\) If one of parameters is not estimated, it's deviation is equals to zero.
        stdDeviationsExtrinsics - Output vector of standard deviations estimated for extrinsic parameters. Order of deviations values: \((R_1, T_1, \dotsc , R_M, T_M)\) where M is number of pattern views, \(R_i, T_i\) are concatenated 1x3 vectors.
        perViewErrors - Output vector of average re-projection errors estimated for each pattern view. This function calibrates a camera using a set of corners of a Charuco Board. The function receives a list of detected corners and its identifiers from several views of the Board. The function returns the final re-projection error.
        Returns:
        automatically generated
      • calibrateCameraCharuco

        public static double calibrateCameraCharuco​(java.util.List<Mat> charucoCorners,
                                                    java.util.List<Mat> charucoIds,
                                                    CharucoBoard board,
                                                    Size imageSize,
                                                    Mat cameraMatrix,
                                                    Mat distCoeffs,
                                                    java.util.List<Mat> rvecs,
                                                    java.util.List<Mat> tvecs,
                                                    int flags,
                                                    TermCriteria criteria)
        It's the same function as #calibrateCameraCharuco but without calibration error estimation.
        Parameters:
        charucoCorners - automatically generated
        charucoIds - automatically generated
        board - automatically generated
        imageSize - automatically generated
        cameraMatrix - automatically generated
        distCoeffs - automatically generated
        rvecs - automatically generated
        tvecs - automatically generated
        flags - automatically generated
        criteria - automatically generated
        Returns:
        automatically generated
      • calibrateCameraCharuco

        public static double calibrateCameraCharuco​(java.util.List<Mat> charucoCorners,
                                                    java.util.List<Mat> charucoIds,
                                                    CharucoBoard board,
                                                    Size imageSize,
                                                    Mat cameraMatrix,
                                                    Mat distCoeffs,
                                                    java.util.List<Mat> rvecs,
                                                    java.util.List<Mat> tvecs,
                                                    int flags)
        It's the same function as #calibrateCameraCharuco but without calibration error estimation.
        Parameters:
        charucoCorners - automatically generated
        charucoIds - automatically generated
        board - automatically generated
        imageSize - automatically generated
        cameraMatrix - automatically generated
        distCoeffs - automatically generated
        rvecs - automatically generated
        tvecs - automatically generated
        flags - automatically generated
        Returns:
        automatically generated
      • calibrateCameraCharuco

        public static double calibrateCameraCharuco​(java.util.List<Mat> charucoCorners,
                                                    java.util.List<Mat> charucoIds,
                                                    CharucoBoard board,
                                                    Size imageSize,
                                                    Mat cameraMatrix,
                                                    Mat distCoeffs,
                                                    java.util.List<Mat> rvecs,
                                                    java.util.List<Mat> tvecs)
        It's the same function as #calibrateCameraCharuco but without calibration error estimation.
        Parameters:
        charucoCorners - automatically generated
        charucoIds - automatically generated
        board - automatically generated
        imageSize - automatically generated
        cameraMatrix - automatically generated
        distCoeffs - automatically generated
        rvecs - automatically generated
        tvecs - automatically generated
        Returns:
        automatically generated
      • calibrateCameraCharuco

        public static double calibrateCameraCharuco​(java.util.List<Mat> charucoCorners,
                                                    java.util.List<Mat> charucoIds,
                                                    CharucoBoard board,
                                                    Size imageSize,
                                                    Mat cameraMatrix,
                                                    Mat distCoeffs,
                                                    java.util.List<Mat> rvecs)
        It's the same function as #calibrateCameraCharuco but without calibration error estimation.
        Parameters:
        charucoCorners - automatically generated
        charucoIds - automatically generated
        board - automatically generated
        imageSize - automatically generated
        cameraMatrix - automatically generated
        distCoeffs - automatically generated
        rvecs - automatically generated
        Returns:
        automatically generated
      • calibrateCameraCharuco

        public static double calibrateCameraCharuco​(java.util.List<Mat> charucoCorners,
                                                    java.util.List<Mat> charucoIds,
                                                    CharucoBoard board,
                                                    Size imageSize,
                                                    Mat cameraMatrix,
                                                    Mat distCoeffs)
        It's the same function as #calibrateCameraCharuco but without calibration error estimation.
        Parameters:
        charucoCorners - automatically generated
        charucoIds - automatically generated
        board - automatically generated
        imageSize - automatically generated
        cameraMatrix - automatically generated
        distCoeffs - automatically generated
        Returns:
        automatically generated
      • detectCharucoDiamond

        public static void detectCharucoDiamond​(Mat image,
                                                java.util.List<Mat> markerCorners,
                                                Mat markerIds,
                                                float squareMarkerLengthRate,
                                                java.util.List<Mat> diamondCorners,
                                                Mat diamondIds,
                                                Mat cameraMatrix,
                                                Mat distCoeffs)
        Detect ChArUco Diamond markers
        Parameters:
        image - input image necessary for corner subpixel.
        markerCorners - list of detected marker corners from detectMarkers function.
        markerIds - list of marker ids in markerCorners.
        squareMarkerLengthRate - rate between square and marker length: squareMarkerLengthRate = squareLength/markerLength. The real units are not necessary.
        diamondCorners - output list of detected diamond corners (4 corners per diamond). The order is the same than in marker corners: top left, top right, bottom right and bottom left. Similar format than the corners returned by detectMarkers (e.g std::vector<std::vector<cv::Point2f> > ).
        diamondIds - ids of the diamonds in diamondCorners. The id of each diamond is in fact of type Vec4i, so each diamond has 4 ids, which are the ids of the aruco markers composing the diamond.
        cameraMatrix - Optional camera calibration matrix.
        distCoeffs - Optional camera distortion coefficients. This function detects Diamond markers from the previous detected ArUco markers. The diamonds are returned in the diamondCorners and diamondIds parameters. If camera calibration parameters are provided, the diamond search is based on reprojection. If not, diamond search is based on homography. Homography is faster than reprojection but can slightly reduce the detection rate.
      • detectCharucoDiamond

        public static void detectCharucoDiamond​(Mat image,
                                                java.util.List<Mat> markerCorners,
                                                Mat markerIds,
                                                float squareMarkerLengthRate,
                                                java.util.List<Mat> diamondCorners,
                                                Mat diamondIds,
                                                Mat cameraMatrix)
        Detect ChArUco Diamond markers
        Parameters:
        image - input image necessary for corner subpixel.
        markerCorners - list of detected marker corners from detectMarkers function.
        markerIds - list of marker ids in markerCorners.
        squareMarkerLengthRate - rate between square and marker length: squareMarkerLengthRate = squareLength/markerLength. The real units are not necessary.
        diamondCorners - output list of detected diamond corners (4 corners per diamond). The order is the same than in marker corners: top left, top right, bottom right and bottom left. Similar format than the corners returned by detectMarkers (e.g std::vector<std::vector<cv::Point2f> > ).
        diamondIds - ids of the diamonds in diamondCorners. The id of each diamond is in fact of type Vec4i, so each diamond has 4 ids, which are the ids of the aruco markers composing the diamond.
        cameraMatrix - Optional camera calibration matrix. This function detects Diamond markers from the previous detected ArUco markers. The diamonds are returned in the diamondCorners and diamondIds parameters. If camera calibration parameters are provided, the diamond search is based on reprojection. If not, diamond search is based on homography. Homography is faster than reprojection but can slightly reduce the detection rate.
      • detectCharucoDiamond

        public static void detectCharucoDiamond​(Mat image,
                                                java.util.List<Mat> markerCorners,
                                                Mat markerIds,
                                                float squareMarkerLengthRate,
                                                java.util.List<Mat> diamondCorners,
                                                Mat diamondIds)
        Detect ChArUco Diamond markers
        Parameters:
        image - input image necessary for corner subpixel.
        markerCorners - list of detected marker corners from detectMarkers function.
        markerIds - list of marker ids in markerCorners.
        squareMarkerLengthRate - rate between square and marker length: squareMarkerLengthRate = squareLength/markerLength. The real units are not necessary.
        diamondCorners - output list of detected diamond corners (4 corners per diamond). The order is the same than in marker corners: top left, top right, bottom right and bottom left. Similar format than the corners returned by detectMarkers (e.g std::vector<std::vector<cv::Point2f> > ).
        diamondIds - ids of the diamonds in diamondCorners. The id of each diamond is in fact of type Vec4i, so each diamond has 4 ids, which are the ids of the aruco markers composing the diamond. This function detects Diamond markers from the previous detected ArUco markers. The diamonds are returned in the diamondCorners and diamondIds parameters. If camera calibration parameters are provided, the diamond search is based on reprojection. If not, diamond search is based on homography. Homography is faster than reprojection but can slightly reduce the detection rate.
      • drawDetectedDiamonds

        public static void drawDetectedDiamonds​(Mat image,
                                                java.util.List<Mat> diamondCorners,
                                                Mat diamondIds,
                                                Scalar borderColor)
        Draw a set of detected ChArUco Diamond markers
        Parameters:
        image - input/output image. It must have 1 or 3 channels. The number of channels is not altered.
        diamondCorners - positions of diamond corners in the same format returned by detectCharucoDiamond(). (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.
        diamondIds - vector of identifiers for diamonds in diamondCorners, in the same format returned by detectCharucoDiamond() (e.g. std::vector<Vec4i>). Optional, if not provided, ids are not painted.
        borderColor - color of marker borders. Rest of colors (text color and first corner color) are calculated based on this one. Given an array of detected diamonds, this functions draws them in the image. The marker borders are painted and the markers identifiers if provided. Useful for debugging purposes.
      • drawDetectedDiamonds

        public static void drawDetectedDiamonds​(Mat image,
                                                java.util.List<Mat> diamondCorners,
                                                Mat diamondIds)
        Draw a set of detected ChArUco Diamond markers
        Parameters:
        image - input/output image. It must have 1 or 3 channels. The number of channels is not altered.
        diamondCorners - positions of diamond corners in the same format returned by detectCharucoDiamond(). (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.
        diamondIds - vector of identifiers for diamonds in diamondCorners, in the same format returned by detectCharucoDiamond() (e.g. std::vector<Vec4i>). Optional, if not provided, ids are not painted. are calculated based on this one. Given an array of detected diamonds, this functions draws them in the image. The marker borders are painted and the markers identifiers if provided. Useful for debugging purposes.
      • drawDetectedDiamonds

        public static void drawDetectedDiamonds​(Mat image,
                                                java.util.List<Mat> diamondCorners)
        Draw a set of detected ChArUco Diamond markers
        Parameters:
        image - input/output image. It must have 1 or 3 channels. The number of channels is not altered.
        diamondCorners - positions of diamond corners in the same format returned by detectCharucoDiamond(). (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise. returned by detectCharucoDiamond() (e.g. std::vector<Vec4i>). Optional, if not provided, ids are not painted. are calculated based on this one. Given an array of detected diamonds, this functions draws them in the image. The marker borders are painted and the markers identifiers if provided. Useful for debugging purposes.
      • testCharucoCornersCollinear

        public static boolean testCharucoCornersCollinear​(CharucoBoard _board,
                                                          Mat _charucoIds)
        test whether the ChArUco markers are collinear
        Parameters:
        _board - layout of ChArUco board.
        _charucoIds - list of identifiers for each corner in charucoCorners per frame.
        Returns:
        bool value, 1 (true) if detected corners form a line, 0 (false) if they do not. solvePnP, calibration functions will fail if the corners are collinear (true). The number of ids in charucoIDs should be <= the number of chessboard corners in the board. This functions checks whether the charuco corners are on a straight line (returns true, if so), or not (false). Axis parallel, as well as diagonal and other straight lines detected. Degenerate cases: for number of charucoIDs <= 2, the function returns true.