Class LargestBlobCropTransform

    • Field Detail

      • mode

        protected int mode
      • method

        protected int method
      • blurWidth

        protected int blurWidth
      • blurHeight

        protected int blurHeight
      • upperThresh

        protected int upperThresh
      • lowerThresh

        protected int lowerThresh
      • isCanny

        protected boolean isCanny
    • Constructor Detail

      • LargestBlobCropTransform

        public LargestBlobCropTransform()
        Calls this(null
      • LargestBlobCropTransform

        public LargestBlobCropTransform​(Random random)
        Calls this(random, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE, 3, 3, 100, 200, true)
      • LargestBlobCropTransform

        public LargestBlobCropTransform​(Random random,
                                        int mode,
                                        int method,
                                        int blurWidth,
                                        int blurHeight,
                                        int lowerThresh,
                                        int upperThresh,
                                        boolean isCanny)
        Parameters:
        random - Object to use (or null for deterministic)
        mode - Contour retrieval mode
        method - Contour approximation method
        blurWidth - Width of blurring kernel size
        blurHeight - Height of blurring kernel size
        lowerThresh - Lower threshold for either Canny or Threshold
        upperThresh - Upper threshold for either Canny or Threshold
        isCanny - Whether the edge detector is Canny or Threshold
    • Method Detail

      • doTransform

        protected ImageWritable doTransform​(ImageWritable image,
                                            Random random)
        Takes an image and returns a cropped image based on it's largest blob.
        Specified by:
        doTransform in class BaseImageTransform<org.bytedeco.opencv.opencv_core.Mat>
        Parameters:
        image - to transform, null == end of stream
        random - object to use (or null for deterministic)
        Returns:
        transformed image
      • query

        public float[] query​(float... coordinates)
        Description copied from interface: ImageTransform
        Transforms the given coordinates using the parameters that were used to transform the last image.
        Specified by:
        query in interface ImageTransform
        Overrides:
        query in class BaseImageTransform<org.bytedeco.opencv.opencv_core.Mat>
        Parameters:
        coordinates - to transforms (x1, y1, x2, y2, ...)
        Returns:
        transformed coordinates