Class CropImageTransform

    • Constructor Detail

      • CropImageTransform

        public CropImageTransform​(int crop)
        Calls this(null, crop, crop, crop, crop).
      • CropImageTransform

        public CropImageTransform​(Random random,
                                  int crop)
        Calls this(random, crop, crop, crop, crop).
      • CropImageTransform

        public CropImageTransform​(int cropTop,
                                  int cropLeft,
                                  int cropBottom,
                                  int cropRight)
        Calls this(random, cropTop, cropLeft, cropBottom, cropRight).
      • CropImageTransform

        public CropImageTransform​(Random random,
                                  int cropTop,
                                  int cropLeft,
                                  int cropBottom,
                                  int cropRight)
        Constructs an instance of the ImageTransform.
        Parameters:
        random - object to use (or null for deterministic)
        cropTop - maximum cropping of the top of the image (pixels)
        cropLeft - maximum cropping of the left of the image (pixels)
        cropBottom - maximum cropping of the bottom of the image (pixels)
        cropRight - maximum cropping of the right of the image (pixels)
    • Method Detail

      • doTransform

        protected ImageWritable doTransform​(ImageWritable image,
                                            Random random)
        Takes an image and returns a transformed image. Uses the random object in the case of random transformations.
        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