apply method

  1. @override
TensorImage apply(
  1. TensorImage image
)
override

Applies the defined resizing on image and returns the result.

Note: the content of input image will change, and image is the same instance with the output.

Implementation

@override
TensorImage apply(TensorImage image) {
  Image scaled = copyResize(
    image.image,
    width: _targetWidth,
    height: _targetHeight,
    interpolation:
        _useBilinear ? Interpolation.linear : Interpolation.nearest,
  );
  image.loadImage(scaled);
  return image;
}