Thanks for downloading Dynamsoft Label Recognizer Package!
Your download will start shortly. If your download does not begin, click here to retry.
Android API Reference - Recognizing
You are viewing a history document page of Dynamsoft Label Recognizer Android v1.x.
Method | Description |
---|---|
recognizeByBuffer |
Recognizes text from memory buffer containing image pixels in defined format. |
recognizeByFile |
Recognizes text from a specified image file. |
recognizeByBuffer
Recognizes text from the memory buffer containing image pixels in defined format.
DLRResult[] com.dynamsoft.dlr.LabelRecognition.recognizeByBuffer(DLRImageData imageData, String templateName) throws LabelRecognitionException
Parameters
[in] imageData
An object of DLRImageData that represents an image.
[in] templateName
The template name. A template name is the value of key LabelRecognitionParameter.Name defined in JSON formatted settings. If no template name is specified, current runtime settings will be used.
Return Value All results recognized successfully.
Exceptions
Code Snippet
LabelRecognition recognizer = new LabelRecognition();
DMLTSConnectionParameters parameters = new DMLTSConnectionParameters();
parameters.organizationID = "200001";
recognizer.initLicenseFromLTS(parameters, new DLRLTSLicenseVerificationListener() {
@Override
public void LTSLicenseVerificationCallback(boolean isSuccess, Exception error) {
if (!isSuccess) {
error.printStackTrace();
}
}
});
//Generate imageData from somewhere else
DLRResult[] result = recognizer.recognizeByBuffer(imageData, "");
recognizer.destroy();
recognizeByFile
Recognizes text from a specified image file.
DLRResult[] com.dynamsoft.dlr.LabelRecognition.recognizeByFile (String fileName, String templateName) throws LabelRecognitionException
Parameters
fileName
A string defining the file name.
templateName
The template name. A template name is the value of key LabelRecognitionParameter.Name defined in JSON formatted settings. If no template name is specified, current runtime settings will be used.
Return Value All results recognized successfully.
Exceptions
Code Snippet
LabelRecognition recognizer = new LabelRecognition();
DMLTSConnectionParameters parameters = new DMLTSConnectionParameters();
parameters.organizationID = "200001";
recognizer.initLicenseFromLTS(parameters, new DLRLTSLicenseVerificationListener() {
@Override
public void LTSLicenseVerificationCallback(boolean isSuccess, Exception error) {
if (!isSuccess) {
error.printStackTrace();
}
}
});
DLRResult[] result = recognizer.recognizeByFile("full file path", "");
recognizer.destroy();