Class CCheckerDetector


  • public class CCheckerDetector
    extends Algorithm
    A class to find the positions of the ColorCharts in the image.
    • Constructor Detail

      • CCheckerDetector

        protected CCheckerDetector​(long addr)
    • Method Detail

      • processWithROI

        public boolean processWithROI​(Mat image,
                                      MatOfRect regionsOfInterest,
                                      int nc)
        Find the ColorCharts in the given image. The found charts are not returned but instead stored in the detector, these can be accessed later on using getBestColorChecker() and getListColorChecker()
        Parameters:
        image - image in color space BGR
        regionsOfInterest - regions of image to look for the chart, if it is empty, charts are looked for in the entire image
        nc - number of charts in the image, if you don't know the exact then keeping this number high helps.
        Returns:
        true if atleast one chart is detected otherwise false
      • processWithROI

        public boolean processWithROI​(Mat image,
                                      MatOfRect regionsOfInterest)
        Find the ColorCharts in the given image. The found charts are not returned but instead stored in the detector, these can be accessed later on using getBestColorChecker() and getListColorChecker()
        Parameters:
        image - image in color space BGR
        regionsOfInterest - regions of image to look for the chart, if it is empty, charts are looked for in the entire image then keeping this number high helps.
        Returns:
        true if atleast one chart is detected otherwise false
      • process

        public boolean process​(Mat image,
                               int nc)
        Find the ColorCharts in the given image. Differs from the above one only in the arguments. This version searches for the chart in the full image. The found charts are not returned but instead stored in the detector, these can be accessed later on using getBestColorChecker() and getListColorChecker()
        Parameters:
        image - image in color space BGR
        nc - number of charts in the image, if you don't know the exact then keeping this number high helps.
        Returns:
        true if atleast one chart is detected otherwise false
      • process

        public boolean process​(Mat image)
        Find the ColorCharts in the given image. Differs from the above one only in the arguments. This version searches for the chart in the full image. The found charts are not returned but instead stored in the detector, these can be accessed later on using getBestColorChecker() and getListColorChecker()
        Parameters:
        image - image in color space BGR then keeping this number high helps.
        Returns:
        true if atleast one chart is detected otherwise false
      • create

        public static CCheckerDetector create()
        Returns the implementation of the CCheckerDetector.
        Returns:
        automatically generated
      • create

        public static CCheckerDetector create​(Net net)
        Set the net which will be used to find the approximate bounding boxes for the color charts. And returns the implementation of the CCheckerDetector. It is not necessary to use this, but this usually results in better detection rate.
        Parameters:
        net - the neural network, if the network in empty, then the function will return false.
        Returns:
        automatically generated
      • getRefColors

        public Mat getRefColors()
        Gets the reference color for chart.
        Returns:
        automatically generated
      • setDetectionParams

        public void setDetectionParams​(DetectorParametersMCC params)
        Sets the detection paramaters for mcc.
        Parameters:
        params - DetectorParametersMCC structure containing detection configuration parameters.
      • setUseDnnModel

        public void setUseDnnModel​(boolean useDnn)
        Enables or disables the use of the neural network for detection.
        Parameters:
        useDnn - Boolean flag to indicate whether to use neural network (true) or not (false).
      • getUseDnnModel

        public boolean getUseDnnModel()
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class Algorithm
        Throws:
        java.lang.Throwable