This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, July 4, 2006 1:02:45 AM(UTC)
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):
#2
Posted
:
Wednesday, July 5, 2006 9:21:41 PM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 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:44:32 AM(UTC)
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):
#4
Posted
:
Saturday, July 8, 2006 10:45:11 PM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 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:25:27 AM(UTC)
Groups: Registered
Posts: 13
setrgncolor is that in the .Net class ?
#6
Posted
:
Tuesday, July 11, 2006 11:39:35 PM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 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.