Faster Recognition and Word Spelling Correction with Dynamsoft Label Recognizer 2.0
We have been cultivating a long-time interest in the field of optical character recognition (OCR).
Today, we are excited to announce Dynamsoft Label Recognizer 2.0, which is revolutionary to version 1.0 in its ability to detect and recognize text in images.
Highlighted Features
Dynamsoft Label Recognizer 2.0 integrates OpenCV DNN to speed up the recognition process and supports custom dictionary functionality to correct word spelling errors.
Speeding Up Inference with OpenCV DNN Module on CPU
The OpenCV DNN inference is fast on CPU. We use the OpenCV DNN module for loading pre-trained Caffe model to improve the overall performance. DLR 2.0 is 2x faster than DLR 1.0.
Example for Passport MRZ Recognition
Here is a passport image.
We use Dynamsoft Label Recognizer to get the OCR results.
The performance comparison between DLR 1.x and DLR 2.x is as follows:
Version | Recognition time |
v1.2.1 | 0.785367 s |
v2.0.0 | 0.391825 s |
Custom Dictionary for Word Correction
The new custom dictionary functionality allows users to correct typos.
Example for Nutrition Label Recognition
Assume you have a label with some nutrition ingredients, such as “selenium, chitosan”.
The printed words are “seleniun, chitosam” in the image.
We use Dynamsoft Label Recognizer to get the OCR results.
To correct the typos, we pre-define “ selenium, chitosan” in a dictionary.txt file:
selenium
chitosan
Then use the following code to load the custom dictionary:
DLR_RuntimeSettings *pSettings = new DLR_RuntimeSettings();
dlr.GetRuntimeSettings(pSettings);
memcpy(pSettings->dictionaryPath, "dictionary.txt", 256);
char errorMessage[512];
dlr.UpdateRuntimeSettings(pSettings, errorMessage, 512);
delete pSettings;
Afterwards, we re-run the application. Now you can see the typos have been fixed in output results.
Key Changes
Dynamsoft Label Recognizer v2.0 includes a variety of changes.
Here are the most important changes you should understand for developing your OCR applications.
Header files
Index | v1.x | v2.x |
---|---|---|
1 | DynamsoftCommon.h |
DynamsoftCore.h |
2 | DynamsoftLabelRecognition.h |
DynamsoftLabelRecognizer.h |
Library files
Index | v1.x | v2.x |
---|---|---|
1 | DynamsoftLabelRecognitionx64.dll |
DynamsoftLabelRecognizerx64.dll |
2 | DynamsoftLabelRecognitionx64.lib |
DynamsoftLabelRecognizerx64.lib |
3 | libDynamsoftLabelRecognition.so |
libDynamsoftLabelRecognizer.so |
APIs
Index | v1.x | v2.x |
---|---|---|
1 | class CLabelRecognition |
class CLabelRecognizer |
2 | DLR_OK |
DM_OK |
3 | GetAllDLRResults() |
GetAllResults() |
4 | struct DLRResult |
struct DLR_Result |
5 | FreeDLRResults() |
FreeResults() |
6 | struct DLRPoint |
struct DM_Point |
Release Notes
https://www.dynamsoft.com/label-recognition/programming/c-cplusplus/release-notes
Online Documentation
https://www.dynamsoft.com/label-recognition/programming/
Sample Code
https://www.dynamsoft.com/label-recognition/code-gallery/
Try Online Demo
https://demo.dynamsoft.com/id-scanning/machine-readable-passport.html