public class Objdetect extends Object
Constructor and Description |
---|
Objdetect() |
Modifier and Type | Method and Description |
---|---|
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,
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,
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,
Scalar borderColor)
Draw detected markers in image
|
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 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 void |
groupRectangles(MatOfRect rectList,
MatOfInt weights,
int groupThreshold) |
static void |
groupRectangles(MatOfRect rectList,
MatOfInt weights,
int groupThreshold,
double eps) |
public static final int CASCADE_DO_CANNY_PRUNING
public static final int CASCADE_SCALE_IMAGE
public static final int CASCADE_FIND_BIGGEST_OBJECT
public static final int CASCADE_DO_ROUGH_SEARCH
public static final int DetectionBasedTracker_DETECTED_NOT_SHOWN_YET
public static final int DetectionBasedTracker_DETECTED
public static final int DetectionBasedTracker_DETECTED_TEMPORARY_LOST
public static final int DetectionBasedTracker_WRONG_OBJECT
public static final int CORNER_REFINE_NONE
public static final int CORNER_REFINE_SUBPIX
public static final int CORNER_REFINE_CONTOUR
public static final int CORNER_REFINE_APRILTAG
public static final int DICT_4X4_50
public static final int DICT_4X4_100
public static final int DICT_4X4_250
public static final int DICT_4X4_1000
public static final int DICT_5X5_50
public static final int DICT_5X5_100
public static final int DICT_5X5_250
public static final int DICT_5X5_1000
public static final int DICT_6X6_50
public static final int DICT_6X6_100
public static final int DICT_6X6_250
public static final int DICT_6X6_1000
public static final int DICT_7X7_50
public static final int DICT_7X7_100
public static final int DICT_7X7_250
public static final int DICT_7X7_1000
public static final int DICT_ARUCO_ORIGINAL
public static final int DICT_APRILTAG_16h5
public static final int DICT_APRILTAG_25h9
public static final int DICT_APRILTAG_36h10
public static final int DICT_APRILTAG_36h11
public static final int DICT_ARUCO_MIP_36h12
public static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold, double eps)
public static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold)
public static void drawDetectedMarkers(Mat image, List<Mat> corners, Mat ids, Scalar borderColor)
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.public static void drawDetectedMarkers(Mat image, List<Mat> corners, Mat ids)
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.public static void drawDetectedMarkers(Mat image, List<Mat> corners)
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.public static void generateImageMarker(Dictionary dictionary, int id, int sidePixels, Mat img, int borderBits)
dictionary
- dictionary of markers indicating the type of markersid
- 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 pixelsimg
- output image with the markerborderBits
- width of the marker border.
This function returns a marker image in its canonical form (i.e. ready to be printed)public static void generateImageMarker(Dictionary dictionary, int id, int sidePixels, Mat img)
dictionary
- dictionary of markers indicating the type of markersid
- 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 pixelsimg
- output image with the marker
This function returns a marker image in its canonical form (i.e. ready to be printed)public static Dictionary getPredefinedDictionary(int dict)
dict
- automatically generatedpublic static Dictionary extendDictionary(int nMarkers, int markerSize, Dictionary baseDictionary, int randomSeed)
nMarkers
- number of markers in the dictionarymarkerSize
- number of bits per dimension of each markersbaseDictionary
- 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.public static Dictionary extendDictionary(int nMarkers, int markerSize, Dictionary baseDictionary)
nMarkers
- number of markers in the dictionarymarkerSize
- number of bits per dimension of each markersbaseDictionary
- 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.public static Dictionary extendDictionary(int nMarkers, int markerSize)
nMarkers
- number of markers in the dictionarymarkerSize
- number of bits per dimension of each markers
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.public static void drawDetectedCornersCharuco(Mat image, Mat charucoCorners, Mat charucoIds, Scalar cornerColor)
image
- input/output image. It must have 1 or 3 channels. The number of channels is not
altered.charucoCorners
- vector of detected charuco cornerscharucoIds
- list of identifiers for each corner in charucoCornerscornerColor
- 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.public static void drawDetectedCornersCharuco(Mat image, Mat charucoCorners, Mat charucoIds)
image
- input/output image. It must have 1 or 3 channels. The number of channels is not
altered.charucoCorners
- vector of detected charuco cornerscharucoIds
- 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.public static void drawDetectedCornersCharuco(Mat image, Mat charucoCorners)
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.public static void drawDetectedDiamonds(Mat image, List<Mat> diamondCorners, Mat diamondIds, Scalar borderColor)
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.public static void drawDetectedDiamonds(Mat image, List<Mat> diamondCorners, Mat diamondIds)
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.public static void drawDetectedDiamonds(Mat image, List<Mat> diamondCorners)
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.Copyright © 2024. All rights reserved.