ImagePreprocessing

class ImagePreprocessing

Represents the image preprocessing stage of the org.jetbrains.kotlinx.dl.dataset.preprocessor.Preprocessing. Consists of the operations implementing ImagePreprocessing which are applied to the image one by one.

Supported operations include:

See also

Constructors

ImagePreprocessing
Link copied to clipboard
fun ImagePreprocessing()

Functions

addOperation
Link copied to clipboard
fun addOperation(operation: ImagePreprocessor)

Adds a new operation to the operations.

Extensions

centerCrop
Link copied to clipboard
fun ImagePreprocessing.centerCrop(block: CenterCrop.() -> Unit)

Applies CenterCrop operation to crop the image at the center.

convert
Link copied to clipboard
fun ImagePreprocessing.convert(block: Convert.() -> Unit)

Applies Convert operation to convert the image to a different ColorMode.

crop
Link copied to clipboard
fun ImagePreprocessing.crop(block: Cropping.() -> Unit)

Applies Cropping operation to crop the image by the specified amount.

grayscale
Link copied to clipboard
fun ImagePreprocessing.grayscale()

Applies Convert operation to convert the image to ColorMode.GRAYSCALE.

pad
Link copied to clipboard
fun ImagePreprocessing.pad(block: Padding.() -> Unit)

Applies Padding operation to pad the image.

resize
Link copied to clipboard
fun ImagePreprocessing.resize(block: Resize.() -> Unit)

Applies Resize operation to resize the image to a specific size.

rotate
Link copied to clipboard
fun ImagePreprocessing.rotate(block: Rotate.() -> Unit)

Applies Rotate operation to rotate the image by an arbitrary angle (specified in degrees).