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 : Tuesday, July 4, 2006 1:07:45 AM(UTC)
p.durrant

Groups: Registered
Posts: 13


i currently scan emails for images and ocr them to eliminate spam emails i take the image and do the following

grayscale 8 bit

intensity detect 180/255

save as a 1bit tif, then ocr

which works fine, untill the image is given a coloured background, is there a way of removing the background colour, unfortunatly they are now varying the backgound colour which is making it more difficult

 

 

 

p.durrant attached the following image(s):
treason compact disc.gif
 

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.

#2 Posted : Wednesday, July 5, 2006 9:26:41 PM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,034

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

If the images you get will have varying and unexpected patterns for
backgrounds, then it will not be possible to detect those backgrounds
with LEADTOOLS; at least not without user intervention.  The fact
that the backgrounds contain patterns rather than single colors makes
it difficult to determine whether a pixel is part of the background or the text.

 
#3 Posted : Thursday, July 6, 2006 4:49:32 AM(UTC)
p.durrant

Groups: Registered
Posts: 13


many thanks for the reply, but there was a slight error in the image provided, in that i had saved it as a gif which altered the colours and produced the background pattern, the original is a solid colour, i have managed to work a method of removing the background colour by making some assumptions that if the pixels in the corner regions are of the same RGB value then its reasonable to assume that this is the background colour, then process the image via GDI to remove this colour, if there is a quicker way then running through every pixel that would be better

 

p.durrant attached the following image(s):
!cid_000d01c69f4e$9766098c$afd3333e@zmfy.gif
 
#4 Posted : Saturday, July 8, 2006 10:50:11 PM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,034

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

You can try calling SetRgnColor to create a region that contains all
pixels that belong to background.  I think taking the color of the
pixels on the corners is a good idea.  After the region is created you can simply call Fill to fill it with white for the OCR to work.

 
#5 Posted : Tuesday, July 11, 2006 6:30:27 AM(UTC)
p.durrant

Groups: Registered
Posts: 13


setrgncolor is that in the .Net class ?

 
#6 Posted : Tuesday, July 11, 2006 11:44:35 PM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,034

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

If you are using .NET then call AddColorToRegion.

 
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-2020, Yet Another Forum.NET
This page was generated in 0.193 seconds.