Hi all,
I am trying to improve my ocr algorithm and to do that I need to pre processing the image with AForge. I would like to know a sequence filters to "get only the red and black text". I tried a lot of filter but no success with any.
![]() |
|
|||||
|
||||||
Get only red and black
8 posts
• Page 1 of 1
Get only red and blackHi all,
I am trying to improve my ocr algorithm and to do that I need to pre processing the image with AForge. I would like to know a sequence filters to "get only the red and black text". I tried a lot of filter but no success with any.
Re: Get only red and blackeasy to do
Absolute Black means the R & G & B value are 0. but in a photo they never reach to 0, but have a very low value like 10 or 20. I recommend you read the photo pixel by pixel and check if the pixels have low value for RGB or not. you can define a range like 0~50 to check too. Also it is possible with Aforge.net libraries.
Re: Get only red and blackThanks for the response. Which way do you think that I can get the best performance of ocr (I want to read only black/grey and red letters)?
Re: Get only red and black
i'm not a professional programmer. but you can read letters with a special color by pixel to pixel reading method. it is easy to do. but if your images have huge size, the code can get slow. you can try to check it.
Re: Get only red and blackHello,
Check pixel filtering by color. You can set a range for black-ish pixels and then fill everything out of that range with white color, for example.
Re: Get only red and black
Thanks Andrew, but I tried with all of the filters and the best result that I had is with Euclidean filter but I am having problem with the first line of the document "VALIDA EM TODO TERRITORIO NACIONAL" .
Re: Get only red and blackIf you always have same type/structure of documents, then you know roughly position of the first line, which has slightly different color. In this case you may apply different filter (or same filter with different settings) to that rectangle. Later you can combine both results.
Re: Get only red and black
Hi Andrew, Thanks, but It's not the same image. The user capture those images (I attached two images to clarify).
8 posts
• Page 1 of 1
|
![]() |
|