I'm trying to develop a X-platform tool with Tesseract, but I'm having 
problems.

My Tesseract's API works fine, for example, the next code compiled in C++ 
does work:

tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI();
putenv("TESSDATA_PREFIX=/Users/rafaelruizmunoz/Desktop");
api->Init(NULL, "eng");
api->SetPageSegMode(tesseract::PSM_SINGLE_LINE);
api->SetVariable("tessedit_char_whitelist", "0123456789/");Pix *image = 
pixRead("/Users/rafaelruizmunoz/Desktop/6a00d8341bfb1653ef0192acb84130970d.jpg");
api->SetImage(image);

so, no problem.

Now, I try to implement it for iPhone. From the iPhone I'm passing the path 
where I'm going to store images to then load them with Tesseract (I can't 
pass them from Mat to PIX):

string nameFile = "/tempTime" + to_string(i) + to_string(j) + ".jpg";
string cPathString = folder + nameFile;const char* cPath = cPathString.c_str();

filenameVector.push_back(cPath);
imwrite(cPath, date);

The image is saved sucessfully (imwrite = 1).

But then when I load it as:

tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI();;
api->Init(resourcePath.c_str(), "eng");
api->SetPageSegMode(tesseract::PSM_SINGLE_LINE);
api->SetVariable("tessedit_char_whitelist", "0123456789/");Pix *image = 
pixRead(filenameVector.at(i).c_str());

the image is NULL, and the errors are:

Error in pixReadStreamJpeg: function not present

Error in pixReadStream: jpeg: no pix returned

Error in pixRead: pix not read

Error in pixGetDimensions: pix not defined

Error in pixGetColormap: pix not defined

Error in pixClone: pixs not defined

Error in pixGetDepth: pix not defined

Error in pixGetWpl: pix not defined

Error in pixGetYRes: pix not defined

Please call SetImage before attempting recognition.

I'm pretty sure that the file still exists, because if I do:

Mat matInserted = imread(filenameVector.at(i).c_str());

the matInserted is my image (seen it from debug).

What is going wrong? Thanks.

-- 
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].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/6ddb3ed9-d91d-4daf-801e-1397b944ccee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to