Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, July 10, 2019 1:42:56 PM(UTC)
Marcus Andra

Groups: Registered, Manager, Tech Support, Administrators
Posts: 107

Was thanked: 9 time(s) in 9 post(s)




Why are my inverted regions not being recognized correctly?

LEADTOOLS OCR provides you with the ability to recognize text in a variety of scenarios. Generally text that is to be OCR'd is black text on a white background. There are exceptions to this rule and the LEAD OCR Engine has settings that allows the user to adjust the engine for a variety of different images. One such exception to the rule could be a document that contains black text on a white background as well as white text on a black background. During this scenario, the OCR engine will not, by default, attempt to recognize one of the zones since it is expecting a uniformity with the background and foreground colors. Below is the example of such an image

original.png

As you can see in the following picture, when running the input image through the OCR Demo, only 1 of the 2 words is recognized by the OCR engine. The other is just recognized as a graphics zone which means the OCR engine skips that zone during the recognition process:

Screenshot_1.png

How can I fix this?

You'll want to use the IOcrSettingManager Interface and add the following code after you start the OCR Engine.

Here is one way you can do this:
Code:

ocrEngine.Startup(null, null, null, LEAD_VARS.OcrLEADRuntimeDir); // starts the OCR Engine

IOcrSettingManager settingManager = ocrEngine.SettingManager;
settingManager.SetBooleanValue("Recognition.Preprocess.RemoveInvertedTextRegionsFromProcessImage", true);


Here is how you can test it out and enable it in the OCR Demo:

Screenshot_2.png

Doing this changes the result when reattempting to recognize the original PNG image. You can see in the following screenshot, when enabling this setting and re-running the recognition, both words are recognized and both zones are text-zones.

Screenshot_3.png

For convenience, I have attached a sample application below which can be used to showcase this. If you have any additional questions regarding this forum post, or of anything else not covered please email us at support@leadtools.com.

File Attachment(s):
Inverse OCR.zip (233kb) downloaded 70 time(s).
Marcus Andra
Developer Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.121 seconds.