yes new eng.traineddata has length 21,876,572.

I created test file (in attachment) and calling API with:
myTess->Init(NULL, "eng", tesseract::OEM_DEFAULT, NULL, 0, false);
it throw error:
test_302.cpp:22:69: error: no matching function for call to
‘tesseract::TessBaseAPI::Init(NULL, const char [4],
tesseract::OcrEngineMode, NULL, int, bool)’
test_302.cpp:22:69: note: candidates are:
/usr/local/include/tesseract/baseapi.h:199:7: note: int
tesseract::TessBaseAPI::Init(const char*, const char*,
tesseract::OcrEngineMode, char**, int, const GenericVector<STRING>*, const
GenericVector<STRING>*, bool)
/usr/local/include/tesseract/baseapi.h:199:7: note:   candidate expects 8
arguments, 6 provided
/usr/local/include/tesseract/baseapi.h:204:7: note: int
tesseract::TessBaseAPI::Init(const char*, const char*,
tesseract::OcrEngineMode)
/usr/local/include/tesseract/baseapi.h:204:7: note:   candidate expects 3
arguments, 6 provided
/usr/local/include/tesseract/baseapi.h:207:7: note: int
tesseract::TessBaseAPI::Init(const char*, const char*)
/usr/local/include/tesseract/baseapi.h:207:7: note:   candidate expects 2
arguments, 6 provided

If I provide 8,3 or 2 arguments it works ok...

Zdenko

2012/2/5 Patrick Questembert <[email protected]>

> Why r527 and not the latest? Is it possible that r527 is not compatible
> with the 3.02 training data? Then again, I AM using the latest sources and
> get the same error.
> Zdenko: I am using the traineddata file from SVN, it is possible you are
> using a different file? The one I am using has a length of 21,876,572
>  bytes.
>
> Patrick
>
>
> On Sun, Feb 5, 2012 at 11:14 AM, Sriranga(78yrsold) <
> [email protected]> wrote:
>
>> Also tested in the r-527 using the eng.trainedata of ver 3.02.  I got
>> error message vide screenshot attached which is self explanatory.
>> -sriranga(79yrs)
>>
>> On Sun, Feb 5, 2012 at 8:52 PM, zdenko podobny <[email protected]> wrote:
>>
>>> Just quick tests:
>>>
>>> I am able to run 'tesseract eurotext.tif eurotext' (it use
>>> eng.traineddata) and I got result on linux without any problem...
>>> Can you verify downloaded file? In attachment you can find my md5
>>> checksum...
>>> tesseract 3.02 works also with 3.01 data file (as I tested it on linux),
>>> so try to use 3.01 eng.traineddata... If it do not work so I guess problem
>>> is not in 'eng.traineddata'...
>>>
>>>
>>>  2012/2/5 Patrick Questembert <[email protected]>
>>>
>>>> This is running on iOS, within an app which has been running perfectly
>>>> with Tesseract 2.04, 3.00 and 3.01 using the same init with lang API with
>>>> eng.traineddata
>>>> It's clearly not an issue of not being able to locate the file, the
>>>> assert appears to state that the training set is inconsistent in terms of
>>>> expected number of entries.
>>>>
>>>> The API call is: myTess->Init(tessDataDir.c_str(), language,
>>>> OEM_DEFAULT, NULL, 0, false);
>>>>
>>>> Thanks,
>>>> Patrick
>>>>
>>>> 2012/2/5 Zdenko Podobný <[email protected]>
>>>>
>>>>>  Can you please provide more details (OS, compiler, how to run/use
>>>>> tesseract)?
>>>>>
>>>>>  Zdenko
>>>>>
>>>>> Dňa 05.02.2012 15:38, patrickq  wrote / napísal(a):
>>>>>
>>>>> I am running the latest Tess 3.02 with the new English training set
>>>>> and get the following crash at init with lang:
>>>>>
>>>>> actual_tessdata_num_entries_ <= TESSDATA_NUM_ENTRIES:Error:Assert
>>>>> failed:in file tessdatamanager.cpp, line 48
>>>>>
>>>>> Has anyone seen this?
>>>>>
>>>>> Note: I am not using the cube version, just "eng" with eng.traineddata
>>>>>
>>>>> By the way: I noticed the new training set is 21.9MB versus 3.1MB for
>>>>> Tesseract 3.01: just more fonts added or something else too?
>>>>>
>>>>> Thanks,
>>>>> Patrick
>>>>>
>>>>>
>>>>>   --
>>>>> 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
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Patrick Questembert, *ScanBizCards*
>>>> +1-917-250-4177 | www.scanbizcards.com
>>>> twitter.com/ScanBizCards | www.facebook.com/ScanBizCards
>>>>
>>>>  --
>>>> 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 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 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
>>
>
>
>
> --
> Patrick Questembert, *ScanBizCards*
> +1-917-250-4177 | www.scanbizcards.com
> twitter.com/ScanBizCards | www.facebook.com/ScanBizCards
>
>  --
> 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 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
/*
 * $ g++ -o test_302 test_302.cpp -I/usr/local/include/tesseract/ -I/usr/local/include/leptonica/ -L/usr/local/libs -ltesseract
 * $ ./test_302
*/

#include <baseapi.h>
#include <allheaders.h>

Pix *pix;
int offset;
float slope;

int main(int argc, char *argv[]) {
    tesseract::TessBaseAPI *myTess = new tesseract::TessBaseAPI();
    printf("Tesseract-ocr version: %s\n",
           tesseract::TessBaseAPI::Version());
    printf("Leptonica version: %s\n",
           getLeptonicaVersion());
    
    pix = pixRead("phototest.tif");
    //myTess->Init(tessDataDir.c_str(), language, OEM_DEFAULT, NULL,	0, false);
    myTess->Init(NULL, "eng", tesseract::OEM_DEFAULT, NULL, 0, false);
    //myTess->Init(NULL, "eng", tesseract::OEM_DEFAULT, NULL, 0, NULL, NULL, false);
    myTess->SetImage(pix);
    
    char* outText = myTess->GetUTF8Text();
    printf("OCR output:\n\n");
    printf(outText);

    myTess->Clear();
    myTess->End();
    delete [] outText;
    pixDestroy(&pix);    
    return 0;
}

Reply via email to