ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Remove color
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aleatprog

104 Posts

Posted - Nov 18 2022 :  07:43:31  Show Profile  Reply
Hi,

I need to automatically preprocess color scans in order to get the cleanest text for extraction.



Text recognition fails because the red line is too close to the text. Therefore, I tried to remove all red pixels using Proc.CastColorRange, but its tolerance starts to remove grey text pixels before all red pixels are removed. I tried also to clean up and increase image quality by implementing other preprocessing stages using AdjustBrightnessContrastSaturation, ConvertToGray & BN, WhiteBalance_AutoWhite, RemoveNoise, but all results got a poor or unstable recognition precision.

Has anybody an idea with which function the light red pixels can be removed by code without decreasing the text quality?

Al

xequte

7376 Posts

Posted - Nov 18 2022 :  17:28:34  Show Profile  Reply
Hi Al

Yes, that is not an easy document to scan. I would try parsing the scanlines yourself to find "Reddish" pixels, e.g. where R > 200, G < 100, B < 100, and make them white.

See the example at:

http://www.imageen.com/help/TIEBitmap.Scanline.html


If that is successful in nullifying the red pixels, then you might also then need to do some thresholding to try to increase the contrast between the text and the background.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: