#include <iostream>
#include "cv.h"
#include "highgui.h"
#include </usr/include/tesseract/baseapi.h>
using namespace cv;
using namespace tesseract;
int main()
{
TessBaseAPI *myOCR = new TessBaseAPI();
if (myOCR->Init(NULL, "eng")) {
printf("Could not initialize tesseract.\n");
exit(1);
}
Mat result=imread("Debug/d2form.jpg",0);
myOCR->TesseractRect(result.data,1,result.step1(),0,0,result.cols,result.rows);
const char * text1=myOCR->GetUTF8Text();
string t1(text1);
printf("Text:\n");
printf("%s",t1.c_str());
delete myOCR;
return 0;
}
I have written this code to read a simple binary image (a form). However,
it gives different outputs when run from Eclipse and terminal. Terminal
gives a little better result, Eclipse skips some parts of the text and some
words are worse. I searched the forum but I couldn't find a right answer
for this case. Thanks for any help.
--
--
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
---
You received this message because you are subscribed to the Google Groups
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.