Cropping

class Cropping(top: Int, bottom: Int, left: Int, right: Int) : ImagePreprocessorBase

This image preprocessor defines the Crop operation.

Crop operations creates new image with the following sizes:

Constructors

Cropping
Link copied to clipboard
fun Cropping(top: Int = 1, bottom: Int = 1, left: Int = 1, right: Int = 1)

Functions

apply
Link copied to clipboard
open override fun apply(image: BufferedImage): BufferedImage

Transforms provided input image.

getOutputShape
Link copied to clipboard
open override fun getOutputShape(inputShape: ImageShape): ImageShape

Computes output image shape for the provided inputShape. Note that some input dimensions could equal to null, which means that they are undefined. This is useful for the operations with fixed output size not dependent on the input size.

Properties

bottom
Link copied to clipboard
var bottom: Int = 1

The image will be cropped from the bottom by the given number of pixels.

left
Link copied to clipboard
var left: Int = 1

The image will be cropped from the left by the given number of pixels.

right
Link copied to clipboard
var right: Int = 1

The image will be cropped from the right by the given number of pixels.

top
Link copied to clipboard
var top: Int = 1

The image will be cropped from the top by the given number of pixels.