Package org.datavec.image.transform
Class RandomCropTransform
- java.lang.Object
-
- org.datavec.image.transform.BaseImageTransform<org.bytedeco.opencv.opencv_core.Mat>
-
- org.datavec.image.transform.RandomCropTransform
-
- All Implemented Interfaces:
Operation<ImageWritable,ImageWritable>,ImageTransform
public class RandomCropTransform extends BaseImageTransform<org.bytedeco.opencv.opencv_core.Mat>
-
-
Field Summary
Fields Modifier and Type Field Description protected intoutputHeightprotected intoutputWidthprotected Randomrng-
Fields inherited from class org.datavec.image.transform.BaseImageTransform
converter, currentImage, random
-
-
Constructor Summary
Constructors Constructor Description RandomCropTransform(int height, int width)RandomCropTransform(long seed, int height, int width)RandomCropTransform(Random random, long seed, int height, int width)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ImageWritabledoTransform(ImageWritable image, Random random)Takes an image and returns a randomly cropped image.float[]query(float... coordinates)Transforms the given coordinates using the parameters that were used to transform the last image.-
Methods inherited from class org.datavec.image.transform.BaseImageTransform
getCurrentImage, transform, transform
-
-
-
-
Field Detail
-
outputHeight
protected int outputHeight
-
outputWidth
protected int outputWidth
-
rng
protected Random rng
-
-
Constructor Detail
-
RandomCropTransform
public RandomCropTransform(int height, int width)
-
RandomCropTransform
public RandomCropTransform(long seed, int height, int width)
-
RandomCropTransform
public RandomCropTransform(Random random, long seed, int height, int width)
-
-
Method Detail
-
doTransform
protected ImageWritable doTransform(ImageWritable image, Random random)
Takes an image and returns a randomly cropped image.- Specified by:
doTransformin classBaseImageTransform<org.bytedeco.opencv.opencv_core.Mat>- Parameters:
image- to transform, null == end of streamrandom- object to use (or null for deterministic)- Returns:
- transformed image
-
query
public float[] query(float... coordinates)
Description copied from interface:ImageTransformTransforms the given coordinates using the parameters that were used to transform the last image.- Specified by:
queryin interfaceImageTransform- Overrides:
queryin classBaseImageTransform<org.bytedeco.opencv.opencv_core.Mat>- Parameters:
coordinates- to transforms (x1, y1, x2, y2, ...)- Returns:
- transformed coordinates
-
-