Binarization question

Discussions about image processing and document imaging.
emar
Posts: 12
Joined: Fri Feb 22, 2013 12:03 pm

Binarization question

Post by emar » Fri Feb 22, 2013 1:03 pm

I am trying to binarize color image of some document produced by digital camera. I tried all ConvertTo1BppXX procedures, but all of them lose significant parts of document information. The document itself, probably, too dark (I mean document background is not white but gray), but in the same time it is readable well. What is the best way to do convert such images?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Binarization question

Post by Loïc » Fri Feb 22, 2013 1:13 pm

Hello,

Could you attach an example of such document?

Kind regards,

Loïc

emar
Posts: 12
Joined: Fri Feb 22, 2013 12:03 pm

Re: Binarization question

Post by emar » Fri Feb 22, 2013 1:48 pm

See attached document, please.
Attachments
img_101495455004512479694874535.jpg

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Binarization question

Post by Loïc » Fri Feb 22, 2013 3:56 pm

Hello,

The quality of the image is definitively too poor to get something acceptable with linear or adaptive thresholding method.

What I can suggest is to dither input image in order to be able to retain characters contours.

IE:

Code: Select all

int imageID = oGdPictureImaging.CreateGdPictureImageFromFile("c:\\img_101495455004512479694874535.jpg");
oGdPictureImaging.FxBlackNWhite(m_imageID , BitonalReduction.Burke);
oGdPictureImaging.ConvertTo1BppFast(m_imageID );
This should provide such result:
dithering.png
Let me know your thoughts.

Kind regards,

Loïc

emar
Posts: 12
Joined: Fri Feb 22, 2013 12:03 pm

Re: Binarization question

Post by emar » Fri Feb 22, 2013 4:11 pm

I have attached binarized image produced with another software. These software doesn't have dotNET implementation and this is the reason why we are looking for its replacement. But binarization is one of the must features we are looking for.
Thank you.
Attachments
img_101495455004512479694874535.tif
img_101495455004512479694874535.tif (28.22 KiB) Viewed 8532 times

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Binarization question

Post by Loïc » Fri Feb 22, 2013 4:32 pm

Hello,

Are you sure you've obtained the tif document from the .jpg bitmap with your other software?

if yes, could you share a snippet?

Kind regards,

Loïc

emar
Posts: 12
Joined: Fri Feb 22, 2013 12:03 pm

Re: Binarization question

Post by emar » Sun Feb 24, 2013 11:00 am

The are is nothing to share. It has very special function called AdvancedBinarize for hard cases like that. It doesn't accept any parameters. That's it. But it works very accurate. Sometimes it produces too much black dots, but at least data never lost and a background is always white. Do you think GDPicture can reproduce such behavior?

Thank you.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Binarization question

Post by Loïc » Sun Feb 24, 2013 1:44 pm

Hello,

OK thank you for the info. But my question still remains: "Are you sure you've obtained the tif document from the .jpg bitmap with your other software?"

The jpeg compression is lossy, so I have a serious doubt that you can obtain the tiff content result from the jpeg content source you've provided. This is why I've asked for a snippet, to check that you open the attached jpeg (and not other format such tiff or png).

Kind regards,

Loïc

emar
Posts: 12
Joined: Fri Feb 22, 2013 12:03 pm

Re: Binarization question

Post by emar » Sun Feb 24, 2013 2:10 pm

Hello,
Yes it is. The tif document was definitely obtained from the .jpg bitmap which I sent you.
As far as I understand, it suppresses(filters) smooth background and highlights everything which is not background.
Thank you.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Binarization question

Post by Loïc » Sun Feb 24, 2013 4:50 pm

Thank you for the info. We are internally working on the problematic. I will get back to you soon with a solution.

Kind regards,

Loïc

emar
Posts: 12
Joined: Fri Feb 22, 2013 12:03 pm

Re: Binarization question

Post by emar » Sun Mar 03, 2013 6:29 pm

Hello,
May I expect to any solution for my question?
Thank you.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Binarization question

Post by Loïc » Sun Mar 03, 2013 9:28 pm

Hello,

Yes, we've obtained quite good results by implementing Sauvola local adaptive thresholding method + contrast normalization. The feature is implemented in the 9.4 that will be published tomorrow. It will also include an example of usage.

Kind regards,

Loïc

emar
Posts: 12
Joined: Fri Feb 22, 2013 12:03 pm

Re: Binarization question

Post by emar » Mon Mar 04, 2013 6:28 pm

Thank you. Could you inform me when you will publish it?

Cedric
Posts: 269
Joined: Sun Sep 02, 2012 7:30 pm

Re: Binarization question

Post by Cedric » Mon Mar 04, 2013 7:41 pm

Hi!
It's online! You can download it here: https://www.gdpicture.com/download.php

Cheers!

emar
Posts: 12
Joined: Fri Feb 22, 2013 12:03 pm

Re: Binarization question

Post by emar » Mon Mar 04, 2013 7:46 pm

How can I get new evaluation key?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests