Options to configure the image processing pipeline, which operates before inference.
The Task Library Vision API performs image preprocessing on the input image over the region of interest, so that it fits model requirements (e.g. upright 224x224 RGB) and populate the corresponding input tensor. This is performed by (in this order):
ImageProcessingOptions.Orientation
so that inference is performed on an
"upright" image.
IMPORTANT: as a consequence of cropping occurring first, the provided region of interest is
expressed in the unrotated frame of reference coordinates system, i.e. in [0,
TensorImage.getWidth()) x [0, TensorImage.getHeight())
, which are the dimensions of the
underlying image data before any orientation gets applied. If the region is out of these bounds,
the inference method, such as ImageClassifier.classify(MlImage)
, will return error.
class | ImageProcessingOptions.Builder | Builder for ImageProcessingOptions . |
|
enum | ImageProcessingOptions.Orientation | Orientation type that follows EXIF specification. |
static ImageProcessingOptions.Builder |
builder()
|
abstract ImageProcessingOptions.Orientation | |
abstract Rect |
getRoi()
|