1. How do I define multiple zones on an image, OCR them all at once, and get the results for each zone separately so that I can save it to a database?
Answer:
There is an example in the OCR demo. You can open the project to see the source code for the demo. To use the demo:
1. |
Load an image. |
2. |
Click Page | Insert Current Page. |
3. |
Either click and drag to create zones manually then click OCR | Recognize Page..., or call OCR | Recognize Page.... This will OCR all zones on the page. |
4. |
Once data is recognized, click OCR | Get Recognized Words to retrieve each word from each zone. |
To get results for each zone separately, include only one zone at recognition time. If you have more than one zone, the save results function will save all zone results to one file. To get each zone result, call L_Doc2GetRecognizedCharacters (OCR Pro). The ppRecogChars will be updated, and you can collect all characters from same zone while ppRecogChars->nZoneIndex member is not changed.
2. How do I define, load, and save templates for different types of forms?
Answer:
There is an example in the OCR demo. You can open the project to see the source code for the demo. To use the demo:
1. |
Load an image. |
2. |
Click Page | Insert Current Page. |
3. |
Either click and drag to create zones manually or call Zone | Find Zones .... This will Create zones on the page automatically. |
4. |
Once the image is zoned, click Zone | Export Zone File... to save the zones to file, or Zone | Load Zone File... to load the zones from disk. |
3. How do I support various European languages?
Answer:
There is an example in the OCR demo. You can open the project to see the source code for the demo. To use the demo:
Choose Language | Select Languages.
4. How do I get a confidence value for each character that is recognized?
Answer:
Refer to the following topic on the LEADTOOLS Support Forum:
https://www.leadtools.com/support/forum/posts/m8966-Postprocessing-in-OCR
Call L_Doc2GetRecognizedCharacters (OCR Pro), and check the nConfidence member in the RECOGCHARS2 (OCR Pro) structure for each character.
5. How do I filter the OCR recognition results to eliminate false characters and increase accuracy?
Answer:
You can filter out false positives by setting the character filter in the ZONEDATA2 (OCR Pro) structure.
For example, if you wish to recognize only numbers, you would set the character filter to recognize numbers only as follows:
ZONEDATA2 ZoneData;
memset(&ZoneData, 0, sizeof(ZONEDATA2));
ZoneData.uStructSize = sizeof(ZONEDATA2);
ZoneData.rcArea.left = 100;
ZoneData.rcArea.top = 100;
ZoneData.rcArea.right = 200;
ZoneData.rcArea.bottom = 200;
ZoneData.FillMethod = DOC2_FILL_DEFAULT;
ZoneData.RecogModule = DOC2_RECOGMODULE_AUTO;
ZoneData.CharFilter = DOC2_ZONE_CHAR_FILTER_NUMBERS;
ZoneData.Type = DOC2_ZONE_FLOWTEXT;
ZoneData.uFlags = 0;
ZoneData.pfnCallback = VerificationCB;
ZoneData.pUserData = NULL;
nRet = L_Doc2AddZone(hDoc, nPageIndex, 0, &ZoneData);
Call L_Doc2UpdateZone (OCR Pro) to update available zones in a specific page.
6. How do I get the co-ordinates of each word recognized, so that I can locate each recognized word on the image?
Answer:
Refer to the following topic on the LEADTOOLS Support Forum:
https://www.leadtools.com/support/forum/posts/m2546-Find-words-in-document-and-highlight-with-annotations
Call L_Doc2GetRecognizedCharacters (OCR Pro) to get each recognized character. Call L_Doc2GetRecognizedWords (OCR Pro) to get a list of all recognized words.
7. How do I output OCR results to memory?
Answer:
There is an example in the OCR Memory demo. You can open the project to see the source code for the demo. The OCRMem demo will save recognition results to memory. To use the demo:
Run the OCR Memory demo
Click File | Open menu, and select your file to open
Click OCR | Add Page menu, to add loaded image to internal OCR document pages.
Click OCR | Recognize menu, to recognize the added page.
Click OCR | Save Results to Memory, then the demo will show all recognition results in a message box.
8. How do I output OCR results to XML?
Answer:
There is an example in the OCR demo. You can open the project to see the source code for the demo. To use the demo:
1. |
Load an image. |
2. |
Click Page | Insert Current Page. |
3. |
Either click and drag to create zones manually then click OCR | Recognize Page..., or call OCR | Recognize Page.... This will OCR all zones on the page. |
4. |
Once data is recognized, click OCR | Save Results. Select XML in the File Formats ComboBox, choose a file name, then click Ok. |
9. How do I output OCR results to image-over-text PDF?
Answer:
There is an example in the OCR File demo. This demo saves to many different formats, one of which is image-over-text PDF. You can open the project to see the source code for the demo.
The OCR File demo saves the recognition result to all supported output formats. Choose the desired output format.
10. How do I add user-defined words to the recognition library?
Answer:
Refer to: Working with a Dictionary
11. How do I recognize magnetic ink (MICR) characters on bank check images?
Answer:
There is an example in the MICR demo. Open the demo project to see the source code for the demo. To use the demo:
1. |
Run the MICR demo |
2. |
Make sure that the zone coordinates that will be added to the page are based on "MICR_SAMPLE.tif" (shipped with the LEADTOOLS setup). |
3. |
When loading other images, update the zone coordinates and build the demo again. |