Class WarpImageTransform

    • Constructor Detail

      • WarpImageTransform

        public WarpImageTransform​(float delta)
        Calls this(null, delta, delta, delta, delta, delta, delta, delta, delta).
      • WarpImageTransform

        public WarpImageTransform​(Random random,
                                  float delta)
        Calls this(random, delta, delta, delta, delta, delta, delta, delta, delta).
      • WarpImageTransform

        public WarpImageTransform​(float dx1,
                                  float dy1,
                                  float dx2,
                                  float dy2,
                                  float dx3,
                                  float dy3,
                                  float dx4,
                                  float dy4)
        Calls this(null, dx1, dy1, dx2, dy2, dx3, dy3, dx4, dy4).
      • WarpImageTransform

        public WarpImageTransform​(Random random,
                                  float dx1,
                                  float dy1,
                                  float dx2,
                                  float dy2,
                                  float dx3,
                                  float dy3,
                                  float dx4,
                                  float dy4)
        Constructs an instance of the ImageTransform.
        Parameters:
        random - object to use (or null for deterministic)
        dx1 - maximum warping in x for the top-left corner (pixels)
        dy1 - maximum warping in y for the top-left corner (pixels)
        dx2 - maximum warping in x for the top-right corner (pixels)
        dy2 - maximum warping in y for the top-right corner (pixels)
        dx3 - maximum warping in x for the bottom-right corner (pixels)
        dy3 - maximum warping in y for the bottom-right corner (pixels)
        dx4 - maximum warping in x for the bottom-left corner (pixels)
        dy4 - maximum warping in y for the bottom-left corner (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