tensorflow/lite/g3doc/api_docs/java/org/tensorflow/lite/support/image/ops/TransformToGrayscaleOp.html
public class TransformToGrayscaleOp
Transforms an image to GrayScale as an image processing unit.
Supported color spaces:
ColorSpaceType.RGBThe conversion is based on OpenCV RGB to GRAY conversion https://docs.opencv.org/master/de/d25/imgproc\_color\_conversions.html#color\_convert\_rgb\_gray
| | TransformToGrayscaleOp() Creates a TransformToGrayscaleOp.
|
| TensorImage |
apply(TensorImage image)
Applies the transformation to grayscale and returns a 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.
|
From class java.lang.Object
| boolean | equals(Object arg0) | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |
From interface org.tensorflow.lite.support.image.ImageOperator
| abstract TensorImage | apply(TensorImage image) | | abstract int | getOutputImageHeight(int inputImageHeight, int inputImageWidth) Computes the height of the expected output image when input image size is given.
| | abstract int | getOutputImageWidth(int inputImageHeight, int inputImageWidth) Computes the width of the expected output image when input image size is given.
| | 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.
|
From interface org.tensorflow.lite.support.common.Operator
| abstract TensorImage | apply(TensorImage x) Applies an operation on a T object, returning a T object.
|
Creates a TransformToGrayscaleOp.
Applies the transformation to grayscale and returns a TensorImage.
If the input image is already ColorSpaceType.GRAYSCALE, this op will be a no-op.
| image | |
| IllegalArgumentException | if the image is not ColorSpaceType.RGB or ColorSpaceType.GRAYSCALE. |
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. |