Hi,
you can try to call SetInputName() before calling GetHOCRText().
Are you using eclipse CDT? If yes it should be straightforward to import
tesseract as a makefile project and debug into the code yourself, if need
be.
Cheers
Renard
Am Sonntag, 18. März 2012 20:24:16 UTC+1 schrieb Jesse Fulton:
>
> Hi all,
>
> (I'm fairly new to Tesseract/Tessbase *and* C++, so sorry in advance
> if any of this is unclear.)
>
> There is an OpenFrameworks addon for Tesseract and I'm trying to add
> HOCR functionality to it. But, whenever I call the GetHOCRText()
> method, the program crashes (the error message is cryptic, but from my
> research, supposedly it's a SIGABRT, or maybe EXC_BAD_ACCESS?) If I
> call GetUTF8Text() it works fine... Here is the code in question:
>
> ==============
> string ofxTesseract::findHOCRText(ofImage& img, ofRectangle& roi) {
> ofPixels& pixels = img.getPixelsRef();
> int bytesPerPixel = pixels.getBytesPerPixel();
>
> tess.SetImage(
> pixels.getPixels(),
> img.getWidth(),
> img.getHeight(),
> bytesPerPixel,
> pixels.getWidth() * bytesPerPixel
> );
>
> tess.SetRectangle(
> roi.x, roi.y,
> roi.width, roi.height
> );
>
> //returns 0
> tess.Recognize(NULL);
>
> //return tess.GetUTF8Text(); // works fine
> return tess.GetHOCRText(0); //crash & burn
>
> }
> ==============
>
> https://github.com/jessefulton/ofxTesseract/blob/master/src/ofxTesseract.cpp
> ("tess" is the tesseract::TessBaseAPI)
>
>
> Any help greatly appreciated!
--
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en