Package org.opencv.objdetect
Class Objdetect
- java.lang.Object
- 
- org.opencv.objdetect.Objdetect
 
- 
 public class Objdetect extends java.lang.Object
- 
- 
Field Summary
 - 
Constructor SummaryConstructors Constructor Description Objdetect()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddrawDetectedCornersCharuco(Mat image, Mat charucoCorners)Draws a set of Charuco cornersstatic voiddrawDetectedCornersCharuco(Mat image, Mat charucoCorners, Mat charucoIds)Draws a set of Charuco cornersstatic voiddrawDetectedCornersCharuco(Mat image, Mat charucoCorners, Mat charucoIds, Scalar cornerColor)Draws a set of Charuco cornersstatic voiddrawDetectedDiamonds(Mat image, java.util.List<Mat> diamondCorners)Draw a set of detected ChArUco Diamond markersstatic voiddrawDetectedDiamonds(Mat image, java.util.List<Mat> diamondCorners, Mat diamondIds)Draw a set of detected ChArUco Diamond markersstatic voiddrawDetectedDiamonds(Mat image, java.util.List<Mat> diamondCorners, Mat diamondIds, Scalar borderColor)Draw a set of detected ChArUco Diamond markersstatic voiddrawDetectedMarkers(Mat image, java.util.List<Mat> corners)Draw detected markers in imagestatic voiddrawDetectedMarkers(Mat image, java.util.List<Mat> corners, Mat ids)Draw detected markers in imagestatic voiddrawDetectedMarkers(Mat image, java.util.List<Mat> corners, Mat ids, Scalar borderColor)Draw detected markers in imagestatic DictionaryextendDictionary(int nMarkers, int markerSize)Extend base dictionary by new nMarkersstatic DictionaryextendDictionary(int nMarkers, int markerSize, Dictionary baseDictionary)Extend base dictionary by new nMarkersstatic DictionaryextendDictionary(int nMarkers, int markerSize, Dictionary baseDictionary, int randomSeed)Extend base dictionary by new nMarkersstatic voidgenerateImageMarker(Dictionary dictionary, int id, int sidePixels, Mat img)Generate a canonical marker imagestatic voidgenerateImageMarker(Dictionary dictionary, int id, int sidePixels, Mat img, int borderBits)Generate a canonical marker imagestatic DictionarygetPredefinedDictionary(int dict)Returns one of the predefined dictionaries referenced by DICT_*.static voidgroupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold)static voidgroupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold, double eps)
 
- 
- 
- 
Field Detail- 
CASCADE_DO_CANNY_PRUNINGpublic static final int CASCADE_DO_CANNY_PRUNING - See Also:
- Constant Field Values
 
 - 
CASCADE_SCALE_IMAGEpublic static final int CASCADE_SCALE_IMAGE - See Also:
- Constant Field Values
 
 - 
CASCADE_FIND_BIGGEST_OBJECTpublic static final int CASCADE_FIND_BIGGEST_OBJECT - See Also:
- Constant Field Values
 
 - 
CASCADE_DO_ROUGH_SEARCHpublic static final int CASCADE_DO_ROUGH_SEARCH - See Also:
- Constant Field Values
 
 - 
DetectionBasedTracker_DETECTED_NOT_SHOWN_YETpublic static final int DetectionBasedTracker_DETECTED_NOT_SHOWN_YET - See Also:
- Constant Field Values
 
 - 
DetectionBasedTracker_DETECTEDpublic static final int DetectionBasedTracker_DETECTED - See Also:
- Constant Field Values
 
 - 
DetectionBasedTracker_DETECTED_TEMPORARY_LOSTpublic static final int DetectionBasedTracker_DETECTED_TEMPORARY_LOST - See Also:
- Constant Field Values
 
 - 
DetectionBasedTracker_WRONG_OBJECTpublic static final int DetectionBasedTracker_WRONG_OBJECT - See Also:
- Constant Field Values
 
 - 
