OpenCV for Unity 3.0.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/5.0/index.html ) for the details of the argument of the method.
Loading...
Searching...
No Matches
OpenCVForUnity.ObjdetectModule.Objdetect Class Reference

Static Public Member Functions

static bool checkChessboard (Mat img, in Vec2d size)
 Checks whether the image contains chessboard of the specific size or not.
 
static bool checkChessboard (Mat img, in(double width, double height) size)
 Checks whether the image contains chessboard of the specific size or not.
 
static bool checkChessboard (Mat img, Size size)
 Checks whether the image contains chessboard of the specific size or not.
 
static void drawChessboardCorners (Mat image, in Vec2d patternSize, MatOfPoint2f corners, bool patternWasFound)
 Renders the detected chessboard corners.
 
static void drawChessboardCorners (Mat image, in(double width, double height) patternSize, MatOfPoint2f corners, bool patternWasFound)
 Renders the detected chessboard corners.
 
static void drawChessboardCorners (Mat image, Size patternSize, MatOfPoint2f corners, bool patternWasFound)
 Renders the detected chessboard corners.
 
static void drawDetectedCornersCharuco (Mat image, Mat charucoCorners)
 Draws a set of Charuco corners.
 
static void drawDetectedCornersCharuco (Mat image, Mat charucoCorners, Mat charucoIds)
 Draws a set of Charuco corners.
 
static void drawDetectedCornersCharuco (Mat image, Mat charucoCorners, Mat charucoIds, in Vec4d cornerColor)
 Draws a set of Charuco corners.
 
static void drawDetectedCornersCharuco (Mat image, Mat charucoCorners, Mat charucoIds, in(double v0, double v1, double v2, double v3) cornerColor)
 Draws a set of Charuco corners.
 
static void drawDetectedCornersCharuco (Mat image, Mat charucoCorners, Mat charucoIds, Scalar cornerColor)
 Draws a set of Charuco corners.
 
static void drawDetectedDiamonds (Mat image, List< Mat > diamondCorners)
 Draw a set of detected ChArUco Diamond markers.
 
static void drawDetectedDiamonds (Mat image, List< Mat > diamondCorners, Mat diamondIds)
 Draw a set of detected ChArUco Diamond markers.
 
static void drawDetectedDiamonds (Mat image, List< Mat > diamondCorners, Mat diamondIds, in Vec4d borderColor)
 Draw a set of detected ChArUco Diamond markers.
 
static void drawDetectedDiamonds (Mat image, List< Mat > diamondCorners, Mat diamondIds, in(double v0, double v1, double v2, double v3) borderColor)
 Draw a set of detected ChArUco Diamond markers.
 
static void drawDetectedDiamonds (Mat image, List< Mat > diamondCorners, Mat diamondIds, Scalar borderColor)
 Draw a set of detected ChArUco Diamond markers.
 
static void drawDetectedMarkers (Mat image, List< Mat > corners)
 Draw detected markers in image.
 
static void drawDetectedMarkers (Mat image, List< Mat > corners, Mat ids)
 Draw detected markers in image.
 
static void drawDetectedMarkers (Mat image, List< Mat > corners, Mat ids, in Vec4d borderColor)
 Draw detected markers in image.
 
static void drawDetectedMarkers (Mat image, List< Mat > corners, Mat ids, in(double v0, double v1, double v2, double v3) borderColor)
 Draw detected markers in image.
 
static void drawDetectedMarkers (Mat image, List< Mat > corners, Mat ids, Scalar borderColor)
 Draw detected markers in image.
 
static Scalar estimateChessboardSharpness (Mat image, Size patternSize, Mat corners)
 Estimates the sharpness of a detected chessboard.
 
static Scalar estimateChessboardSharpness (Mat image, Size patternSize, Mat corners, float rise_distance)
 Estimates the sharpness of a detected chessboard.
 
static Scalar estimateChessboardSharpness (Mat image, Size patternSize, Mat corners, float rise_distance, bool vertical)
 Estimates the sharpness of a detected chessboard.
 
static Scalar estimateChessboardSharpness (Mat image, Size patternSize, Mat corners, float rise_distance, bool vertical, Mat sharpness)
 Estimates the sharpness of a detected chessboard.
 
static double double double double v3 estimateChessboardSharpnessAsValueTuple (Mat image, in(double width, double height) patternSize, Mat corners)
 
static double double double double v3 estimateChessboardSharpnessAsValueTuple (Mat image, in(double width, double height) patternSize, Mat corners, float rise_distance)
 
static double double double double v3 estimateChessboardSharpnessAsValueTuple (Mat image, in(double width, double height) patternSize, Mat corners, float rise_distance, bool vertical)
 
static double double double double v3 estimateChessboardSharpnessAsValueTuple (Mat image, in(double width, double height) patternSize, Mat corners, float rise_distance, bool vertical, Mat sharpness)
 
static Vec4d estimateChessboardSharpnessAsVec4d (Mat image, in Vec2d patternSize, Mat corners)
 Estimates the sharpness of a detected chessboard.
 
static Vec4d estimateChessboardSharpnessAsVec4d (Mat image, in Vec2d patternSize, Mat corners, float rise_distance)
 Estimates the sharpness of a detected chessboard.
 
static Vec4d estimateChessboardSharpnessAsVec4d (Mat image, in Vec2d patternSize, Mat corners, float rise_distance, bool vertical)
 Estimates the sharpness of a detected chessboard.
 
static Vec4d estimateChessboardSharpnessAsVec4d (Mat image, in Vec2d patternSize, Mat corners, float rise_distance, bool vertical, Mat sharpness)
 Estimates the sharpness of a detected chessboard.
 
static Dictionary extendDictionary (int nMarkers, int markerSize)
 Extend base dictionary by new nMarkers.
 
static Dictionary extendDictionary (int nMarkers, int markerSize, Dictionary baseDictionary)
 Extend base dictionary by new nMarkers.
 
static Dictionary extendDictionary (int nMarkers, int markerSize, Dictionary baseDictionary, int randomSeed)
 Extend base dictionary by new nMarkers.
 
static bool find4QuadCornerSubpix (Mat img, Mat corners, in Vec2d region_size)
 
static bool find4QuadCornerSubpix (Mat img, Mat corners, in(double width, double height) region_size)
 
static bool find4QuadCornerSubpix (Mat img, Mat corners, Size region_size)
 
static bool findChessboardCorners (Mat image, in Vec2d patternSize, MatOfPoint2f corners)
 Finds the positions of internal corners of the chessboard.
 
static bool findChessboardCorners (Mat image, in Vec2d patternSize, MatOfPoint2f corners, int flags)
 Finds the positions of internal corners of the chessboard.
 
static bool findChessboardCorners (Mat image, in(double width, double height) patternSize, MatOfPoint2f corners)
 Finds the positions of internal corners of the chessboard.
 
static bool findChessboardCorners (Mat image, in(double width, double height) patternSize, MatOfPoint2f corners, int flags)
 Finds the positions of internal corners of the chessboard.
 
static bool findChessboardCorners (Mat image, Size patternSize, MatOfPoint2f corners)
 Finds the positions of internal corners of the chessboard.
 
static bool findChessboardCorners (Mat image, Size patternSize, MatOfPoint2f corners, int flags)
 Finds the positions of internal corners of the chessboard.
 
static bool findChessboardCornersSB (Mat image, in Vec2d patternSize, Mat corners)
 
static bool findChessboardCornersSB (Mat image, in Vec2d patternSize, Mat corners, int flags)
 
static bool findChessboardCornersSB (Mat image, in(double width, double height) patternSize, Mat corners)
 
static bool findChessboardCornersSB (Mat image, in(double width, double height) patternSize, Mat corners, int flags)
 
static bool findChessboardCornersSB (Mat image, Size patternSize, Mat corners)
 
static bool findChessboardCornersSB (Mat image, Size patternSize, Mat corners, int flags)
 
static bool findChessboardCornersSBWithMeta (Mat image, in Vec2d patternSize, Mat corners, int flags, Mat meta)
 Finds the positions of internal corners of the chessboard using a sector based approach.
 
static bool findChessboardCornersSBWithMeta (Mat image, in(double width, double height) patternSize, Mat corners, int flags, Mat meta)
 Finds the positions of internal corners of the chessboard using a sector based approach.
 
static bool findChessboardCornersSBWithMeta (Mat image, Size patternSize, Mat corners, int flags, Mat meta)
 Finds the positions of internal corners of the chessboard using a sector based approach.
 
static bool findCirclesGrid (Mat image, in Vec2d patternSize, Mat centers)
 
static bool findCirclesGrid (Mat image, in Vec2d patternSize, Mat centers, int flags)
 
static bool findCirclesGrid (Mat image, in(double width, double height) patternSize, Mat centers)
 
