Class DeepOCREngineOptions

java.lang.Object
com.microblink.photopay.entities.ocrengine.AbstractOCREngineOptions<DeepOCREngineOptions>
com.microblink.photopay.entities.ocrengine.deep.DeepOCREngineOptions
All Implemented Interfaces:
android.os.Parcelable

public final class DeepOCREngineOptions extends AbstractOCREngineOptions<DeepOCREngineOptions>
Options used in Deep OCR.
  • Field Details

    • CREATOR

      @NonNull public static android.os.Parcelable.Creator<DeepOCREngineOptions> CREATOR
      Parcelable creator.
  • Constructor Details

    • DeepOCREngineOptions

      public DeepOCREngineOptions()
      Default constructor.
    • DeepOCREngineOptions

      public DeepOCREngineOptions(long nativeContext, @Nullable Object keep)
      Constructor from native object.
      Parameters:
      nativeContext - Native engine options object.
      keep - Owner of the native engine options object.
  • Method Details

    • clone

      @NonNull public DeepOCREngineOptions clone()
      Returns a copy of DeepOCREngineOptions object.
      Overrides:
      clone in class Object
      Returns:
      a copy
    • terminateNative

      protected void terminateNative(long nativeContext)
      Specified by:
      terminateNative in class AbstractOCREngineOptions<DeepOCREngineOptions>
    • serializeNative

      @NonNull protected byte[] serializeNative()
      Specified by:
      serializeNative in class AbstractOCREngineOptions<DeepOCREngineOptions>
    • deserializeNative

      protected void deserializeNative(@NonNull byte[] bytes)
      Specified by:
      deserializeNative in class AbstractOCREngineOptions<DeepOCREngineOptions>
    • getMinimumLineHeight

      @FloatRange(from=0.0, to=1.0) public final float getMinimumLineHeight()
      Returns the minimum height of the line of text given in float from range <0, 1>, which represents height percentage of the input image that is being processed. All lines smaller than this value are ignored. Line height is defined as height of largest character in line.
      Returns:
      minimum height of the line
    • setMinimumLineHeight

      @NonNull public final DeepOCREngineOptions setMinimumLineHeight(@FloatRange(from=0.0,to=1.0) float minimumLineHeight)
      Sets the minimum height of the line of text given in float from range <0, 1>, which represents height percentage of the input image that is being processed. All chars smaller than this value will be ignored.
      Parameters:
      minimumLineHeight - minimum height of the line from range <0, 1>
      Returns:
      this object, to support chaining of operations.
    • getMaximumLineHeight

      @FloatRange(from=0.0, to=1.0) public final float getMaximumLineHeight()
      Returns the maximum height of the line of text given in float from range <0, 1>, which represents height percentage of the input image that is being processed. All chars larger than this value are ignored.
      Returns:
      maximum height of the line
    • setMaximumLineHeight

      @NonNull public final DeepOCREngineOptions setMaximumLineHeight(@FloatRange(from=0.0,to=1.0) float maximumLineHeight)
      Sets the maximum height of the line of text given in float from range <0, 1>, which represents height percentage of the input image that is being processed. All chars larger than this value will be ignored.
      Parameters:
      maximumLineHeight - maximum height of the line
      Returns:
      this object, to support chaining of operations.
    • getMinimumCharHeight

      @FloatRange(from=0.0, to=1.0) public final float getMinimumCharHeight()
      Returns the minimum height of char that can be classified given in float from range <0, 1>, which represents height percentage of the input image that is being processed. All chars smaller than this value are ignored.
      Returns:
      minimum height of the char
    • setMinimumCharHeight

      @NonNull public final DeepOCREngineOptions setMinimumCharHeight(@FloatRange(from=0.0,to=1.0) float minimumCharHeight)
      Sets the minimum height of the char that can be classified given in float from range <0, 1>, which represents height percentage of the input image that is being processed. All chars smaller than this value are ignored. Unlike setMinimumLineHeight(float), this value refers to individual chars, while setMinimumLineHeight(float) refers to line height, which equals to height of largest char in line.
      Parameters:
      minimumCharHeight - minimum height of the char
      Returns:
      this object, to support chaining of operations
    • setOCRModel

      @NonNull public DeepOCREngineOptions setOCRModel(@NonNull DeepOCRModel model)
      Specifies the Deep OCR model that will be used. Deep OCR model defines how OCR is performed, which characted can be recognized and which types of images are supported.

      By default, it is set to DeepOCRModel.BlinkInput

      Parameters:
      model - Desired Deep OCR model that will be used.
      Returns:
      this object, to support chaining of operations
    • getOCRModel

      @NonNull public DeepOCRModel getOCRModel()
      Returns the current Deep OCR model. See setOCRModel(DeepOCRModel).
      Returns:
      current Deep OCR model.