layout | title | description | keywords | needAutoGenerateSidebar | permalink |
---|---|---|---|---|---|
default-layout |
Recognizing - Dynamsoft Label Recognition iOS API Reference |
This is the recognizing functions of Dynamsoft Label Recognition for iOS API Reference. |
api reference, objective-c, oc, swift |
true |
/programming/objectivec-swift/api-reference/methods/recognizing-v1.0.html |
You are viewing a history document page of Dynamsoft Label Recognizer iOS v1.x.
Method | Description |
---|---|
recognizeByBuffer |
Recognizes text from memory buffer containing image pixels in defined format. |
recognizeByFile |
Recognizes text from a specified image file. |
Recognizes text from the memory buffer containing image pixels in defined format.
- (NSArray<iDLRResult*>*)recognizeByBuffer:(iDLRImageData*)imageData templateName:(NSString*)templateName error:(NSError**)error
Parameters
[in] imageData
An object of iDLRImageData 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.
[in,out] error
Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.
Return Value All results recognized successfully.
Code Snippet
>- Objective-C >- Swift > >1. ```objc DynamsoftLabelRecognition *recognizer; recognizer = [[DynamsoftLabelRecognition alloc] initWithLicense:@"t0260NwAAAHV***************"]; iDLRResult *result; iDLRImageData *imageData = [[iDLRImageData alloc] init]; //construct imageData NSError __autoreleasing * error; result = [recognizer recognizeByBuffer:imageData templateName:@"" error:&error]; ``` 2. ```swift let recognizer = DynamsoftLabelRecognition.initWithLicense(license: "t0260NwAAAHV***************") let imageData = iDLRImageData.init() let error: NSError? = NSError() //construct imageData let result = recognizer.recognizeByBuffer(imageData:imageData, templateName:"", error:&error) ```
Recognizes text from a specified image file.
- (NSArray<iDLRResult*>*)recognizeByFile:(NSString*)name templateName:(NSString*)templateName error:(NSError**)error
Parameters
name
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.
[in,out] error
Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.
Return Value All results recognized successfully.
Code Snippet
>- Objective-C >- Swift > >1. ```objc DynamsoftLabelRecognition *recognizer; recognizer = [[DynamsoftLabelRecognition alloc] initWithLicense:@"t0260NwAAAHV***************"]; iDLRResult *result; NSError __autoreleasing * error; result = [recognizer recognizeByFile:@"your file path" templateName:@"" error:&error]; ``` 2. ```swift let recognizer = DynamsoftLabelRecognition.initWithLicense(license: "t0260NwAAAHV***************") let error: NSError? = NSError() //construct imageData let result = recognizer.recognizeByFile("your file path", templateName:"", error:&error) ```