static bool findCirclesGrid (Mat image, in(double width, double height) patternSize, Mat centers, int flags)
 
static bool findCirclesGrid (Mat image, Size patternSize, Mat centers)
 
static bool findCirclesGrid (Mat image, Size patternSize, Mat centers, int flags)
 
static void generateImageMarker (Dictionary dictionary, int id, int sidePixels, Mat img)
 Generate a canonical marker image.
 
static void generateImageMarker (Dictionary dictionary, int id, int sidePixels, Mat img, int borderBits)
 Generate a canonical marker image.
 
static Dictionary getPredefinedDictionary (int dict)
 Returns one of the predefined dictionaries referenced by DICT_*.
 

Static Public Attributes

const int CALIB_CB_ACCURACY = 32
 C++: enum <unnamed>
 
const int CALIB_CB_ADAPTIVE_THRESH = 1
 C++: enum <unnamed>
 
const int CALIB_CB_ASYMMETRIC_GRID = 2
 C++: enum <unnamed>
 
const int CALIB_CB_CLUSTERING = 4
 C++: enum <unnamed>
 
const int CALIB_CB_EXHAUSTIVE = 16
 C++: enum <unnamed>
 
const int CALIB_CB_FAST_CHECK = 8
 C++: enum <unnamed>
 
const int CALIB_CB_FILTER_QUADS = 4
 C++: enum <unnamed>
 
const int CALIB_CB_LARGER = 64
 C++: enum <unnamed>
 
const int CALIB_CB_MARKER = 128
 C++: enum <unnamed>
 
const int CALIB_CB_NORMALIZE_IMAGE = 2
 C++: enum <unnamed>
 
const int CALIB_CB_PLAIN = 256
 C++: enum <unnamed>
 
const int CALIB_CB_SYMMETRIC_GRID = 1
 C++: enum <unnamed>
 
const int CORNER_REFINE_APRILTAG = 3
 C++: enum CornerRefineMethod (cv.aruco.CornerRefineMethod)
 
const int CORNER_REFINE_CONTOUR = 2
 C++: enum CornerRefineMethod (cv.aruco.CornerRefineMethod)
 
const int CORNER_REFINE_NONE = 0
 C++: enum CornerRefineMethod (cv.aruco.CornerRefineMethod)
 
const int CORNER_REFINE_SUBPIX = 1
 C++: enum CornerRefineMethod (cv.aruco.CornerRefineMethod)
 
const int DICT_4X4_100 = 0 + 1
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_4X4_1000 = 0 + 3
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_4X4_250 = 0 + 2
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_4X4_50 = 0
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_5X5_100 = 0 + 5
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_5X5_1000 = 0 + 7
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_5X5_250 = 0 + 6
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_5X5_50 = 0 + 4
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_6X6_100 = 0 + 9
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_6X6_1000 = 0 + 11
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_6X6_250 = 0 + 10
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_6X6_50 = 0 + 8
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_7X7_100 = 0 + 13
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_7X7_1000 = 0 + 15
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_7X7_250 = 0 + 14
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_7X7_50 = 0 + 12
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_APRILTAG_16h5 = 0 + 17
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_APRILTAG_25h9 = 0 + 18
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_APRILTAG_36h10 = 0 + 19
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_APRILTAG_36h11 = 0 + 20
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_ARUCO_MIP_36h12 = 0 + 21
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int DICT_ARUCO_ORIGINAL = 0 + 16
 C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
 
const int MCC24 = 0
 C++: enum ColorChart (cv.mcc.ColorChart)
 
const int SG140 = 0 + 1
 C++: enum ColorChart (cv.mcc.ColorChart)
 
static double v0
 Estimates the sharpness of a detected chessboard.
 
static double double v1
 
static double double double v2
 
const int VINYL18 = 0 + 2
 C++: enum ColorChart (cv.mcc.ColorChart)
 

Member Function Documentation

◆ checkChessboard() [1/3]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.checkChessboard ( Mat img,
in Vec2d size )
static

Checks whether the image contains chessboard of the specific size or not.

Parameters
imgSource chessboard view.
sizeSize of the chessboard.
Returns
Whether a chessboard was found.

◆ checkChessboard() [2/3]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.checkChessboard ( Mat img,
in(double width, double height) size )
static

Checks whether the image contains chessboard of the specific size or not.

Parameters
imgSource chessboard view.
sizeSize of the chessboard.
Returns
Whether a chessboard was found.

◆ checkChessboard() [3/3]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.checkChessboard ( Mat img,
Size size )
static

Checks whether the image contains chessboard of the specific size or not.

Parameters
imgSource chessboard view.
sizeSize of the chessboard.
Returns
Whether a chessboard was found.

◆ drawChessboardCorners() [1/3]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawChessboardCorners ( Mat image,
in Vec2d patternSize,
MatOfPoint2f corners,
bool patternWasFound )
static

Renders the detected chessboard corners.

Parameters
imageDestination image. It must be an 8-bit color image.
patternSizeNumber of inner corners per a chessboard row and column (patternSize = cv::Size(points_per_row,points_per_column)).
cornersArray of detected corners, the output of findChessboardCorners.
patternWasFoundParameter indicating whether the complete board was found or not. The return value of findChessboardCorners should be passed here.

The function draws individual chessboard corners detected either as red circles if the board was not found, or as colored corners connected with lines if the board was found.

◆ drawChessboardCorners() [2/3]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawChessboardCorners ( Mat image,
in(double width, double height) patternSize,
MatOfPoint2f corners,
bool patternWasFound )
static

Renders the detected chessboard corners.

Parameters
imageDestination image. It must be an 8-bit color image.
patternSizeNumber of inner corners per a chessboard row and column (patternSize = cv::Size(points_per_row,points_per_column)).
cornersArray of detected corners, the output of findChessboardCorners.
patternWasFoundParameter indicating whether the complete board was found or not. The return value of findChessboardCorners should be passed here.

The function draws individual chessboard corners detected either as red circles if the board was not found, or as colored corners connected with lines if the board was found.

◆ drawChessboardCorners() [3/3]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawChessboardCorners ( Mat image,
Size patternSize,
MatOfPoint2f corners,
bool patternWasFound )
static

Renders the detected chessboard corners.

Parameters
imageDestination image. It must be an 8-bit color image.
patternSizeNumber of inner corners per a chessboard row and column (patternSize = cv::Size(points_per_row,points_per_column)).
cornersArray of detected corners, the output of findChessboardCorners.
patternWasFoundParameter indicating whether the complete board was found or not. The return value of findChessboardCorners should be passed here.

The function draws individual chessboard corners detected either as red circles if the board was not found, or as colored corners connected with lines if the board was found.

