Class ImageCropStep

  • All Implemented Interfaces:
    ai.konduit.serving.pipeline.api.step.PipelineStep, ai.konduit.serving.pipeline.api.TextConfig, java.io.Serializable

    public class ImageCropStep
    extends java.lang.Object
    implements ai.konduit.serving.pipeline.api.step.PipelineStep
    Crop an image to the specified rectangular region. The crop region may be specified in one of two ways:
    (a) Via a bounding box, or
    (b) Via a List<Point> of length 2, containing the top-left and bottom-right crop locations.
    Furthermore, the bounding box and corner point coordinates may be specified in terms of either pixels or "fraction of image". Note that if the crop region falls partly outside the input image region, black padding will be added as necessary to keep the requested output size.
    Supports both Image and List<Image> inputs.
    Author:
    Alex Black
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean coordsArePixels  
      protected ai.konduit.serving.pipeline.api.data.BoundingBox cropBox  
      protected java.lang.String cropName  
      protected java.util.List<ai.konduit.serving.pipeline.api.data.Point> cropPoints  
      protected java.lang.String imageName  
    • Constructor Summary

      Constructors 
      Constructor Description
      ImageCropStep​(java.lang.String imageName, java.lang.String cropName, java.util.List<ai.konduit.serving.pipeline.api.data.Point> cropPoints, ai.konduit.serving.pipeline.api.data.BoundingBox cropBox, boolean coordsArePixels)  
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface ai.konduit.serving.pipeline.api.step.PipelineStep

        name
      • Methods inherited from interface ai.konduit.serving.pipeline.api.TextConfig

        toJson, toYaml
    • Field Detail

      • imageName

        protected java.lang.String imageName
      • cropName

        protected java.lang.String cropName
      • cropPoints

        protected java.util.List<ai.konduit.serving.pipeline.api.data.Point> cropPoints
      • cropBox

        protected ai.konduit.serving.pipeline.api.data.BoundingBox cropBox
      • coordsArePixels

        protected boolean coordsArePixels
    • Constructor Detail

      • ImageCropStep

        public ImageCropStep​(java.lang.String imageName,
                             java.lang.String cropName,
                             java.util.List<ai.konduit.serving.pipeline.api.data.Point> cropPoints,
                             ai.konduit.serving.pipeline.api.data.BoundingBox cropBox,
                             boolean coordsArePixels)