OCR

Discussions about machine vision support in GdPicture.
Post Reply
flado
Posts: 7
Joined: Wed Jan 20, 2010 1:40 pm

OCR

Post by flado » Wed Jan 20, 2010 2:21 pm

Hi
I am evaluating GdPicture Light Imaging Toolkit Ver. 4.12.5, ActiveX. I develop in Visual DataFlex.

I am trying to use the functions SetROI and OCRTesseractDoOCR to set specific areas in the picture (pdf or TIFF) and OCR those areas.
I show the image in GdViewer and use the left hand tool to draw a rectangle to OCR. I can read those coordinates without trouble, I setROI to those coordinates and the call OCRTesseractDoOcr. However the return value is empty (string). I am using the following code (maybe Visual DataFlex is not known to you but I hope perhaps you can help me anyway):

Code: Select all

            
            Send ComGetRectValues of Self (&iLeft) (&iTop) (&iWidth) (&iHeight) //pixels (self is the GdViewer object)
            Get ComIsRectDrawed of Self to bOK
            If (bOK) Begin //this one is always true
                Send ComSetROI of oComImaging1 iLeft iTop iWidth iHeight //pixels - the values are here integers and are all OK
                Get ComOCRTesseractDoOCR of oComImaging1 OLETesseractDictionaryEnglish "C:\Program Files\GdPicture ToolKit Pro Edition\redist\optional\ocrdata" "" to sOK                
                Send Info_Box sOK "" //the string sOK is always empty here
            End
I hope you can help me.

sincerely
/Leif Angestam
Sweden

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

Re: OCR

Post by Loïc » Wed Jan 20, 2010 3:29 pm

Hi,

Did you loaded the image into the oComImaging1 object ?

IE:

Code: Select all

oComImaging1.SetnativeImage(oComGdViewer.GetNativeImage())
what it the value returned by the GetStat() method after the OCR process ?

Kind regards,

Loïc

flado
Posts: 7
Joined: Wed Jan 20, 2010 1:40 pm

Re: OCR

Post by flado » Wed Jan 20, 2010 4:32 pm

Loïc,
thank you so much for your very fast answer! It works now.
Also, is it possible to set multiple zones on the TIFF or PDF at once, and then OCR all of those zones?
sincerely
/Leif

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests