opencv - tesseract differet results between shell and c++ launch -


I am trying to use tesseract OCR inside the c ++ software I command line "Tessaract IMGTF Text-L I have been successful in launching taser from Shell using FRA-PSM1 hokra, I get good results, but when Tescert BaseP (more portable to create software) I have some poor results: On an image, I 160 Out of 137 words, And revealed the words is not as good as they used to do (ie they are not always right and are unwanted symbols). So my goal is to give at least one result, but I do not understand why they are different

So my question is "tesseract img.tif text -l fra -psm 1 hocr" ? Up to now, I am using the code given below, which uses OpenCV to read the image:

  Mat img = imread (img.tif, CV_LOAD_IMAGE_GRAYSCALE); // Load grayscale image tesseract :: TessBaseAPI tess; Tess.Init (NULL, "FAA", Tesserct :: OEM_DEFAULT); // matches- L FRA fromcommand line, I think the OEM_default was used by the command line? Tess.SetPageSegMode (Tesseract :: PSM_AUTO); // matches- tess.SetImage from psm 1 command line ((uchar * img.data, img.cols, img.rows, 1, img.cols); // Define the image string text = tess.GETHOCRText (0); // Get the result in the text  

So I thought I have translated many options, but given a slightly different result I think I am not doing it properly. Is this program giving me a grayscale image, whereas in the command line is this a color image? If yes, how can I set a color image for text recognition? If there are some ways to read OpenCV library exams, then give directly to the path of the image so that TESTRECT can use its device. I would be happy to use it too!

I am using Tumbutu 13.10 and Tesseract 3.02.01

Alexis


Comments