🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
Package org.opencv.dnn
クラス TextRecognitionModel
- java.lang.Object
-
- org.opencv.dnn.Model
-
- org.opencv.dnn.TextRecognitionModel
public class TextRecognitionModel extends Model
このクラスはテキスト認識ネットワークの高レベルAPIを表す。TextRecognitionModelは入力画像の前処理に関する引数を設定できる。TextRecognitionModelは学習済み重みと設定を含むファイルからネットを生成し、入力の前処理を設定し、順伝播を実行して認識結果を返す。TextRecognitionModelではCRNN-CTCがサポートされている。
-
-
コンストラクタの要約
コンストラクタ Modifier Constructor Description protectedTextRecognitionModel​(long addr)TextRecognitionModel​(java.lang.String model)Create text recognition model from network represented in one of the supported formats Call setDecodeType() and setVocabulary() after constructor to initialize the decoding methodTextRecognitionModel​(java.lang.String model, java.lang.String config)Create text recognition model from network represented in one of the supported formats Call setDecodeType() and setVocabulary() after constructor to initialize the decoding methodTextRecognitionModel​(Net network)Create Text Recognition model from deep learning network Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method
-
メソッドの要約
すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド Modifier and Type Method Description static TextRecognitionModel__fromPtr__​(long addr)java.lang.StringgetDecodeType()Get the decoding methodjava.util.List<java.lang.String>getVocabulary()Get the vocabulary for recognition.java.lang.Stringrecognize​(Mat frame)Given theinputframe, create input blob, run net and return recognition resultvoidrecognize​(Mat frame, java.util.List<Mat> roiRects, java.util.List<java.lang.String> results)Given theinputframe, create input blob, run net and return recognition resultTextRecognitionModelsetDecodeOptsCTCPrefixBeamSearch​(int beamSize)Set the decoding method options for"CTC-prefix-beam-search"decode usageTextRecognitionModelsetDecodeOptsCTCPrefixBeamSearch​(int beamSize, int vocPruneSize)Set the decoding method options for"CTC-prefix-beam-search"decode usageTextRecognitionModelsetDecodeType​(java.lang.String decodeType)Set the decoding method of translating the network output into stringTextRecognitionModelsetVocabulary​(java.util.List<java.lang.String> vocabulary)Set the vocabulary for recognition.-
クラス org.opencv.dnn.Model から継承したメソッド
enableWinograd, getNativeObjAddr, predict, setInputCrop, setInputMean, setInputParams, setInputParams, setInputParams, setInputParams, setInputParams, setInputParams, setInputScale, setInputSize, setInputSize, setInputSwapRB, setOutputNames, setPreferableBackend, setPreferableTarget
-
-
-
-
コンストラクタの詳細
-
TextRecognitionModel
protected TextRecognitionModel​(long addr)
-
TextRecognitionModel
public TextRecognitionModel​(Net network)
Create Text Recognition model from deep learning network Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method- 引数:
network- Netオブジェクト
-
TextRecognitionModel
public TextRecognitionModel​(java.lang.String model, java.lang.String config)Create text recognition model from network represented in one of the supported formats Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method- 引数:
model- 学習済み重みを含むバイナリファイルconfig- ネットワーク設定を含むテキストファイル
-
TextRecognitionModel
public TextRecognitionModel​(java.lang.String model)
Create text recognition model from network represented in one of the supported formats Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method- 引数:
model- 学習済み重みを含むバイナリファイル
-
-
メソッドの詳細
-
__fromPtr__
public static TextRecognitionModel __fromPtr__​(long addr)
-
setDecodeType
public TextRecognitionModel setDecodeType​(java.lang.String decodeType)
Set the decoding method of translating the network output into string- 引数:
decodeType- ネットワーク出力を文字列に変換するデコード方式。現在サポートされている型: -"CTC-greedy"CTCベース手法の出力に対するgreedyデコード -"CTC-prefix-beam-search"CTCベース手法の出力に対するPrefix beam searchデコード- 戻り値:
- 自動生成
-
getDecodeType
public java.lang.String getDecodeType()
Get the decoding method- 戻り値:
- デコード方式
-
setDecodeOptsCTCPrefixBeamSearch
public TextRecognitionModel setDecodeOptsCTCPrefixBeamSearch​(int beamSize, int vocPruneSize)
Set the decoding method options for"CTC-prefix-beam-search"decode usage- 引数:
beamSize- 探索のビームサイズvocPruneSize- 大規模な語彙探索を最適化するための引数。各探索ステップで上位vocPruneSize個のトークンのみを対象とする。vocPruneSize<= 0 の場合はこのプルーニングを無効にする。- 戻り値:
- 自動生成
-
setDecodeOptsCTCPrefixBeamSearch
public TextRecognitionModel setDecodeOptsCTCPrefixBeamSearch​(int beamSize)
Set the decoding method options for"CTC-prefix-beam-search"decode usage- 引数:
beamSize- 探索のビームサイズ。各探索ステップで上位vocPruneSize個のトークンのみを対象とする。vocPruneSize<= 0 の場合はこのプルーニングを無効にする。- 戻り値:
- 自動生成
-
setVocabulary
public TextRecognitionModel setVocabulary​(java.util.List<java.lang.String> vocabulary)
Set the vocabulary for recognition.- 引数:
vocabulary- ネットワークに対応する語彙。- 戻り値:
- 自動生成
-
getVocabulary
public java.util.List<java.lang.String> getVocabulary()
Get the vocabulary for recognition.- 戻り値:
- vocabulary 関連付けられた語彙
-
recognize
public java.lang.String recognize​(Mat frame)
Given theinputframe, create input blob, run net and return recognition result- 引数:
frame- 入力画像- 戻り値:
- テキスト認識結果
-
recognize
public void recognize​(Mat frame, java.util.List<Mat> roiRects, java.util.List<java.lang.String> results)
Given theinputframe, create input blob, run net and return recognition result- 引数:
frame- 入力画像roiRects- テキスト検出の関心領域のリスト(cv::Rect, CV_32SC4)。ROIはネットワーク入力として切り出される。results- テキスト認識結果の集合。
-
-