Class InputImage

java.lang.Object
com.microblink.blinkid.image.InputImage

public class InputImage extends Object
Represents a image that is being processed.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Disposes native object containing image pixels.
    protected void
     
    int
    Returns the height of the image (corrected for the current orientation).
    Returns the format of the image.
    Deprecated.
    Do not rely on this information anymore.
    Returns the orientation of the image.
    int
    Returns the raw height of the image (uncorrected for the orientation)
    android.graphics.Rect
    Returns the region of interest in image in raw form (not corrected for orientation).
    int
    Returns the raw width of the image (uncorrected for the orientation)
    android.graphics.Rect
    Returns the region of interest in image corrected for current orientation of image.
    int
    Returns the width of the image (corrected for the current orientation).
    boolean
    Returns true if image's internal buffers are disposed and cannot be used anymore.
    void
    Use this method to change InputImage's orientation.
    void
    setROI(android.graphics.Rect roi)
    Sets the region of interest in image.
     

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • dispose

      public void dispose()
      Disposes native object containing image pixels. After this method is called, InputImage object cannot be used anymore.
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • getWidth

      public int getWidth()
      Returns the width of the image (corrected for the current orientation).
      Returns:
      the width of the image (corrected for the current orientation).
    • getRawWidth

      public int getRawWidth()
      Returns the raw width of the image (uncorrected for the orientation)
    • getHeight

      public int getHeight()
      Returns the height of the image (corrected for the current orientation).
      Returns:
      the height of the image (corrected for the current orientation).
    • getRawHeight

      public int getRawHeight()
      Returns the raw height of the image (uncorrected for the orientation)
    • getImageFormat

      @NonNull public ImageFormat getImageFormat()
      Returns the format of the image.
      Returns:
      the format of the image.
    • getImageName

      @NonNull @Deprecated public String getImageName()
      Deprecated.
      Do not rely on this information anymore. New API images will be nameless.
      Returns the name of the image.
      Returns:
      the name of the image.
    • getROI

      @NonNull public android.graphics.Rect getROI()
      Returns the region of interest in image corrected for current orientation of image.
    • getRawROI

      @NonNull public android.graphics.Rect getRawROI()
      Returns the region of interest in image in raw form (not corrected for orientation). This is useful only for YUV_NV21 images that will contain the entire image in buffer and to obtain ROI-ed image, you should use YuvImage helper class (see: YuvImage )
      Returns:
      the region of interest in image.
    • setROI

      public void setROI(@NonNull android.graphics.Rect roi)
      Sets the region of interest in image. You can use this method to set the ROI of images that will be processed via RecognizerRunner. Coordinates of the ROI are applied in the current image's orientation - see getImageOrientation().
      Parameters:
      roi - region of interest in image
    • getImageOrientation

      @NonNull public Orientation getImageOrientation()
      Returns the orientation of the image. Orientation is defined as orientation of the device when the image was taken. To explain the orientation further, let's assume that image contains a line of text. If orientation is Orientation.ORIENTATION_LANDSCAPE_RIGHT, the line of text would be horizontal from left to right (normal reading orientation). If orientation is Orientation.ORIENTATION_PORTRAIT, the line of text would be vertical from bottom to top. In order to read the text, you would need to rotate image by 90 degrees clockwise. If orientation is Orientation.ORIENTATION_PORTRAIT_UPSIDE, the line of text would be vertical from top to bottom. In order to read the text, you would need to rotate image by 90 degrees counterclockwise. If orientation is Orientation.ORIENTATION_LANDSCAPE_LEFT, the line of text would be horizontal from right to left (upside down). In order to read the text, you would need to rotate image by 180 degrees.
      Returns:
      the orientation of the image
    • setImageOrientation

      public void setImageOrientation(@NonNull Orientation orientation)
      Use this method to change InputImage's orientation. This can be useful for different interpretations of same image in different recognition contexts.
      Parameters:
      orientation -
    • isDisposed

      public boolean isDisposed()
      Returns true if image's internal buffers are disposed and cannot be used anymore.
      Returns:
      true if image's internal buffers are disposed and cannot be used anymore.
    • toImage

      public Image toImage()