CORNER_REFINE_NONEpublic static final int CORNER_REFINE_NONE - See Also:
- Constant Field Values
 
 - 
CORNER_REFINE_SUBPIXpublic static final int CORNER_REFINE_SUBPIX - See Also:
- Constant Field Values
 
 - 
CORNER_REFINE_CONTOURpublic static final int CORNER_REFINE_CONTOUR - See Also:
- Constant Field Values
 
 - 
CORNER_REFINE_APRILTAGpublic static final int CORNER_REFINE_APRILTAG - See Also:
- Constant Field Values
 
 - 
DICT_4X4_50public static final int DICT_4X4_50 - See Also:
- Constant Field Values
 
 - 
DICT_4X4_100public static final int DICT_4X4_100 - See Also:
- Constant Field Values
 
 - 
DICT_4X4_250public static final int DICT_4X4_250 - See Also:
- Constant Field Values
 
 - 
DICT_4X4_1000public static final int DICT_4X4_1000 - See Also:
- Constant Field Values
 
 - 
DICT_5X5_50public static final int DICT_5X5_50 - See Also:
- Constant Field Values
 
 - 
DICT_5X5_100public static final int DICT_5X5_100 - See Also:
- Constant Field Values
 
 - 
DICT_5X5_250public static final int DICT_5X5_250 - See Also:
- Constant Field Values
 
 - 
DICT_5X5_1000public static final int DICT_5X5_1000 - See Also:
- Constant Field Values
 
 - 
DICT_6X6_50public static final int DICT_6X6_50 - See Also:
- Constant Field Values
 
 - 
DICT_6X6_100public static final int DICT_6X6_100 - See Also:
- Constant Field Values
 
 - 
DICT_6X6_250public static final int DICT_6X6_250 - See Also:
- Constant Field Values
 
 - 
DICT_6X6_1000public static final int DICT_6X6_1000 - See Also:
- Constant Field Values
 
 - 
DICT_7X7_50public static final int DICT_7X7_50 - See Also:
- Constant Field Values
 
 - 
DICT_7X7_100public static final int DICT_7X7_100 - See Also:
- Constant Field Values
 
 - 
DICT_7X7_250public static final int DICT_7X7_250 - See Also:
- Constant Field Values
 
 - 
DICT_7X7_1000public static final int DICT_7X7_1000 - See Also:
- Constant Field Values
 
 - 
DICT_ARUCO_ORIGINALpublic static final int DICT_ARUCO_ORIGINAL - See Also:
- Constant Field Values
 
 - 
DICT_APRILTAG_16h5public static final int DICT_APRILTAG_16h5 - See Also:
- Constant Field Values
 
 - 
DICT_APRILTAG_25h9public static final int DICT_APRILTAG_25h9 - See Also:
- Constant Field Values
 
 - 
DICT_APRILTAG_36h10public static final int DICT_APRILTAG_36h10 - See Also:
- Constant Field Values
 
 - 
DICT_APRILTAG_36h11public static final int DICT_APRILTAG_36h11 - See Also:
- Constant Field Values
 
 - 
DICT_ARUCO_MIP_36h12public static final int DICT_ARUCO_MIP_36h12 - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
groupRectanglespublic static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold, double eps) 
 - 
groupRectanglespublic static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold) 
 - 
