Class ClipAndReduce<T extends ImageBase<T>>


public class ClipAndReduce<T extends ImageBase<T>>
extends Object
Transforms an image in an attempt to not change the information contained inside of it for processing by a classification algorithm that requires an image of fixed size. This is done by clipping the image to ensure that it has the same aspect ratio then scales it using bilinear interpolation.
  • Constructor Details

    • ClipAndReduce

      public ClipAndReduce​(boolean clip, ImageType<T> imageType)
      Configuration constructor
      clip - If true it will first clip the image to make it square before reducing it's size. Otherwise both sides are scaled independently to make it square
      imageType - Type of image it iwll be processing
  • Method Details

    • massage

      public void massage​(T input, T output)
      Clipps and scales the input image as necessary
      input - Input image. Typically larger than output
      output - Output image