OCRTesseractGetOrientation issue

Discussions about machine vision support in GdPicture.
Post Reply
Sashi
Posts: 1
Joined: Tue Apr 14, 2009 10:08 am

OCRTesseractGetOrientation issue

Post by Sashi » Wed Apr 22, 2009 5:01 pm

Hello,

I'm downloaded the trial version of GDPicture.NET to processe images and I would like to rotate scanned images and crop them to reduce the images size.

I would like to use the OCRTesseractGetOrientation function, but it doesn't seems to work : here's my code :

Code: Select all

gdPI.OCRTesseractReinit();
            gdPI.OCRTesseractClear();
            gdPI.OCRTesseractSetPassCount(2);
            string sOCR = gdPI.OCRTesseractDoOCR(m_CurrentImage, GdPicture.TesseractDictionary.TesseractDictionaryFrench, @"C:\Program Files\GdPicture.NET\Redist\OCR\","abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890");

            RotateFlipType Rotate = gdPI.OCRTesseractGetOrientation(m_CurrentImage, GdPicture.TesseractDictionary.TesseractDictionaryFrench, @"C:\Program Files\GdPicture.Net\Redist\");
            gdPI.Rotate(m_CurrentImage, Rotate);

I assume that using DoOCR isn't really usefull, but it doen't work anyway (with or without). When i debug, VC# says that Rotate's value is RotateNoneFlipNone, but the picture is effectively crooked. So what did I do wrong? (I used the same serial number for the Tesseract Plugin than for GdPicture. Is that a real problem?)

Thank you very much for your answers.

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

Re: OCRTesseractGetOrientation issue

Post by Loïc » Wed Apr 22, 2009 9:10 pm

Hi,

2 remarks.

1- the ocr dictionary path is C:\Program Files\GdPicture.NET\Redist\OCR\

2 - If the rotation of the page is 90 degree you have to rotate it to 270° to get the page in it's correct orientation.


And yes, the call to OCRTesseractDoOCR is not useful.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests