Documentation
Table of contents

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

LabelRecognitionException

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

LabelRecognitionException

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();

 

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version (3.2.30)
  • Version 3.x
    • Version 3.0.20
  • Version 2.x
    • Version 2.2.20
    • Version 2.0.0
  • Version 1.x
    • Version 1.2.1
    • Version 1.2.0
    • Version 1.0.0
Change +
© 2003–2024 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support