drawDetectedMarkerspublic static void drawDetectedMarkers(Mat image, java.util.List<Mat> corners, Mat ids, Scalar borderColor) Draw detected markers in image- Parameters:
- image- input/output image. It must have 1 or 3 channels. The number of channels is not altered.
- corners- positions of marker corners on input image. (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.
- ids- vector of identifiers for markers in markersCorners . Optional, if not provided, ids are not painted.
- borderColor- color of marker borders. Rest of colors (text color and first corner color) are calculated based on this one to improve visualization. Given an array of detected marker corners and its corresponding ids, this functions draws the markers in the image. The marker borders are painted and the markers identifiers if provided. Useful for debugging purposes.
 
 - 
drawDetectedMarkerspublic static void drawDetectedMarkers(Mat image, java.util.List<Mat> corners, Mat ids) Draw detected markers in image- Parameters:
- image- input/output image. It must have 1 or 3 channels. The number of channels is not altered.
- corners- positions of marker corners on input image. (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.
- ids- vector of identifiers for markers in markersCorners . Optional, if not provided, ids are not painted. are calculated based on this one to improve visualization. Given an array of detected marker corners and its corresponding ids, this functions draws the markers in the image. The marker borders are painted and the markers identifiers if provided. Useful for debugging purposes.
 
 - 
drawDetectedMarkerspublic static void drawDetectedMarkers(Mat image, java.util.List<Mat> corners) Draw detected markers in image- Parameters:
- image- input/output image. It must have 1 or 3 channels. The number of channels is not altered.
- corners- positions of marker corners on input image. (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise. Optional, if not provided, ids are not painted. are calculated based on this one to improve visualization. Given an array of detected marker corners and its corresponding ids, this functions draws the markers in the image. The marker borders are painted and the markers identifiers if provided. Useful for debugging purposes.
 
 - 
generateImageMarkerpublic static void generateImageMarker(Dictionary dictionary, int id, int sidePixels, Mat img, int borderBits) Generate a canonical marker image- Parameters:
- dictionary- dictionary of markers indicating the type of markers
- id- identifier of the marker that will be returned. It has to be a valid id in the specified dictionary.
- sidePixels- size of the image in pixels
- img- output image with the marker
- borderBits- width of the marker border. This function returns a marker image in its canonical form (i.e. ready to be printed)
 
 - 
generateImageMarkerpublic static void generateImageMarker(Dictionary dictionary, int id, int sidePixels, Mat img) Generate a canonical marker image- Parameters:
- dictionary- dictionary of markers indicating the type of markers
- id- identifier of the marker that will be returned. It has to be a valid id in the specified dictionary.
- sidePixels- size of the image in pixels
- img- output image with the marker This function returns a marker image in its canonical form (i.e. ready to be printed)
 
 - 
drawDetectedCornersCharucopublic static void drawDetectedCornersCharuco(Mat image, Mat charucoCorners, Mat charucoIds, Scalar cornerColor) Draws a set of Charuco corners- Parameters:
- image- input/output image. It must have 1 or 3 channels. The number of channels is not altered.
- charucoCorners- vector of detected charuco corners
- charucoIds- list of identifiers for each corner in charucoCorners
- cornerColor- color of the square surrounding each corner This function draws a set of detected Charuco corners. If identifiers vector is provided, it also draws the id of each corner.
 
 - 
drawDetectedCornersCharucopublic static void drawDetectedCornersCharuco(Mat image, Mat charucoCorners, Mat charucoIds) Draws a set of Charuco corners- Parameters:
- image- input/output image. It must have 1 or 3 channels. The number of channels is not altered.
- charucoCorners- vector of detected charuco corners
- charucoIds- list of identifiers for each corner in charucoCorners This function draws a set of detected Charuco corners. If identifiers vector is provided, it also draws the id of each corner.
 
 - 
drawDetectedCornersCharucopublic static void drawDetectedCornersCharuco(Mat image, Mat charucoCorners) Draws a set of Charuco corners- Parameters:
- image- input/output image. It must have 1 or 3 channels. The number of channels is not altered.
- charucoCorners- vector of detected charuco corners This function draws a set of detected Charuco corners. If identifiers vector is provided, it also draws the id of each corner.
 
 - 
drawDetectedDiamondspublic static void drawDetectedDiamonds(Mat image, java.util.List<Mat> diamondCorners, Mat diamondIds, Scalar borderColor) Draw a set of detected ChArUco Diamond markers- Parameters:
- image- input/output image. It must have 1 or 3 channels. The number of channels is not altered.
- diamondCorners- positions of diamond corners in the same format returned by detectCharucoDiamond(). (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.
- diamondIds- vector of identifiers for diamonds in diamondCorners, in the same format returned by detectCharucoDiamond() (e.g. std::vector<Vec4i>). Optional, if not provided, ids are not painted.
- borderColor- color of marker borders. Rest of colors (text color and first corner color) are calculated based on this one. Given an array of detected diamonds, this functions draws them in the image. The marker borders are painted and the markers identifiers if provided. Useful for debugging purposes.
 
 - 
drawDetectedDiamondspublic static void drawDetectedDiamonds(Mat image, java.util.List<Mat> diamondCorners, Mat diamondIds) Draw a set of detected ChArUco Diamond markers- Parameters:
- image- input/output image. It must have 1 or 3 channels. The number of channels is not altered.
- diamondCorners- positions of diamond corners in the same format returned by detectCharucoDiamond(). (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise.
- diamondIds- vector of identifiers for diamonds in diamondCorners, in the same format returned by detectCharucoDiamond() (e.g. std::vector<Vec4i>). Optional, if not provided, ids are not painted. are calculated based on this one. Given an array of detected diamonds, this functions draws them in the image. The marker borders are painted and the markers identifiers if provided. Useful for debugging purposes.
 
 - 
drawDetectedDiamondspublic static void drawDetectedDiamonds(Mat image, java.util.List<Mat> diamondCorners) Draw a set of detected ChArUco Diamond markers- Parameters:
- image- input/output image. It must have 1 or 3 channels. The number of channels is not altered.
- diamondCorners- positions of diamond corners in the same format returned by detectCharucoDiamond(). (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of this array should be Nx4. The order of the corners should be clockwise. returned by detectCharucoDiamond() (e.g. std::vector<Vec4i>). Optional, if not provided, ids are not painted. are calculated based on this one. Given an array of detected diamonds, this functions draws them in the image. The marker borders are painted and the markers identifiers if provided. Useful for debugging purposes.
 
 - 
getPredefinedDictionarypublic static Dictionary getPredefinedDictionary(int dict) Returns one of the predefined dictionaries referenced by DICT_*.- Parameters:
- dict- automatically generated
- Returns:
- automatically generated
 
 - 
extendDictionarypublic static Dictionary extendDictionary(int nMarkers, int markerSize, Dictionary baseDictionary, int randomSeed) Extend base dictionary by new nMarkers- Parameters:
- nMarkers- number of markers in the dictionary
- markerSize- number of bits per dimension of each markers
- baseDictionary- Include the markers in this dictionary at the beginning (optional)
- randomSeed- a user supplied seed for theRNG() This function creates a new dictionary composed by nMarkers markers and each markers composed by markerSize x markerSize bits. If baseDictionary is provided, its markers are directly included and the rest are generated based on them. If the size of baseDictionary is higher than nMarkers, only the first nMarkers in baseDictionary are taken and no new marker is added.
- Returns:
- automatically generated
 
 - 
extendDictionarypublic static Dictionary extendDictionary(int nMarkers, int markerSize, Dictionary baseDictionary) Extend base dictionary by new nMarkers- Parameters:
- nMarkers- number of markers in the dictionary
- markerSize- number of bits per dimension of each markers
- baseDictionary- Include the markers in this dictionary at the beginning (optional) This function creates a new dictionary composed by nMarkers markers and each markers composed by markerSize x markerSize bits. If baseDictionary is provided, its markers are directly included and the rest are generated based on them. If the size of baseDictionary is higher than nMarkers, only the first nMarkers in baseDictionary are taken and no new marker is added.
- Returns:
- automatically generated
 
 - 
extendDictionarypublic static Dictionary extendDictionary(int nMarkers, int markerSize) Extend base dictionary by new nMarkers- Parameters:
- nMarkers- number of markers in the dictionary
- markerSize- 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.
- Returns:
- automatically generated
 
 
- 
 
-