◆ drawDetectedCornersCharuco() [1/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedCornersCharuco ( Mat image,
Mat charucoCorners )
static

Draws a set of Charuco corners.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
charucoCornersvector of detected charuco corners
charucoIdslist of identifiers for each corner in charucoCorners
cornerColorcolor 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() [2/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedCornersCharuco ( Mat image,
Mat charucoCorners,
Mat charucoIds )
static

Draws a set of Charuco corners.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
charucoCornersvector of detected charuco corners
charucoIdslist of identifiers for each corner in charucoCorners
cornerColorcolor 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() [3/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedCornersCharuco ( Mat image,
Mat charucoCorners,
Mat charucoIds,
in Vec4d cornerColor )
static

Draws a set of Charuco corners.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
charucoCornersvector of detected charuco corners
charucoIdslist of identifiers for each corner in charucoCorners
cornerColorcolor 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() [4/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedCornersCharuco ( Mat image,
Mat charucoCorners,
Mat charucoIds,
in(double v0, double v1, double v2, double v3) cornerColor )
static

Draws a set of Charuco corners.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
charucoCornersvector of detected charuco corners
charucoIdslist of identifiers for each corner in charucoCorners
cornerColorcolor 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() [5/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedCornersCharuco ( Mat image,
Mat charucoCorners,
Mat charucoIds,
Scalar cornerColor )
static

Draws a set of Charuco corners.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
charucoCornersvector of detected charuco corners
charucoIdslist of identifiers for each corner in charucoCorners
cornerColorcolor 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.

◆ drawDetectedDiamonds() [1/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedDiamonds ( Mat image,
List< Mat > diamondCorners )
static

Draw a set of detected ChArUco Diamond markers.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
diamondCornerspositions 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.
diamondIdsvector 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.
borderColorcolor 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() [2/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedDiamonds ( Mat image,
List< Mat > diamondCorners,
Mat diamondIds )
static

Draw a set of detected ChArUco Diamond markers.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
diamondCornerspositions 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.
diamondIdsvector 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.
borderColorcolor 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() [3/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedDiamonds ( Mat image,
List< Mat > diamondCorners,
Mat diamondIds,
in Vec4d borderColor )
static

Draw a set of detected ChArUco Diamond markers.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
diamondCornerspositions 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.
diamondIdsvector 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.
borderColorcolor 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() [4/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedDiamonds ( Mat image,
List< Mat > diamondCorners,
Mat diamondIds,
in(double v0, double v1, double v2, double v3) borderColor )
static

Draw a set of detected ChArUco Diamond markers.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
diamondCornerspositions 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.
diamondIdsvector 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.
borderColorcolor 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() [5/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedDiamonds ( Mat image,
List< Mat > diamondCorners,
Mat diamondIds,
Scalar borderColor )
static

Draw a set of detected ChArUco Diamond markers.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
diamondCornerspositions 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.
diamondIdsvector 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.
borderColorcolor 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.

◆ drawDetectedMarkers() [1/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedMarkers ( Mat image,
List< Mat > corners )
static

Draw detected markers in image.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
cornerspositions 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.
idsvector of identifiers for markers in markersCorners . Optional, if not provided, ids are not painted.
borderColorcolor 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() [2/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedMarkers ( Mat image,
List< Mat > corners,
Mat ids )
static

Draw detected markers in image.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
cornerspositions 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.
idsvector of identifiers for markers in markersCorners . Optional, if not provided, ids are not painted.
borderColorcolor 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() [3/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedMarkers ( Mat image,
List< Mat > corners,
Mat ids,
in Vec4d borderColor )
static

Draw detected markers in image.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
cornerspositions 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.
idsvector of identifiers for markers in markersCorners . Optional, if not provided, ids are not painted.
borderColorcolor 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() [4/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedMarkers ( Mat image,
List< Mat > corners,
Mat ids,
in(double v0, double v1, double v2, double v3) borderColor )
static

Draw detected markers in image.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
cornerspositions 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.
idsvector of identifiers for markers in markersCorners . Optional, if not provided, ids are not painted.
borderColorcolor 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() [5/5]

static void OpenCVForUnity.ObjdetectModule.Objdetect.drawDetectedMarkers ( Mat image,
List< Mat > corners,
Mat ids,
Scalar borderColor )
static

Draw detected markers in image.

Parameters
imageinput/output image. It must have 1 or 3 channels. The number of channels is not altered.
cornerspositions 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.
idsvector of identifiers for markers in markersCorners . Optional, if not provided, ids are not painted.
borderColorcolor 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.

◆ estimateChessboardSharpness() [1/4]

static Scalar OpenCVForUnity.ObjdetectModule.Objdetect.estimateChessboardSharpness ( Mat image,
Size patternSize,
Mat corners )
static

Estimates the sharpness of a detected chessboard.

Image sharpness, as well as brightness, are a critical parameter for accuracte camera calibration. For accessing these parameters for filtering out problematic calibraiton images, this method calculates edge profiles by traveling from black to white chessboard cell centers. Based on this, the number of pixels is calculated required to transit from black to white. This width of the transition area is a good indication of how sharp the chessboard is imaged and should be below ~3.0 pixels.

Parameters
imageGray image used to find chessboard corners
patternSizeSize of a found chessboard pattern
cornersCorners found by findChessboardCornersSB
rise_distanceRise distance 0.8 means 10% ... 90% of the final signal strength
verticalBy default edge responses for horizontal lines are calculated
sharpnessOptional output array with a sharpness value for calculated edge responses (see description)

The optional sharpness array is of type CV_32FC1 and has for each calculated profile one row with the following five entries: 0 = x coordinate of the underlying edge in the image 1 = y coordinate of the underlying edge in the image 2 = width of the transition area (sharpness) 3 = signal strength in the black cell (min brightness) 4 = signal strength in the white cell (max brightness)

Returns
Scalar(average sharpness, average min brightness, average max brightness,0)

◆ estimateChessboardSharpness() [2/4]

static Scalar OpenCVForUnity.ObjdetectModule.Objdetect.estimateChessboardSharpness ( Mat image,
Size patternSize,
Mat corners,
float rise_distance )
static

Estimates the sharpness of a detected chessboard.

Image sharpness, as well as brightness, are a critical parameter for accuracte camera calibration. For accessing these parameters for filtering out problematic calibraiton images, this method calculates edge profiles by traveling from black to white chessboard cell centers. Based on this, the number of pixels is calculated required to transit from black to white. This width of the transition area is a good indication of how sharp the chessboard is imaged and should be below ~3.0 pixels.

Parameters
imageGray image used to find chessboard corners
patternSizeSize of a found chessboard pattern
cornersCorners found by findChessboardCornersSB
rise_distanceRise distance 0.8 means 10% ... 90% of the final signal strength
verticalBy default edge responses for horizontal lines are calculated
sharpnessOptional output array with a sharpness value for calculated edge responses (see description)

The optional sharpness array is of type CV_32FC1 and has for each calculated profile one row with the following five entries: 0 = x coordinate of the underlying edge in the image 1 = y coordinate of the underlying edge in the image 2 = width of the transition area (sharpness) 3 = signal strength in the black cell (min brightness) 4 = signal strength in the white cell (max brightness)

Returns
Scalar(average sharpness, average min brightness, average max brightness,0)

◆ estimateChessboardSharpness() [3/4]

static Scalar OpenCVForUnity.ObjdetectModule.Objdetect.estimateChessboardSharpness ( Mat image,
Size patternSize,
Mat corners,
float rise_distance,
bool vertical )
static

Estimates the sharpness of a detected chessboard.

Image sharpness, as well as brightness, are a critical parameter for accuracte camera calibration. For accessing these parameters for filtering out problematic calibraiton images, this method calculates edge profiles by traveling from black to white chessboard cell centers. Based on this, the number of pixels is calculated required to transit from black to white. This width of the transition area is a good indication of how sharp the chessboard is imaged and should be below ~3.0 pixels.

Parameters
imageGray image used to find chessboard corners
patternSizeSize of a found chessboard pattern
cornersCorners found by findChessboardCornersSB
rise_distanceRise distance 0.8 means 10% ... 90% of the final signal strength
verticalBy default edge responses for horizontal lines are calculated
sharpnessOptional output array with a sharpness value for calculated edge responses (see description)

The optional sharpness array is of type CV_32FC1 and has for each calculated profile one row with the following five entries: 0 = x coordinate of the underlying edge in the image 1 = y coordinate of the underlying edge in the image 2 = width of the transition area (sharpness) 3 = signal strength in the black cell (min brightness) 4 = signal strength in the white cell (max brightness)

Returns
Scalar(average sharpness, average min brightness, average max brightness,0)

◆ estimateChessboardSharpness() [4/4]

static Scalar OpenCVForUnity.ObjdetectModule.Objdetect.estimateChessboardSharpness ( Mat image,
Size patternSize,
Mat corners,
float rise_distance,
bool vertical,
Mat sharpness )
static

Estimates the sharpness of a detected chessboard.

Image sharpness, as well as brightness, are a critical parameter for accuracte camera calibration. For accessing these parameters for filtering out problematic calibraiton images, this method calculates edge profiles by traveling from black to white chessboard cell centers. Based on this, the number of pixels is calculated required to transit from black to white. This width of the transition area is a good indication of how sharp the chessboard is imaged and should be below ~3.0 pixels.

Parameters
imageGray image used to find chessboard corners
patternSizeSize of a found chessboard pattern
cornersCorners found by findChessboardCornersSB
rise_distanceRise distance 0.8 means 10% ... 90% of the final signal strength
verticalBy default edge responses for horizontal lines are calculated
sharpnessOptional output array with a sharpness value for calculated edge responses (see description)

The optional sharpness array is of type CV_32FC1 and has for each calculated profile one row with the following five entries: 0 = x coordinate of the underlying edge in the image 1 = y coordinate of the underlying edge in the image 2 = width of the transition area (sharpness) 3 = signal strength in the black cell (min brightness) 4 = signal strength in the white cell (max brightness)

Returns
Scalar(average sharpness, average min brightness, average max brightness,0)

◆ estimateChessboardSharpnessAsValueTuple() [1/4]

static double double double double v3 OpenCVForUnity.ObjdetectModule.Objdetect.estimateChessboardSharpnessAsValueTuple ( Mat image,
in(double width, double height) patternSize,
Mat corners )
static

◆ estimateChessboardSharpnessAsValueTuple() [2/4]

static double double double double v3 OpenCVForUnity.ObjdetectModule.Objdetect.estimateChessboardSharpnessAsValueTuple ( Mat image,
in(double width, double height) patternSize,
Mat corners,
float rise_distance )
static

◆ estimateChessboardSharpnessAsValueTuple() [3/4]

static double double double double v3 OpenCVForUnity.ObjdetectModule.Objdetect.estimateChessboardSharpnessAsValueTuple ( Mat image,
in(double width, double height) patternSize,
Mat corners,
float rise_distance,
bool vertical )
static

◆ estimateChessboardSharpnessAsValueTuple() [4/4]

static double double double double v3 OpenCVForUnity.ObjdetectModule.Objdetect.estimateChessboardSharpnessAsValueTuple ( Mat image,
in(double width, double height) patternSize,
Mat corners,
float rise_distance,
bool vertical,
Mat sharpness )
static

◆ estimateChessboardSharpnessAsVec4d() [1/4]

static Vec4d OpenCVForUnity.ObjdetectModule.Objdetect.estimateChessboardSharpnessAsVec4d ( Mat image,
in Vec2d patternSize,
Mat corners )
static

Estimates the sharpness of a detected chessboard.

Image sharpness, as well as brightness, are a critical parameter for accuracte camera calibration. For accessing these parameters for filtering out problematic calibraiton images, this method calculates edge profiles by traveling from black to white chessboard cell centers. Based on this, the number of pixels is calculated required to transit from black to white. This width of the transition area is a good indication of how sharp the chessboard is imaged and should be below ~3.0 pixels.

Parameters
imageGray image used to find chessboard corners
patternSizeSize of a found chessboard pattern
cornersCorners found by findChessboardCornersSB
rise_distanceRise distance 0.8 means 10% ... 90% of the final signal strength
verticalBy default edge responses for horizontal lines are calculated
sharpnessOptional output array with a sharpness value for calculated edge responses (see description)

The optional sharpness array is of type CV_32FC1 and has for each calculated profile one row with the following five entries: 0 = x coordinate of the underlying edge in the image 1 = y coordinate of the underlying edge in the image 2 = width of the transition area (sharpness) 3 = signal strength in the black cell (min brightness) 4 = signal strength in the white cell (max brightness)

Returns
Scalar(average sharpness, average min brightness, average max brightness,0)

◆ estimateChessboardSharpnessAsVec4d() [2/4]

static Vec4d OpenCVForUnity.ObjdetectModule.Objdetect.estimateChessboardSharpnessAsVec4d ( Mat image,
in Vec2d patternSize,
Mat corners,
float rise_distance )
static

Estimates the sharpness of a detected chessboard.

Image sharpness, as well as brightness, are a critical parameter for accuracte camera calibration. For accessing these parameters for filtering out problematic calibraiton images, this method calculates edge profiles by traveling from black to white chessboard cell centers. Based on this, the number of pixels is calculated required to transit from black to white. This width of the transition area is a good indication of how sharp the chessboard is imaged and should be below ~3.0 pixels.

Parameters
imageGray image used to find chessboard corners
patternSizeSize of a found chessboard pattern
cornersCorners found by findChessboardCornersSB
rise_distanceRise distance 0.8 means 10% ... 90% of the final signal strength
verticalBy default edge responses for horizontal lines are calculated
sharpnessOptional output array with a sharpness value for calculated edge responses (see description)

The optional sharpness array is of type CV_32FC1 and has for each calculated profile one row with the following five entries: 0 = x coordinate of the underlying edge in the image 1 = y coordinate of the underlying edge in the image 2 = width of the transition area (sharpness) 3 = signal strength in the black cell (min brightness) 4 = signal strength in the white cell (max brightness)

Returns
Scalar(average sharpness, average min brightness, average max brightness,0)

◆ estimateChessboardSharpnessAsVec4d() [3/4]

static Vec4d OpenCVForUnity.ObjdetectModule.Objdetect.estimateChessboardSharpnessAsVec4d ( Mat image,
in Vec2d patternSize,
Mat corners,
float rise_distance,
bool vertical )
static

Estimates the sharpness of a detected chessboard.

Image sharpness, as well as brightness, are a critical parameter for accuracte camera calibration. For accessing these parameters for filtering out problematic calibraiton images, this method calculates edge profiles by traveling from black to white chessboard cell centers. Based on this, the number of pixels is calculated required to transit from black to white. This width of the transition area is a good indication of how sharp the chessboard is imaged and should be below ~3.0 pixels.

Parameters
imageGray image used to find chessboard corners
patternSizeSize of a found chessboard pattern
cornersCorners found by findChessboardCornersSB
rise_distanceRise distance 0.8 means 10% ... 90% of the final signal strength
verticalBy default edge responses for horizontal lines are calculated
sharpnessOptional output array with a sharpness value for calculated edge responses (see description)

The optional sharpness array is of type CV_32FC1 and has for each calculated profile one row with the following five entries: 0 = x coordinate of the underlying edge in the image 1 = y coordinate of the underlying edge in the image 2 = width of the transition area (sharpness) 3 = signal strength in the black cell (min brightness) 4 = signal strength in the white cell (max brightness)

Returns
Scalar(average sharpness, average min brightness, average max brightness,0)

◆ estimateChessboardSharpnessAsVec4d() [4/4]

static Vec4d OpenCVForUnity.ObjdetectModule.Objdetect.estimateChessboardSharpnessAsVec4d ( Mat image,
in Vec2d patternSize,
Mat corners,
float rise_distance,
bool vertical,
Mat sharpness )
static

Estimates the sharpness of a detected chessboard.

Image sharpness, as well as brightness, are a critical parameter for accuracte camera calibration. For accessing these parameters for filtering out problematic calibraiton images, this method calculates edge profiles by traveling from black to white chessboard cell centers. Based on this, the number of pixels is calculated required to transit from black to white. This width of the transition area is a good indication of how sharp the chessboard is imaged and should be below ~3.0 pixels.

Parameters
imageGray image used to find chessboard corners
patternSizeSize of a found chessboard pattern
cornersCorners found by findChessboardCornersSB
rise_distanceRise distance 0.8 means 10% ... 90% of the final signal strength
verticalBy default edge responses for horizontal lines are calculated
sharpnessOptional output array with a sharpness value for calculated edge responses (see description)

The optional sharpness array is of type CV_32FC1 and has for each calculated profile one row with the following five entries: 0 = x coordinate of the underlying edge in the image 1 = y coordinate of the underlying edge in the image 2 = width of the transition area (sharpness) 3 = signal strength in the black cell (min brightness) 4 = signal strength in the white cell (max brightness)

Returns
Scalar(average sharpness, average min brightness, average max brightness,0)

◆ extendDictionary() [1/3]

static Dictionary OpenCVForUnity.ObjdetectModule.Objdetect.extendDictionary ( int nMarkers,
int markerSize )
static

Extend base dictionary by new nMarkers.

Parameters
nMarkersnumber of markers in the dictionary
markerSizenumber of bits per dimension of each markers
baseDictionaryInclude the markers in this dictionary at the beginning (optional)
randomSeeda 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.

◆ extendDictionary() [2/3]

static Dictionary OpenCVForUnity.ObjdetectModule.Objdetect.extendDictionary ( int nMarkers,
int markerSize,
Dictionary baseDictionary )
static

Extend base dictionary by new nMarkers.

Parameters
nMarkersnumber of markers in the dictionary
markerSizenumber of bits per dimension of each markers
baseDictionaryInclude the markers in this dictionary at the beginning (optional)
randomSeeda 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.

◆ extendDictionary() [3/3]

static Dictionary OpenCVForUnity.ObjdetectModule.Objdetect.extendDictionary ( int nMarkers,
int markerSize,
Dictionary baseDictionary,
int randomSeed )
static

Extend base dictionary by new nMarkers.

Parameters
nMarkersnumber of markers in the dictionary
markerSizenumber of bits per dimension of each markers
baseDictionaryInclude the markers in this dictionary at the beginning (optional)
randomSeeda 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.

◆ find4QuadCornerSubpix() [1/3]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.find4QuadCornerSubpix ( Mat img,
Mat corners,
in Vec2d region_size )
static

◆ find4QuadCornerSubpix() [2/3]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.find4QuadCornerSubpix ( Mat img,
Mat corners,
in(double width, double height) region_size )
static

◆ find4QuadCornerSubpix() [3/3]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.find4QuadCornerSubpix ( Mat img,
Mat corners,
Size region_size )
static

◆ findChessboardCorners() [1/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCorners ( Mat image,
in Vec2d patternSize,
MatOfPoint2f corners )
static

Finds the positions of internal corners of the chessboard.

Parameters
imageSource chessboard view. It must be an 8-bit grayscale or color image.
patternSizeNumber of inner corners per a chessboard row and column ( patternSize = cv::Size(points_per_row,points_per_column) = cv::Size(columns,rows) ).
cornersOutput array of detected corners.
flagsVarious operation flags that can be zero or a combination of the following values:
  • CALIB_CB_ADAPTIVE_THRESH Use adaptive thresholding to convert the image to black and white, rather than a fixed threshold level (computed from the average image brightness).
  • CALIB_CB_NORMALIZE_IMAGE Normalize the image gamma with equalizeHist before applying fixed or adaptive thresholding.
  • CALIB_CB_FILTER_QUADS Use additional criteria (like contour area, perimeter, square-like shape) to filter out false quads extracted at the contour retrieval stage.
  • CALIB_CB_FAST_CHECK Run a fast check on the image that looks for chessboard corners, and shortcut the call if none is found. This can drastically speed up the call in the degenerate condition when no chessboard is observed.
  • CALIB_CB_PLAIN All other flags are ignored. The input image is taken as is. No image processing is done to improve to find the checkerboard. This has the effect of speeding up the execution of the function but could lead to not recognizing the checkerboard if the image is not previously binarized in the appropriate manner.
Returns
True if all of the corners are found and placed in a certain order (row by row, left to right in every row). Otherwise, if the function fails to find all the corners or reorder them, it returns false.

The function attempts to determine whether the input image is a view of the chessboard pattern and locate the internal chessboard corners. For example, a regular chessboard has 8 x 8 squares and 7 x 7 internal corners, that is, points where the black squares touch each other. The detected coordinates are approximate, and to determine their positions more accurately, the function calls #cornerSubPix. You also may use the function #cornerSubPix with different parameters if returned coordinates are not accurate enough.

Sample usage of detecting and drawing chessboard corners: :

Size patternsize(8,6); //interior number of corners
Mat gray = ....; //source image
vector<Point2f> corners; //this will be filled by the detected corners
//CALIB_CB_FAST_CHECK saves a lot of time on images
//that do not contain any chessboard corners
bool patternfound = findChessboardCorners(gray, patternsize, corners,
if(patternfound)
cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1),
TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
drawChessboardCorners(img, patternsize, Mat(corners), patternfound);
n-dimensional dense array class
Definition Mat_ValueTuple.cs:10
Template class for specifying the size of an image or rectangle.
Definition Size_ValueTuple.cs:7
The class defining termination criteria for iterative algorithms.
Definition TermCriteria_ValueTuple.cs:8
const int CALIB_CB_FAST_CHECK
C++: enum <unnamed>
Definition Objdetect.cs:36
static void drawChessboardCorners(Mat image, Size patternSize, MatOfPoint2f corners, bool patternWasFound)
Renders the detected chessboard corners.
Definition Objdetect.cs:772
const int CALIB_CB_ADAPTIVE_THRESH
C++: enum <unnamed>
Definition Objdetect.cs:21
const int CALIB_CB_NORMALIZE_IMAGE
C++: enum <unnamed>
Definition Objdetect.cs:26
static bool findChessboardCorners(Mat image, Size patternSize, MatOfPoint2f corners, int flags)
Finds the positions of internal corners of the chessboard.
Definition Objdetect.cs:297
Note
The function requires white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environments. Otherwise, if there is no border and the background is dark, the outer black squares cannot be segmented properly and so the square grouping and ordering algorithm fails.

Use the generate_pattern.py Python script (tutorial_camera_calibration_pattern) to create the desired checkerboard pattern.

◆ findChessboardCorners() [2/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCorners ( Mat image,
in Vec2d patternSize,
MatOfPoint2f corners,
int flags )
static

Finds the positions of internal corners of the chessboard.

Parameters
imageSource chessboard view. It must be an 8-bit grayscale or color image.
patternSizeNumber of inner corners per a chessboard row and column ( patternSize = cv::Size(points_per_row,points_per_column) = cv::Size(columns,rows) ).
cornersOutput array of detected corners.
flagsVarious operation flags that can be zero or a combination of the following values:
  • CALIB_CB_ADAPTIVE_THRESH Use adaptive thresholding to convert the image to black and white, rather than a fixed threshold level (computed from the average image brightness).
  • CALIB_CB_NORMALIZE_IMAGE Normalize the image gamma with equalizeHist before applying fixed or adaptive thresholding.
  • CALIB_CB_FILTER_QUADS Use additional criteria (like contour area, perimeter, square-like shape) to filter out false quads extracted at the contour retrieval stage.
  • CALIB_CB_FAST_CHECK Run a fast check on the image that looks for chessboard corners, and shortcut the call if none is found. This can drastically speed up the call in the degenerate condition when no chessboard is observed.
  • CALIB_CB_PLAIN All other flags are ignored. The input image is taken as is. No image processing is done to improve to find the checkerboard. This has the effect of speeding up the execution of the function but could lead to not recognizing the checkerboard if the image is not previously binarized in the appropriate manner.
Returns
True if all of the corners are found and placed in a certain order (row by row, left to right in every row). Otherwise, if the function fails to find all the corners or reorder them, it returns false.

The function attempts to determine whether the input image is a view of the chessboard pattern and locate the internal chessboard corners. For example, a regular chessboard has 8 x 8 squares and 7 x 7 internal corners, that is, points where the black squares touch each other. The detected coordinates are approximate, and to determine their positions more accurately, the function calls #cornerSubPix. You also may use the function #cornerSubPix with different parameters if returned coordinates are not accurate enough.

Sample usage of detecting and drawing chessboard corners: :

Size patternsize(8,6); //interior number of corners
Mat gray = ....; //source image
vector<Point2f> corners; //this will be filled by the detected corners
//CALIB_CB_FAST_CHECK saves a lot of time on images
//that do not contain any chessboard corners
bool patternfound = findChessboardCorners(gray, patternsize, corners,
if(patternfound)
cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1),
TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
drawChessboardCorners(img, patternsize, Mat(corners), patternfound);
Note
The function requires white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environments. Otherwise, if there is no border and the background is dark, the outer black squares cannot be segmented properly and so the square grouping and ordering algorithm fails.

Use the generate_pattern.py Python script (tutorial_camera_calibration_pattern) to create the desired checkerboard pattern.

◆ findChessboardCorners() [3/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCorners ( Mat image,
in(double width, double height) patternSize,
MatOfPoint2f corners )
static

Finds the positions of internal corners of the chessboard.

Parameters
imageSource chessboard view. It must be an 8-bit grayscale or color image.
patternSizeNumber of inner corners per a chessboard row and column ( patternSize = cv::Size(points_per_row,points_per_column) = cv::Size(columns,rows) ).
cornersOutput array of detected corners.
flagsVarious operation flags that can be zero or a combination of the following values:
  • CALIB_CB_ADAPTIVE_THRESH Use adaptive thresholding to convert the image to black and white, rather than a fixed threshold level (computed from the average image brightness).
  • CALIB_CB_NORMALIZE_IMAGE Normalize the image gamma with equalizeHist before applying fixed or adaptive thresholding.
  • CALIB_CB_FILTER_QUADS Use additional criteria (like contour area, perimeter, square-like shape) to filter out false quads extracted at the contour retrieval stage.
  • CALIB_CB_FAST_CHECK Run a fast check on the image that looks for chessboard corners, and shortcut the call if none is found. This can drastically speed up the call in the degenerate condition when no chessboard is observed.
  • CALIB_CB_PLAIN All other flags are ignored. The input image is taken as is. No image processing is done to improve to find the checkerboard. This has the effect of speeding up the execution of the function but could lead to not recognizing the checkerboard if the image is not previously binarized in the appropriate manner.
Returns
True if all of the corners are found and placed in a certain order (row by row, left to right in every row). Otherwise, if the function fails to find all the corners or reorder them, it returns false.

The function attempts to determine whether the input image is a view of the chessboard pattern and locate the internal chessboard corners. For example, a regular chessboard has 8 x 8 squares and 7 x 7 internal corners, that is, points where the black squares touch each other. The detected coordinates are approximate, and to determine their positions more accurately, the function calls #cornerSubPix. You also may use the function #cornerSubPix with different parameters if returned coordinates are not accurate enough.

Sample usage of detecting and drawing chessboard corners: :

Size patternsize(8,6); //interior number of corners
Mat gray = ....; //source image
vector<Point2f> corners; //this will be filled by the detected corners
//CALIB_CB_FAST_CHECK saves a lot of time on images
//that do not contain any chessboard corners
bool patternfound = findChessboardCorners(gray, patternsize, corners,
if(patternfound)
cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1),
TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
drawChessboardCorners(img, patternsize, Mat(corners), patternfound);
Note
The function requires white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environments. Otherwise, if there is no border and the background is dark, the outer black squares cannot be segmented properly and so the square grouping and ordering algorithm fails.

Use the generate_pattern.py Python script (tutorial_camera_calibration_pattern) to create the desired checkerboard pattern.

◆ findChessboardCorners() [4/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCorners ( Mat image,
in(double width, double height) patternSize,
MatOfPoint2f corners,
int flags )
static

Finds the positions of internal corners of the chessboard.

Parameters
imageSource chessboard view. It must be an 8-bit grayscale or color image.
patternSizeNumber of inner corners per a chessboard row and column ( patternSize = cv::Size(points_per_row,points_per_column) = cv::Size(columns,rows) ).
cornersOutput array of detected corners.
flagsVarious operation flags that can be zero or a combination of the following values:
  • CALIB_CB_ADAPTIVE_THRESH Use adaptive thresholding to convert the image to black and white, rather than a fixed threshold level (computed from the average image brightness).
  • CALIB_CB_NORMALIZE_IMAGE Normalize the image gamma with equalizeHist before applying fixed or adaptive thresholding.
  • CALIB_CB_FILTER_QUADS Use additional criteria (like contour area, perimeter, square-like shape) to filter out false quads extracted at the contour retrieval stage.
  • CALIB_CB_FAST_CHECK Run a fast check on the image that looks for chessboard corners, and shortcut the call if none is found. This can drastically speed up the call in the degenerate condition when no chessboard is observed.
  • CALIB_CB_PLAIN All other flags are ignored. The input image is taken as is. No image processing is done to improve to find the checkerboard. This has the effect of speeding up the execution of the function but could lead to not recognizing the checkerboard if the image is not previously binarized in the appropriate manner.
Returns
True if all of the corners are found and placed in a certain order (row by row, left to right in every row). Otherwise, if the function fails to find all the corners or reorder them, it returns false.

The function attempts to determine whether the input image is a view of the chessboard pattern and locate the internal chessboard corners. For example, a regular chessboard has 8 x 8 squares and 7 x 7 internal corners, that is, points where the black squares touch each other. The detected coordinates are approximate, and to determine their positions more accurately, the function calls #cornerSubPix. You also may use the function #cornerSubPix with different parameters if returned coordinates are not accurate enough.

Sample usage of detecting and drawing chessboard corners: :

Size patternsize(8,6); //interior number of corners
Mat gray = ....; //source image
vector<Point2f> corners; //this will be filled by the detected corners
//CALIB_CB_FAST_CHECK saves a lot of time on images
//that do not contain any chessboard corners
bool patternfound = findChessboardCorners(gray, patternsize, corners,
if(patternfound)
cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1),
TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
drawChessboardCorners(img, patternsize, Mat(corners), patternfound);
Note
The function requires white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environments. Otherwise, if there is no border and the background is dark, the outer black squares cannot be segmented properly and so the square grouping and ordering algorithm fails.

Use the generate_pattern.py Python script (tutorial_camera_calibration_pattern) to create the desired checkerboard pattern.

◆ findChessboardCorners() [5/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCorners ( Mat image,
Size patternSize,
MatOfPoint2f corners )
static

Finds the positions of internal corners of the chessboard.

Parameters
imageSource chessboard view. It must be an 8-bit grayscale or color image.
patternSizeNumber of inner corners per a chessboard row and column ( patternSize = cv::Size(points_per_row,points_per_column) = cv::Size(columns,rows) ).
cornersOutput array of detected corners.
flagsVarious operation flags that can be zero or a combination of the following values:
  • CALIB_CB_ADAPTIVE_THRESH Use adaptive thresholding to convert the image to black and white, rather than a fixed threshold level (computed from the average image brightness).
  • CALIB_CB_NORMALIZE_IMAGE Normalize the image gamma with equalizeHist before applying fixed or adaptive thresholding.
  • CALIB_CB_FILTER_QUADS Use additional criteria (like contour area, perimeter, square-like shape) to filter out false quads extracted at the contour retrieval stage.
  • CALIB_CB_FAST_CHECK Run a fast check on the image that looks for chessboard corners, and shortcut the call if none is found. This can drastically speed up the call in the degenerate condition when no chessboard is observed.
  • CALIB_CB_PLAIN All other flags are ignored. The input image is taken as is. No image processing is done to improve to find the checkerboard. This has the effect of speeding up the execution of the function but could lead to not recognizing the checkerboard if the image is not previously binarized in the appropriate manner.
Returns
True if all of the corners are found and placed in a certain order (row by row, left to right in every row). Otherwise, if the function fails to find all the corners or reorder them, it returns false.

The function attempts to determine whether the input image is a view of the chessboard pattern and locate the internal chessboard corners. For example, a regular chessboard has 8 x 8 squares and 7 x 7 internal corners, that is, points where the black squares touch each other. The detected coordinates are approximate, and to determine their positions more accurately, the function calls #cornerSubPix. You also may use the function #cornerSubPix with different parameters if returned coordinates are not accurate enough.

Sample usage of detecting and drawing chessboard corners: :

Size patternsize(8,6); //interior number of corners
Mat gray = ....; //source image
vector<Point2f> corners; //this will be filled by the detected corners
//CALIB_CB_FAST_CHECK saves a lot of time on images
//that do not contain any chessboard corners
bool patternfound = findChessboardCorners(gray, patternsize, corners,
if(patternfound)
cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1),
TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
drawChessboardCorners(img, patternsize, Mat(corners), patternfound);
Note
The function requires white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environments. Otherwise, if there is no border and the background is dark, the outer black squares cannot be segmented properly and so the square grouping and ordering algorithm fails.

Use the generate_pattern.py Python script (tutorial_camera_calibration_pattern) to create the desired checkerboard pattern.

◆ findChessboardCorners() [6/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCorners ( Mat image,
Size patternSize,
MatOfPoint2f corners,
int flags )
static

Finds the positions of internal corners of the chessboard.

Parameters
imageSource chessboard view. It must be an 8-bit grayscale or color image.
patternSizeNumber of inner corners per a chessboard row and column ( patternSize = cv::Size(points_per_row,points_per_column) = cv::Size(columns,rows) ).
cornersOutput array of detected corners.
flagsVarious operation flags that can be zero or a combination of the following values:
  • CALIB_CB_ADAPTIVE_THRESH Use adaptive thresholding to convert the image to black and white, rather than a fixed threshold level (computed from the average image brightness).
  • CALIB_CB_NORMALIZE_IMAGE Normalize the image gamma with equalizeHist before applying fixed or adaptive thresholding.
  • CALIB_CB_FILTER_QUADS Use additional criteria (like contour area, perimeter, square-like shape) to filter out false quads extracted at the contour retrieval stage.
  • CALIB_CB_FAST_CHECK Run a fast check on the image that looks for chessboard corners, and shortcut the call if none is found. This can drastically speed up the call in the degenerate condition when no chessboard is observed.
  • CALIB_CB_PLAIN All other flags are ignored. The input image is taken as is. No image processing is done to improve to find the checkerboard. This has the effect of speeding up the execution of the function but could lead to not recognizing the checkerboard if the image is not previously binarized in the appropriate manner.
Returns
True if all of the corners are found and placed in a certain order (row by row, left to right in every row). Otherwise, if the function fails to find all the corners or reorder them, it returns false.

The function attempts to determine whether the input image is a view of the chessboard pattern and locate the internal chessboard corners. For example, a regular chessboard has 8 x 8 squares and 7 x 7 internal corners, that is, points where the black squares touch each other. The detected coordinates are approximate, and to determine their positions more accurately, the function calls #cornerSubPix. You also may use the function #cornerSubPix with different parameters if returned coordinates are not accurate enough.

Sample usage of detecting and drawing chessboard corners: :

Size patternsize(8,6); //interior number of corners
Mat gray = ....; //source image
vector<Point2f> corners; //this will be filled by the detected corners
//CALIB_CB_FAST_CHECK saves a lot of time on images
//that do not contain any chessboard corners
bool patternfound = findChessboardCorners(gray, patternsize, corners,
if(patternfound)
cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1),
TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
drawChessboardCorners(img, patternsize, Mat(corners), patternfound);
Note
The function requires white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environments. Otherwise, if there is no border and the background is dark, the outer black squares cannot be segmented properly and so the square grouping and ordering algorithm fails.

Use the generate_pattern.py Python script (tutorial_camera_calibration_pattern) to create the desired checkerboard pattern.

◆ findChessboardCornersSB() [1/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCornersSB ( Mat image,
in Vec2d patternSize,
Mat corners )
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ findChessboardCornersSB() [2/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCornersSB ( Mat image,
in Vec2d patternSize,
Mat corners,
int flags )
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ findChessboardCornersSB() [3/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCornersSB ( Mat image,
in(double width, double height) patternSize,
Mat corners )
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ findChessboardCornersSB() [4/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCornersSB ( Mat image,
in(double width, double height) patternSize,
Mat corners,
int flags )
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ findChessboardCornersSB() [5/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCornersSB ( Mat image,
Size patternSize,
Mat corners )
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ findChessboardCornersSB() [6/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCornersSB ( Mat image,
Size patternSize,
Mat corners,
int flags )
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ findChessboardCornersSBWithMeta() [1/3]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCornersSBWithMeta ( Mat image,
in Vec2d patternSize,
Mat corners,
int flags,
Mat meta )
static

Finds the positions of internal corners of the chessboard using a sector based approach.

Parameters
imageSource chessboard view. It must be an 8-bit grayscale or color image.
patternSizeNumber of inner corners per a chessboard row and column ( patternSize = cv::Size(points_per_row,points_per_column) = cv::Size(columns,rows) ).
cornersOutput array of detected corners.
flagsVarious operation flags that can be zero or a combination of the following values:
  • CALIB_CB_NORMALIZE_IMAGE Normalize the image gamma with equalizeHist before detection.
  • CALIB_CB_EXHAUSTIVE Run an exhaustive search to improve detection rate.
  • CALIB_CB_ACCURACY Up sample input image to improve sub-pixel accuracy due to aliasing effects.
  • CALIB_CB_LARGER The detected pattern is allowed to be larger than patternSize (see description).
  • CALIB_CB_MARKER The detected pattern must have a marker (see description). This should be used if an accurate camera calibration is required.
metaOptional output array of detected corners (CV_8UC1 and size = cv::Size(columns,rows)). Each entry stands for one corner of the pattern and can have one of the following values:
  • 0 = no meta data attached
  • 1 = left-top corner of a black cell
  • 2 = left-top corner of a white cell
  • 3 = left-top corner of a black cell with a white marker dot
  • 4 = left-top corner of a white cell with a black marker dot (pattern origin in case of markers otherwise first corner)

The function is analog to findChessboardCorners but uses a localized radon transformation approximated by box filters being more robust to all sort of noise, faster on larger images and is able to directly return the sub-pixel position of the internal chessboard corners. The Method is based on the paper [duda2018] "Accurate Detection and Localization of Checkerboard Corners for Calibration" demonstrating that the returned sub-pixel positions are more accurate than the one returned by cornerSubPix allowing a precise camera calibration for demanding applications.

In the case, the flags CALIB_CB_LARGER or CALIB_CB_MARKER are given, the result can be recovered from the optional meta array. Both flags are helpful to use calibration patterns exceeding the field of view of the camera. These oversized patterns allow more accurate calibrations as corners can be utilized, which are as close as possible to the image borders. For a consistent coordinate system across all images, the optional marker (see image below) can be used to move the origin of the board to the location where the black circle is located.

Note
The function requires a white boarder with roughly the same width as one of the checkerboard fields around the whole board to improve the detection in various environments. In addition, because of the localized radon transformation it is beneficial to use round corners for the field corners which are located on the outside of the board. The following figure illustrates a sample checkerboard optimized for the detection. However, any other checkerboard can be used as well.

Use the generate_pattern.py Python script (tutorial_camera_calibration_pattern) to create the corresponding checkerboard pattern:

◆ findChessboardCornersSBWithMeta() [2/3]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCornersSBWithMeta ( Mat image,
in(double width, double height) patternSize,
Mat corners,
int flags,
Mat meta )
static

Finds the positions of internal corners of the chessboard using a sector based approach.

Parameters
imageSource chessboard view. It must be an 8-bit grayscale or color image.
patternSizeNumber of inner corners per a chessboard row and column ( patternSize = cv::Size(points_per_row,points_per_column) = cv::Size(columns,rows) ).
cornersOutput array of detected corners.
flagsVarious operation flags that can be zero or a combination of the following values:
  • CALIB_CB_NORMALIZE_IMAGE Normalize the image gamma with equalizeHist before detection.
  • CALIB_CB_EXHAUSTIVE Run an exhaustive search to improve detection rate.
  • CALIB_CB_ACCURACY Up sample input image to improve sub-pixel accuracy due to aliasing effects.
  • CALIB_CB_LARGER The detected pattern is allowed to be larger than patternSize (see description).
  • CALIB_CB_MARKER The detected pattern must have a marker (see description). This should be used if an accurate camera calibration is required.
metaOptional output array of detected corners (CV_8UC1 and size = cv::Size(columns,rows)). Each entry stands for one corner of the pattern and can have one of the following values:
  • 0 = no meta data attached
  • 1 = left-top corner of a black cell
  • 2 = left-top corner of a white cell
  • 3 = left-top corner of a black cell with a white marker dot
  • 4 = left-top corner of a white cell with a black marker dot (pattern origin in case of markers otherwise first corner)

The function is analog to findChessboardCorners but uses a localized radon transformation approximated by box filters being more robust to all sort of noise, faster on larger images and is able to directly return the sub-pixel position of the internal chessboard corners. The Method is based on the paper [duda2018] "Accurate Detection and Localization of Checkerboard Corners for Calibration" demonstrating that the returned sub-pixel positions are more accurate than the one returned by cornerSubPix allowing a precise camera calibration for demanding applications.

In the case, the flags CALIB_CB_LARGER or CALIB_CB_MARKER are given, the result can be recovered from the optional meta array. Both flags are helpful to use calibration patterns exceeding the field of view of the camera. These oversized patterns allow more accurate calibrations as corners can be utilized, which are as close as possible to the image borders. For a consistent coordinate system across all images, the optional marker (see image below) can be used to move the origin of the board to the location where the black circle is located.

Note
The function requires a white boarder with roughly the same width as one of the checkerboard fields around the whole board to improve the detection in various environments. In addition, because of the localized radon transformation it is beneficial to use round corners for the field corners which are located on the outside of the board. The following figure illustrates a sample checkerboard optimized for the detection. However, any other checkerboard can be used as well.

Use the generate_pattern.py Python script (tutorial_camera_calibration_pattern) to create the corresponding checkerboard pattern:

◆ findChessboardCornersSBWithMeta() [3/3]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findChessboardCornersSBWithMeta ( Mat image,
Size patternSize,
Mat corners,
int flags,
Mat meta )
static

Finds the positions of internal corners of the chessboard using a sector based approach.

Parameters
imageSource chessboard view. It must be an 8-bit grayscale or color image.
patternSizeNumber of inner corners per a chessboard row and column ( patternSize = cv::Size(points_per_row,points_per_column) = cv::Size(columns,rows) ).
cornersOutput array of detected corners.
flagsVarious operation flags that can be zero or a combination of the following values:
  • CALIB_CB_NORMALIZE_IMAGE Normalize the image gamma with equalizeHist before detection.
  • CALIB_CB_EXHAUSTIVE Run an exhaustive search to improve detection rate.
  • CALIB_CB_ACCURACY Up sample input image to improve sub-pixel accuracy due to aliasing effects.
  • CALIB_CB_LARGER The detected pattern is allowed to be larger than patternSize (see description).
  • CALIB_CB_MARKER The detected pattern must have a marker (see description). This should be used if an accurate camera calibration is required.
metaOptional output array of detected corners (CV_8UC1 and size = cv::Size(columns,rows)). Each entry stands for one corner of the pattern and can have one of the following values:
  • 0 = no meta data attached
  • 1 = left-top corner of a black cell
  • 2 = left-top corner of a white cell
  • 3 = left-top corner of a black cell with a white marker dot
  • 4 = left-top corner of a white cell with a black marker dot (pattern origin in case of markers otherwise first corner)

The function is analog to findChessboardCorners but uses a localized radon transformation approximated by box filters being more robust to all sort of noise, faster on larger images and is able to directly return the sub-pixel position of the internal chessboard corners. The Method is based on the paper [duda2018] "Accurate Detection and Localization of Checkerboard Corners for Calibration" demonstrating that the returned sub-pixel positions are more accurate than the one returned by cornerSubPix allowing a precise camera calibration for demanding applications.

In the case, the flags CALIB_CB_LARGER or CALIB_CB_MARKER are given, the result can be recovered from the optional meta array. Both flags are helpful to use calibration patterns exceeding the field of view of the camera. These oversized patterns allow more accurate calibrations as corners can be utilized, which are as close as possible to the image borders. For a consistent coordinate system across all images, the optional marker (see image below) can be used to move the origin of the board to the location where the black circle is located.

Note
The function requires a white boarder with roughly the same width as one of the checkerboard fields around the whole board to improve the detection in various environments. In addition, because of the localized radon transformation it is beneficial to use round corners for the field corners which are located on the outside of the board. The following figure illustrates a sample checkerboard optimized for the detection. However, any other checkerboard can be used as well.

Use the generate_pattern.py Python script (tutorial_camera_calibration_pattern) to create the corresponding checkerboard pattern:

◆ findCirclesGrid() [1/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findCirclesGrid ( Mat image,
in Vec2d patternSize,
Mat centers )
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ findCirclesGrid() [2/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findCirclesGrid ( Mat image,
in Vec2d patternSize,
Mat centers,
int flags )
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ findCirclesGrid() [3/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findCirclesGrid ( Mat image,
in(double width, double height) patternSize,
Mat centers )
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ findCirclesGrid() [4/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findCirclesGrid ( Mat image,
in(double width, double height) patternSize,
Mat centers,
int flags )
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ findCirclesGrid() [5/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findCirclesGrid ( Mat image,
Size patternSize,
Mat centers )
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ findCirclesGrid() [6/6]

static bool OpenCVForUnity.ObjdetectModule.Objdetect.findCirclesGrid ( Mat image,
Size patternSize,
Mat centers,
int flags )
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ generateImageMarker() [1/2]

static void OpenCVForUnity.ObjdetectModule.Objdetect.generateImageMarker ( Dictionary dictionary,
int id,
int sidePixels,
Mat img )
static

Generate a canonical marker image.

Parameters
dictionarydictionary of markers indicating the type of markers
ididentifier of the marker that will be returned. It has to be a valid id in the specified dictionary.
sidePixelssize of the image in pixels
imgoutput image with the marker
borderBitswidth of the marker border.

This function returns a marker image in its canonical form (i.e. ready to be printed)

◆ generateImageMarker() [2/2]

static void OpenCVForUnity.ObjdetectModule.Objdetect.generateImageMarker ( Dictionary dictionary,
int id,
int sidePixels,
Mat img,
int borderBits )
static

Generate a canonical marker image.

Parameters
dictionarydictionary of markers indicating the type of markers
ididentifier of the marker that will be returned. It has to be a valid id in the specified dictionary.
sidePixelssize of the image in pixels
imgoutput image with the marker
borderBitswidth of the marker border.

This function returns a marker image in its canonical form (i.e. ready to be printed)

◆ getPredefinedDictionary()

static Dictionary OpenCVForUnity.ObjdetectModule.Objdetect.getPredefinedDictionary ( int dict)
static

Returns one of the predefined dictionaries referenced by DICT_*.

Member Data Documentation

◆ CALIB_CB_ACCURACY

const int OpenCVForUnity.ObjdetectModule.Objdetect.CALIB_CB_ACCURACY = 32
static

C++: enum <unnamed>

◆ CALIB_CB_ADAPTIVE_THRESH

const int OpenCVForUnity.ObjdetectModule.Objdetect.CALIB_CB_ADAPTIVE_THRESH = 1
static

C++: enum <unnamed>

◆ CALIB_CB_ASYMMETRIC_GRID

const int OpenCVForUnity.ObjdetectModule.Objdetect.CALIB_CB_ASYMMETRIC_GRID = 2
static

C++: enum <unnamed>

◆ CALIB_CB_CLUSTERING

const int OpenCVForUnity.ObjdetectModule.Objdetect.CALIB_CB_CLUSTERING = 4
static

C++: enum <unnamed>

◆ CALIB_CB_EXHAUSTIVE

const int OpenCVForUnity.ObjdetectModule.Objdetect.CALIB_CB_EXHAUSTIVE = 16
static

C++: enum <unnamed>

◆ CALIB_CB_FAST_CHECK

const int OpenCVForUnity.ObjdetectModule.Objdetect.CALIB_CB_FAST_CHECK = 8
static

C++: enum <unnamed>

◆ CALIB_CB_FILTER_QUADS

const int OpenCVForUnity.ObjdetectModule.Objdetect.CALIB_CB_FILTER_QUADS = 4
static

C++: enum <unnamed>

◆ CALIB_CB_LARGER

const int OpenCVForUnity.ObjdetectModule.Objdetect.CALIB_CB_LARGER = 64
static

C++: enum <unnamed>

◆ CALIB_CB_MARKER

const int OpenCVForUnity.ObjdetectModule.Objdetect.CALIB_CB_MARKER = 128
static

C++: enum <unnamed>

◆ CALIB_CB_NORMALIZE_IMAGE

const int OpenCVForUnity.ObjdetectModule.Objdetect.CALIB_CB_NORMALIZE_IMAGE = 2
static

C++: enum <unnamed>

◆ CALIB_CB_PLAIN

const int OpenCVForUnity.ObjdetectModule.Objdetect.CALIB_CB_PLAIN = 256
static

C++: enum <unnamed>

◆ CALIB_CB_SYMMETRIC_GRID

const int OpenCVForUnity.ObjdetectModule.Objdetect.CALIB_CB_SYMMETRIC_GRID = 1
static

C++: enum <unnamed>

◆ CORNER_REFINE_APRILTAG

const int OpenCVForUnity.ObjdetectModule.Objdetect.CORNER_REFINE_APRILTAG = 3
static

C++: enum CornerRefineMethod (cv.aruco.CornerRefineMethod)

◆ CORNER_REFINE_CONTOUR

const int OpenCVForUnity.ObjdetectModule.Objdetect.CORNER_REFINE_CONTOUR = 2
static

C++: enum CornerRefineMethod (cv.aruco.CornerRefineMethod)

◆ CORNER_REFINE_NONE

const int OpenCVForUnity.ObjdetectModule.Objdetect.CORNER_REFINE_NONE = 0
static

C++: enum CornerRefineMethod (cv.aruco.CornerRefineMethod)

◆ CORNER_REFINE_SUBPIX

const int OpenCVForUnity.ObjdetectModule.Objdetect.CORNER_REFINE_SUBPIX = 1
static

C++: enum CornerRefineMethod (cv.aruco.CornerRefineMethod)

◆ DICT_4X4_100

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_4X4_100 = 0 + 1
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_4X4_1000

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_4X4_1000 = 0 + 3
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_4X4_250

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_4X4_250 = 0 + 2
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_4X4_50

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_4X4_50 = 0
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_5X5_100

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_5X5_100 = 0 + 5
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_5X5_1000

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_5X5_1000 = 0 + 7
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_5X5_250

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_5X5_250 = 0 + 6
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_5X5_50

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_5X5_50 = 0 + 4
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_6X6_100

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_6X6_100 = 0 + 9
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_6X6_1000

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_6X6_1000 = 0 + 11
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_6X6_250

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_6X6_250 = 0 + 10
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_6X6_50

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_6X6_50 = 0 + 8
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_7X7_100

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_7X7_100 = 0 + 13
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_7X7_1000

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_7X7_1000 = 0 + 15
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_7X7_250

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_7X7_250 = 0 + 14
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_7X7_50

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_7X7_50 = 0 + 12
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_APRILTAG_16h5

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_APRILTAG_16h5 = 0 + 17
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_APRILTAG_25h9

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_APRILTAG_25h9 = 0 + 18
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_APRILTAG_36h10

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_APRILTAG_36h10 = 0 + 19
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_APRILTAG_36h11

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_APRILTAG_36h11 = 0 + 20
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_ARUCO_MIP_36h12

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_ARUCO_MIP_36h12 = 0 + 21
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ DICT_ARUCO_ORIGINAL

const int OpenCVForUnity.ObjdetectModule.Objdetect.DICT_ARUCO_ORIGINAL = 0 + 16
static

C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)

◆ MCC24

const int OpenCVForUnity.ObjdetectModule.Objdetect.MCC24 = 0
static

C++: enum ColorChart (cv.mcc.ColorChart)

◆ SG140

const int OpenCVForUnity.ObjdetectModule.Objdetect.SG140 = 0 + 1
static

C++: enum ColorChart (cv.mcc.ColorChart)

◆ v0

static double OpenCVForUnity.ObjdetectModule.Objdetect.v0
static

Estimates the sharpness of a detected chessboard.

Image sharpness, as well as brightness, are a critical parameter for accuracte camera calibration. For accessing these parameters for filtering out problematic calibraiton images, this method calculates edge profiles by traveling from black to white chessboard cell centers. Based on this, the number of pixels is calculated required to transit from black to white. This width of the transition area is a good indication of how sharp the chessboard is imaged and should be below ~3.0 pixels.

Parameters
imageGray image used to find chessboard corners
patternSizeSize of a found chessboard pattern
cornersCorners found by findChessboardCornersSB
rise_distanceRise distance 0.8 means 10% ... 90% of the final signal strength
verticalBy default edge responses for horizontal lines are calculated
sharpnessOptional output array with a sharpness value for calculated edge responses (see description)

The optional sharpness array is of type CV_32FC1 and has for each calculated profile one row with the following five entries: 0 = x coordinate of the underlying edge in the image 1 = y coordinate of the underlying edge in the image 2 = width of the transition area (sharpness) 3 = signal strength in the black cell (min brightness) 4 = signal strength in the white cell (max brightness)

Returns
Scalar(average sharpness, average min brightness, average max brightness,0)

◆ v1

static double double OpenCVForUnity.ObjdetectModule.Objdetect.v1
static

◆ v2

static double double double OpenCVForUnity.ObjdetectModule.Objdetect.v2
static

◆ VINYL18

const int OpenCVForUnity.ObjdetectModule.Objdetect.VINYL18 = 0 + 2
static

C++: enum ColorChart (cv.mcc.ColorChart)


The documentation for this class was generated from the following files: