# ImageOperator

public interface **ImageOperator** Known Indirect Subclasses [ResizeOp](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/ops/ResizeOp.md.txt), [ResizeWithCropOrPadOp](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/ops/ResizeWithCropOrPadOp.md.txt), [Rot90Op](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/ops/Rot90Op.md.txt), [TensorOperatorWrapper](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/ops/TensorOperatorWrapper.md.txt), [TransformToGrayscaleOp](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/ops/TransformToGrayscaleOp.md.txt) [ResizeOp](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/ops/ResizeOp.md.txt) As a computation unit for processing images, it can resize an image to user-specified size. [ResizeWithCropOrPadOp](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/ops/ResizeWithCropOrPadOp.md.txt) As a computation unit for processing images, it could resize image to predefined size. [Rot90Op](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/ops/Rot90Op.md.txt) Rotates image counter-clockwise. [TensorOperatorWrapper](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/ops/TensorOperatorWrapper.md.txt) The adapter that makes a TensorOperator able to run with TensorImage. [TransformToGrayscaleOp](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/ops/TransformToGrayscaleOp.md.txt) Transforms an image to GrayScale as an image processing unit. Operates a TensorImage object. Used in ImageProcessor.

### Public Methods

|---|---|
| abstract [TensorImage](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/TensorImage.md.txt) | [apply](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/ImageOperator.md.txt#apply(org.tensorflow.lite.support.image.TensorImage))([TensorImage](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/TensorImage.md.txt) image) |
| abstract int | [getOutputImageHeight](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/ImageOperator.md.txt#getOutputImageHeight(int,%20int))(int inputImageHeight, int inputImageWidth) Computes the height of the expected output image when input image size is given. |
| abstract int | [getOutputImageWidth](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/ImageOperator.md.txt#getOutputImageWidth(int,%20int))(int inputImageHeight, int inputImageWidth) Computes the width of the expected output image when input image size is given. |
| abstract PointF | [inverseTransform](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/ImageOperator.md.txt#inverseTransform(PointF,%20int,%20int))(PointF point, int inputImageHeight, int inputImageWidth) Transforms a point from coordinates system of the result image back to the one of the input image. |

### Inherited Methods

From interface [org.tensorflow.lite.support.common.Operator](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/common/Operator.md.txt)

|---|---|
| abstract [TensorImage](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/TensorImage.md.txt) | [apply](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/common/Operator.md.txt#apply(T))([TensorImage](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/TensorImage.md.txt) x) Applies an operation on a T object, returning a T object. |

## Public Methods

#### public abstract [TensorImage](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/TensorImage.md.txt)
**apply**
([TensorImage](https://developers.google.com/edge/api/tflite/java/org/tensorflow/lite/support/image/TensorImage.md.txt) image)

<br />

##### Parameters

| image |   |
|---|---|

##### See Also

- `Operator.apply(java.lang.Object)`

#### public abstract int
**getOutputImageHeight**
(int inputImageHeight, int inputImageWidth)

Computes the height of the expected output image when input image size is given.

##### Parameters

| inputImageHeight |   |
| inputImageWidth |   |
|---|---|

#### public abstract int
**getOutputImageWidth**
(int inputImageHeight, int inputImageWidth)

Computes the width of the expected output image when input image size is given.

##### Parameters

| inputImageHeight |   |
| inputImageWidth |   |
|---|---|

#### public abstract 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.

##### Parameters

| point | the point from the result coordinates system. |
| inputImageHeight | the height of input image. |
| inputImageWidth | the width of input image. |
|---|---|

##### Returns

- the point with the coordinates from the coordinates system of the input image.