Hello,

I am newbie with Tesseract. Today I try to run the simple example:

#include <baseapi.h>
#include <allheaders.h>
#include <sys/time.h>
int main() {
        // [1]
        tesseract::TessBaseAPI *myOCR = 
                new tesseract::TessBaseAPI();

        // [2]
        printf(“Tesseract-ocr version: %s\n”,
               myOCR->Version());
        printf(“Leptonica version: %s\n”,
               getLeptonicaVersion());

        // [3]
        if (myOCR->Init(NULL, “eng”)) {
          fprintf(stderr, “Could not initialize tesseract.\n”);
          exit(1);
        }

        // [4]
        Pix *pix = pixRead(“phototest.tif”);
        myOCR->SetImage(pix);

        // [5]
        char* outText = myOCR->GetUTF8Text();
        printf(“OCR output:\n\n”);
        printf(outText);

        // [6]
        myOCR->Clear();
        myOCR->End();
        delete [] outText;
        pixDestroy(&pix);
        return 0;
}
In Visual studio 2010. But I get the error exception at line "delete [] 
outText;" it's weird since as documentation it should be deleted after use.
Please advise.
Thanks.


-- 
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

Reply via email to