Class EdgeVisionAPI.Builder

java.lang.Object
com.nefrock.edgeocr.EdgeVisionAPI.Builder
Enclosing interface:
EdgeVisionAPI

public static class EdgeVisionAPI.Builder extends Object
OCRエンジンを初期化するためのビルダークラスです。 OCRエンジンを初期化するには、このクラスのインスタンスを作成し、 `fromAssets`または`fromPath`メソッドを呼び出して、 OCRモデルを読み込む方法を指定した後に、`build`メソッドを呼び出してください。
  • Constructor Summary

    Constructors
    Constructor
    Description
    Builder(android.content.Context context)
    Builderのコンストラクタ
  • Method Summary

    Modifier and Type
    Method
    Description
    OCRエンジンを初期化します。`fromAssets`または`fromPath`メソッドを呼び出して、 OCRモデルを読み込む方法を指定した後に、このメソッドを呼び出してください。
    fromAssets(String assetSubdir)
    モデルファイルを含むフォルダーのパスをassetsディレクトリから指定します。
    fromPath(String modelsPath)
    モデルファイルを含むフォルダーの絶対パスを指定します。

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Builder

      public Builder(android.content.Context context)
      Builderのコンストラクタ
      Parameters:
      context - コンテキスト
  • Method Details

    • fromAssets

      public EdgeVisionAPI.Builder fromAssets(@NonNull String assetSubdir)
      モデルファイルを含むフォルダーのパスをassetsディレクトリから指定します。
      Parameters:
      assetSubdir - assetsディレクトリからのパス
      Returns:
      this
    • fromPath

      public EdgeVisionAPI.Builder fromPath(@NonNull String modelsPath)
      モデルファイルを含むフォルダーの絶対パスを指定します。
      Parameters:
      modelsPath - OCRモデルのパス
      Returns:
      this
    • build

      public EdgeVisionAPI build() throws EdgeError
      OCRエンジンを初期化します。`fromAssets`または`fromPath`メソッドを呼び出して、 OCRモデルを読み込む方法を指定した後に、このメソッドを呼び出してください。
      Returns:
      OCRエンジン
      Throws:
      EdgeError - OCRエンジンの初期化に失敗した場合