Where do I find the value of TESSDATA_PREFIX? 

On Saturday, August 24, 2019 at 7:34:00 PM UTC+2, Clint William Theron 
wrote:
>
> I don't know where to find the TESSDATA_PREFIX value since I'm using 
> tesseract CDN on a http web server. What did you do? Did you create a 
> node.js app? I install tesseract in windows 10 and I replaced the 
> traineddata file in the tessdata  directory and it worked. I'm looking to 
> build an online solution though. I got started and found out about the 
> custom traineddata idea from the following link:
>
>
> https://ourcodeworld.com/articles/read/580/how-to-convert-images-to-text-with-pure-javascript-using-tesseract-js
>
> It's not necessary to use the CDN or even a html web page. The solution 
> should just work online and use my custom traineddata language
>
> On Saturday, August 24, 2019 at 7:13:01 PM UTC+2, shree wrote:
>>
>> I have not used tesseract CDN on a http web server in a html web page. 
>>
>> The error says that the traineddata file cannot be found. You need to 
>> check the value of TESSDATA_PREFIX and put your custom traineddata there.
>>
>> On Sat, 24 Aug 2019, 22:28 Clint William Theron, <[email protected]> 
>> wrote:
>>
>>> The traineddata file is available in that location. I took a screenshot 
>>> of the current error:
>>>
>>> [image: Untitled.png]
>>> I changed the name to custom.traineddata but it's not relevant to the 
>>> problem. I also changed the location of the file to see if that makes a 
>>> different but didn't:
>>>
>>> const worker = new Tesseract.TesseractWorker({
>>>                   langPath: 'https://iclips.co.za/images/tessdata/',
>>>                 });
>>>
>>> worker.recognize(cameraSensor2.toDataURL('image/png'), 'custom')...
>>>
>>> Do you see what I'm missing here?
>>> Thanks already
>>> On Saturday, August 24, 2019 at 4:44:12 PM UTC+2, shree wrote:
>>>>
>>>> Check that mycustom.traineddata is available in 
>>>> https://lottoticketscanner.iclips.co.za/assets/tesseract/tessdata/
>>>>
>>>> On Sat, Aug 24, 2019 at 7:02 PM Clint William Theron <
>>>> [email protected]> wrote:
>>>>
>>>>> Thanks for your answer. I have a different error though. I'm not sure 
>>>>> what you mean by tessdata folder. I'm using the tesseract CDN on a http 
>>>>> web 
>>>>> server in a html web page. The following images illustrates my current 
>>>>> problem: 
>>>>>
>>>>> [image: Untitled.jpg]
>>>>>
>>>>> [image: Untitled.png]
>>>>>
>>>>>
>>>>> The first image illustrates the type of server and directory structure 
>>>>> I'm using and the second image shows the error. What is the resolution? I 
>>>>> know I'm close now though, thanks to you.
>>>>>
>>>>> My current code looks like so:
>>>>>
>>>>> html
>>>>> <script src="
>>>>> https://unpkg.com/[email protected]/dist/tesseract.min.js";
>>>>> ></script>
>>>>>
>>>>> js
>>>>> const worker = new Tesseract.TesseractWorker({
>>>>>     langPath: '
>>>>> https://lottoticketscanner.iclips.co.za/assets/tesseract/tessdata/',
>>>>> });
>>>>>
>>>>>
>>>>> worker.recognize(cameraSensor2.toDataURL('image/png'), 'mycustom')
>>>>>                         .progress(progress => console.log('progress', 
>>>>> progress))
>>>>>                         .then(result => console.log('result', result))
>>>>>                         .finally(() => worker.terminate());
>>>>>
>>>>> Thank you.                    
>>>>>
>>>>> On Saturday, August 24, 2019 at 5:56:30 AM UTC+2, shree wrote:
>>>>>>
>>>>>> You can name your custom traineddata file with a different name eg. 
>>>>>> mycustom.traineddata, copy the file to your tessdata folder (referred by 
>>>>>> tessdata_prefix) and then use 'mycustom' instead of 'eng' in your 
>>>>>> program.
>>>>>>
>>>>>> On Sat, 24 Aug 2019, 09:13 Clint William Theron, <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hi. I have a web-app and I'm using the Tesseract CDN like so:
>>>>>>>
>>>>>>> <script src="
>>>>>>> https://unpkg.com/[email protected]/dist/tesseract.min.js
>>>>>>> "></script>
>>>>>>>
>>>>>>>
>>>>>>> I then try to add the path to my own created traineddata language 
>>>>>>> like so:
>>>>>>>
>>>>>>> const worker = new TesseractWorker({
>>>>>>>     langPath: '
>>>>>>> https://lottoticketscanner.iclips.co.za/assets/tesseract/langs-folder/
>>>>>>> ',
>>>>>>> });
>>>>>>>
>>>>>>> and finally I call the recognize method like so:
>>>>>>>
>>>>>>> worker.recognize(canvas.toDataURL('image/png'), 'eng')
>>>>>>>                         .progress(progress => console.log('progress'
>>>>>>> , progress))
>>>>>>>                         .then(result => console.log('result', result
>>>>>>> .text))
>>>>>>>                         .finally(() => worker.terminate());
>>>>>>>
>>>>>>> This doesn't seem to be using my language (that I created myself). I 
>>>>>>> get the same output as I do when I remove the langPath. I mean I can 
>>>>>>> cleary 
>>>>>>> see my language is not being used in the recognized process. I know 
>>>>>>> it's 
>>>>>>> not because I tested my language (traineddata) in windows desktop and I 
>>>>>>> get 
>>>>>>> the results that I actually want. What needs to change in my code so my 
>>>>>>> (custom) traineddata, and only mine, is being  used?
>>>>>>>
>>>>>>> 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 view this discussion on the web visit 
>>>>>>> https://groups.google.com/d/msgid/tesseract-ocr/8a823afb-fde5-43aa-a643-2cf69462c2f6%40googlegroups.com
>>>>>>>  
>>>>>>> <https://groups.google.com/d/msgid/tesseract-ocr/8a823afb-fde5-43aa-a643-2cf69462c2f6%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> -- 
>>>>> 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 view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/tesseract-ocr/4d8dcf15-293c-4b3e-9d67-8b0ba8be9a27%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/tesseract-ocr/4d8dcf15-293c-4b3e-9d67-8b0ba8be9a27%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>
>>>>
>>>> -- 
>>>>
>>>> ____________________________________________________________
>>>> भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com
>>>>
>>> -- 
>>> 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 view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/tesseract-ocr/75347274-7bbe-4f66-a313-7fb51ad9d253%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/tesseract-ocr/75347274-7bbe-4f66-a313-7fb51ad9d253%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/dfa98f2a-e1a0-49d6-aaba-5d0085b9ee32%40googlegroups.com.

Reply via email to