OCR ZONE from TIFF

Discussions about machine vision support in GdPicture.
Post Reply
spighy1980
Posts: 5
Joined: Wed Jun 30, 2010 12:13 pm

OCR ZONE from TIFF

Post by spighy1980 » Wed Jun 30, 2010 12:27 pm

Hi,
I'm working with GdPicture version 6.7.0.0 licensed.
I'm trying to recognize a region from a pdf or tiff file. Reading forum topics, I've found a solution to an entire tiff file but I would like to recognize only the selected area.
How can I resolve my problem?

Any idea would be appreciated.
Best regards,

G. S.

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

Re: OCR ZONE from TIFF

Post by Loïc » Wed Jun 30, 2010 2:20 pm

See: FAQ / How do I perform OCR on a specific zone of an image? from https://www.gdpicture.com/products/plugi ... engine.php

spighy1980
Posts: 5
Joined: Wed Jun 30, 2010 12:13 pm

Re: OCR ZONE from TIFF

Post by spighy1980 » Wed Jun 30, 2010 3:10 pm

Loïc wrote:See: FAQ / How do I perform OCR on a specific zone of an image? from https://www.gdpicture.com/products/plugi ... engine.php
Hi Loic,
first of all, thanks for your quicky reply.
In pdf extraction I do:

Code: Select all

Me.Viewer.SilentMode = True
        ImageID = Me.Viewer.PdfRenderPageToGdPictureImage(200, Me.Viewer.CurrentPage)

        oGDTemp = oGdPictureImaging

        If Me.Viewer.IsRect Then
            Call Me.Viewer.GetRectCoordinatesOnDocumentInches(LeftArea, TopArea, WidthArea, HeightArea)
            Call oGDTemp.SetROI(CInt(LeftArea * 200), CInt(TopArea * 200), CInt(WidthArea * 200), CInt(HeightArea * 200))
        Else
            oGDTemp.ResetROI()
            LeftArea = 0
            TopArea = 0
            WidthArea = 0
            HeightArea = 0
        End If
        sOCR = oGDTemp.OCRTesseractDoOCR(ImageID, TesseractDictionary.TesseractDictionaryItalian, dictonaryFolder, "")
        Me.Viewer.SilentMode = False
The only thing that I understand is that, when I extract from tiff, I must substitute

Code: Select all

Call Me.Viewer.GetRectCoordinatesOnDocumentInches(LeftArea, TopArea, WidthArea, HeightArea)
with

Code: Select all

Call Me.Viewer.GetRectCoordinatesOnDocument(LeftArea, TopArea, WidthArea, HeightArea)
Unfortunatly, when I do the image rendering, imageID is zero.
How I can resolve my problem?

Thanks in advance.

G. S.

spighy1980
Posts: 5
Joined: Wed Jun 30, 2010 12:13 pm

Re: OCR ZONE from TIFF

Post by spighy1980 » Thu Jul 01, 2010 11:00 am

Hi,
I resolved my problem: for Tiff files, I capture ImageId from

Code: Select all

ImageId = oGdPictureImaging.CreateGdPictureImageFromFile(fileName)
and so I can call OCRTesseractDoOCR.

Best regards.

G. S.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest