ResizeWithCropOrPadOp class

As a computation unit for processing images, it could resize image to predefined size.

It will not stretch or compress the content of image. However, to fit the new size, it crops or pads pixels. When it crops image, it performs a center-crop; when it pads pixels, it performs a zero-padding.

See ResizeOp for resizing images while stretching / compressing the content.

Implemented types

Constructors

ResizeWithCropOrPadOp(int _targetHeight, int _targetWidth, [int? _cropLeft, int? _cropTop])
Creates a ResizeWithCropOrPadOp which could crop/pad images to height: _targetHeight & width: _targetWidth. It adopts center-crop and zero-padding. You can pass whith _cropLeft and _cropTop top-left position of a crop to overide the default centered one.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

apply(TensorImage image) TensorImage
Applies the defined resizing with cropping or/and padding on image and returns the result.
override
getOutputImageHeight(int inputImageHeight, int inputImageWidth) int
Computes the height of the expected output image when input image size is given.
override
getOutputImageWidth(int inputImageHeight, int inputImageWidth) int
Computes the width of the expected output image when input image size is given.
override
inverseTransform(Point<num> point, int inputImageHeight, int inputImageWidth) Point<num>
Transforms a point from coordinates system of the result image back to the one of the input image.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited