Class CenterCrop

  • All Implemented Interfaces:
    Transform

    public class CenterCrop
    extends java.lang.Object
    implements Transform
    A Transform that crops the center of an image.
    • Constructor Summary

      Constructors 
      Constructor Description
      CenterCrop()
      Creates a CenterCrop Transform that crops to size min(width, height).
      CenterCrop​(int width, int height)
      Creates a CenterCrop Transform that crops the given width and height.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      NDArray transform​(NDArray array)
      Applies the Transform to the given NDArray.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CenterCrop

        public CenterCrop()
        Creates a CenterCrop Transform that crops to size min(width, height).
      • CenterCrop

        public CenterCrop​(int width,
                          int height)
        Creates a CenterCrop Transform that crops the given width and height.
        Parameters:
        width - the desired width of the cropped image
        height - the desired height of the cropped image