As a computation unit for processing images, it can resize an image to user-specified size.
It interpolates pixels when image is stretched, and discards pixels when image is compressed.
| enum | ResizeOp.ResizeMethod | Algorithms for resizing. | |
|
ResizeOp(int targetHeight, int targetWidth, ResizeOp.ResizeMethod resizeMethod)
Creates a ResizeOp which can resize images to specified size in specified method.
|
| TensorImage | |
| int |
getOutputImageHeight(int inputImageHeight, int inputImageWidth)
Computes the height of the expected output image when input image size is given.
|
| int |
getOutputImageWidth(int inputImageHeight, int inputImageWidth)
Computes the width of the expected output image when input image size is given.
|
| PointF |
inverseTransform(PointF point, int inputImageHeight, int inputImageWidth)
Transforms a point from coordinates system of the result image back to the one of the input
image.
|
Creates a ResizeOp which can resize images to specified size in specified method.
| targetHeight | The expected height of resized image. |
|---|---|
| targetWidth | The expected width of resized image. |
| resizeMethod | The algorithm to use for resizing. Options: ResizeOp.ResizeMethod
|
Applies the defined resizing on given image and returns the result.
Note: the content of input image will change, and image is the same instance
with the output.
| image | input image. |
|---|
Computes the height of the expected output image when input image size is given.
| inputImageHeight | |
|---|---|
| inputImageWidth |
Computes the width of the expected output image when input image size is given.
| inputImageHeight | |
|---|---|
| inputImageWidth |
Transforms a point from coordinates system of the result image back to the one of the input image.
| point | the point from the result coordinates system. |
|---|---|
| inputImageHeight | the height of input image. |
| inputImageWidth | the width of input image. |