Zonal OCR incorrect characters return

Discussions about machine vision support in GdPicture.
Post Reply
RobertHorn
Posts: 14
Joined: Fri Jan 20, 2012 8:18 am

Zonal OCR incorrect characters return

Post by RobertHorn » Wed Feb 15, 2012 11:15 am

Hi,

I am doing Zonal OCR on documents being printed from a Dot Matrix printer. I have taken the sample code that you created for OCR, and used this in my code. I get the wrong characters returned. I then took your sample program and did it through it. Attached is an image of the area that I am doing the OCR on. The data that I get returned is "INA 73953". The actual data is INA73968. Now if you take a look at it, you can see that the last two digits are 6 and 8. So how did it get 53?

I am also getting other incosistencies. You can see that the character is "0", but it comes up as the degree sign. I scan a "1", and it makes it sigle quote with an L.

The way this is going, I am going to have to find another OCR engine to use, as this is just too unworkable. So please let me know if there is anything that I can do to get this working correctly.
Attachments
OCR.png

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

Re: Zonal OCR incorrect characters return

Post by Loïc » Wed Feb 15, 2012 5:02 pm

Hello,
This input image look poor quality. Could you attach it ? I suppose you have to apply some image processing before trying to get something.

Kind regards,

Loïc

RobertHorn
Posts: 14
Joined: Fri Jan 20, 2012 8:18 am

Re: Zonal OCR incorrect characters return

Post by RobertHorn » Wed Feb 15, 2012 7:09 pm

Hi Loic,

I was not able to upload the document. I have created a link for it:

http://www.linhorn.co.za/Downloads/POD.pdf

I went through all of the image processing that you have in the demo program, and it did change it, but did not give me the data that is listed. The problem really seems to be the dot matrix printing. They say that for good OCR you should scan at 300dpi, but as far as I can recall, the dot matrix printer only prints at not more than 90dpi, or something like that.

Regards
Robert

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

Re: Zonal OCR incorrect characters return

Post by Loïc » Thu Feb 16, 2012 4:34 pm

Hello,

I've managed to get good results:

- Convert to 1bpp (thresold: 175)
- Dilate characters (repeast the operation for high DPI rendering)

Result: INA 73968

Kind regards,

Loïc

RobertHorn
Posts: 14
Joined: Fri Jan 20, 2012 8:18 am

Re: Zonal OCR incorrect characters return

Post by RobertHorn » Mon Feb 27, 2012 2:37 pm

HI Loic,

I am having problems trying to get the same results here.

I do the following on the image:

oGdPictureImaging.ConvertTo1Bpp(ImageID, 175)
oGdPictureImaging.FxDilate(ImageID)

The moment I do FXDilate, it goes very faint, and you can hardly see anything. I have tried to use FxBlackNWhiteT(ImageID, 170) instead of ConvertTo1Bpp, but it did the same.

Can you let me know what I am doign wrong here?

SamiKharma
Posts: 352
Joined: Tue Sep 27, 2011 11:47 am

Re: Zonal OCR incorrect characters return

Post by SamiKharma » Mon Feb 27, 2012 4:06 pm

Hi,

First you convert the image to 1bpp, making it a bitonal image, for that you need to use one of our Bitonal Dilate Methods here:
https://www.gdpicture.com/guides/gdpicture/v8/html/con ... teger.html
https://www.gdpicture.com/guides/gdpicture/v8/html/con ... teger.html
https://www.gdpicture.com/guides/gdpicture/v8/html/con ... teger.html

That should solve it for you,
Best Regards,
Sami

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest