Getting the best out of OCR!

Discussions about machine vision support in GdPicture.
Post Reply
Nigels
Posts: 28
Joined: Tue Jul 08, 2008 4:23 pm

Getting the best out of OCR!

Post by Nigels » Tue May 12, 2009 5:49 pm

Hi

I have been evaluating the OCR engine and am generally very impressed with it.

From reading the various issues around the OCR engine on the forum I have noticed a few “tips” on how to increase the performance of the recognition process have been posted by Loic. These have included increasing the image size, converting the image to 1bpp and applying the dilate4 filter. I noticed on one post Loic mentioned doing the OCR, manipulating the image, then doing the OCR agian and seeing which gave the best results.

Does a document/web page exist that outlines how to get the best out of the OCR engine (IE using above techniques + others) and even what is considered to be a “reliable” confidence level (the documents I have been testing with rarely give a better level than 40 although the OCR does generally seem to be quite good!)? If not, could you outline the best methods please, although I guess the method of doing this will depend on whether response is an issue or not?

Many thanks

Nigel

Slava
Posts: 66
Joined: Fri Jun 22, 2007 4:43 pm

Re: Getting the best out of OCR!

Post by Slava » Tue May 12, 2009 8:35 pm

Hi Nigel,

I have just been doing some tests today. So far I get the best results with (for standard color A4 pages @ 300dpi):

Code: Select all

Imaging.SetSaturation(-95)
Imaging.SetContrast(50)
Imaging.ConvertTo1Bpp()
Imaging.FxDilateV()
Give it a try, hope this helps you.

I will do more testing next week, maybe I'll write a tiny app that can compare results using different filters.

Slava

Nigels
Posts: 28
Joined: Tue Jul 08, 2008 4:23 pm

Re: Getting the best out of OCR!

Post by Nigels » Thu May 14, 2009 4:59 pm

Hi Slava

Thank you for the ideas, it all helps!

I have now spent a day testing and am generally coming to the conclusion that it seems to be different for almost every document (and even different regions on the same document).

Even on the same document I can make changes to the image (saturation, contrast, BPP, various FX) and the confidence level of some characters get better and others get far worse. I even have an example where a character is being read incorrectly, I manipulate the image, re-OCR it and it gets the character right but with a worse confidence level! Arghhhh!

In a lot of cases I have found fxDespeckle and fxSharpen help – but on other documents it makes it far worse!

The problem is that there does not seem to be anything that you can detect from the image to tell which manipulations will help make the OCR any better!

Out of interest, what confidence levels do you get when doing the OCR. I never get better than about 25 (so 75% good), with an average of about 35. I do not know if this is a good level or not!

Having said all of this, overall I think it does a great job!

Cheers and thanks for you help

Nigel

Larry
Posts: 1
Joined: Wed Jun 24, 2009 3:20 pm

Re: Getting the best out of OCR!

Post by Larry » Wed Jun 24, 2009 5:41 pm

Hi,

I have been testing the GdPicture Light Imaging Toolkit and the GdPicture Tesseract Plugin and I would like to know if anyone has any tips on speeding up the OCR recognition rate. The accuracy seems OK right now. I have written an app in VB6 that uses a Logitech webcam and captures a frame using VideoCapX, places it in an Image Control and also saves it as a jpeg. The app is driven by a machine running at up to 2 cycles per second with up to four images per cycle. I now want to perform OCR on the images(on 8 images per second with up to 150 characters per image).

I have been testing by simply looking at a jpeg image with 75 characters with the Imaging1.OCRTesseractDoOCR(TesseractDictionaryEnglish, conLocation & "OCR") function. By rough calculations it is processing at 440 milliseconds. Ideally I'd like it to process at about 30 milliseconds but I'll take what I can get.

Would GdPicture Pro work better?
Is it possible and faster to perform the OCR before it converts the video frame to a jpeg?
Would .bmp or .png process faster?

Thank you,

Larry

Below are my PC specs.

OS Name Microsoft Windows XP Professional
Version 5.1.2600 Service Pack 3 Build 2600
OS Manufacturer Microsoft Corporation
System Manufacturer Unknow
System Model Unknow
System Type X86-based PC
Processor x86 Family 6 Model 15 Stepping 11 GenuineIntel ~2333 Mhz
BIOS Version/Date Phoenix Technologies, LTD 6.00 PG, 12/20/2007
SMBIOS Version 2.5
Windows Directory C:\WINDOWS
System Directory C:\WINDOWS\system32
Boot Device \Device\HarddiskVolume1
Locale United States
Hardware Abstraction Layer Version = "5.1.2600.5512 (xpsp.080413-2111)"
Time Zone Central Daylight Time
Total Physical Memory 1,024.00 MB
Available Physical Memory 427.66 MB
Total Virtual Memory 2.00 GB
Available Virtual Memory 1.96 GB
Page File Space 2.11 GB
Page File C:\pagefile.sys

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests