public class TextRecognitionModel extends Model
| Modifier | Constructor and Description |
|---|---|
protected |
TextRecognitionModel(long addr) |
|
TextRecognitionModel(Net network)
Create Text Recognition model from deep learning network
Call setDecodeType() and setVocabulary() after constructor to initialize the decoding method
|
|
TextRecognitionModel(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
|
|
TextRecognitionModel(String model,
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
|
| Modifier and Type | Method and Description |
|---|---|
static TextRecognitionModel |
__fromPtr__(long addr) |
protected void |
finalize() |
String |
getDecodeType()
Get the decoding method
|
List<String> |
getVocabulary()
Get the vocabulary for recognition.
|
String |
recognize(Mat frame)
Given the
input frame, create input blob, run net and return recognition result |
void |
recognize(Mat frame,
List<Mat> roiRects,
List<String> results)
Given the
input frame, create input blob, run net and return recognition result |
TextRecognitionModel |
setDecodeType(String decodeType)
Set the decoding method of translating the network output into string
|
TextRecognitionModel |
setVocabulary(List<String> vocabulary)
Set the vocabulary for recognition.
|
getNativeObjAddr, predict, setInputCrop, setInputMean, setInputParams, setInputParams, setInputParams, setInputParams, setInputParams, setInputParams, setInputScale, setInputSize, setInputSize, setInputSwapRB, setPreferableBackend, setPreferableTargetprotected TextRecognitionModel(long addr)
public TextRecognitionModel(Net network)
network - Net objectpublic TextRecognitionModel(String model, String config)
model - Binary file contains trained weightsconfig - Text file contains network configurationpublic TextRecognitionModel(String model)
model - Binary file contains trained weightspublic static TextRecognitionModel __fromPtr__(long addr)
public TextRecognitionModel setDecodeType(String decodeType)
decodeType - The decoding method of translating the network output into string: {'CTC-greedy': greedy decoding for the output of CTC-based methods}public String getDecodeType()
public TextRecognitionModel setVocabulary(List<String> vocabulary)
vocabulary - the associated vocabulary of the network.public List<String> getVocabulary()
public String recognize(Mat frame)
input frame, create input blob, run net and return recognition resultframe - The input imagepublic void recognize(Mat frame, List<Mat> roiRects, List<String> results)
input frame, create input blob, run net and return recognition resultframe - The input imageroiRects - List of text detection regions of interest (cv::Rect, CV_32SC4). ROIs is be cropped as the network inputsresults - A set of text recognition results.Copyright © 2021. All rights reserved.