yes - otherwise you will see memoryleak message when you app will finish...ä
Zdenko


pi 21. 6. 2019 o 10:28 _ Flaviu <[email protected]> napísal(a):

> As far I understand,
>
> pTess->End();
> is called on destructor, am I right ?
>
> On Thursday, June 20, 2019 at 2:42:49 PM UTC+3, zdenop wrote:
>>
>> IMO you have to call END() to correctly close tesseract instance.
>>
>> Zdenko
>>
>>
>> št 20. 6. 2019 o 13:02 _ Flaviu <[email protected]> napísal(a):
>>
>>> I am using tesseract 4 on a VC++ (MFC) app, to read text from images (A4
>>> sizes). I noticed that while I using this app on several PCs (Win10 64 bit,
>>> *GB RAM), the RAM occupied by my app (that use tesseract) is increasing on
>>> and on. If I read 14 images, my app eat 470 MB, and if I didn't close the
>>> app and read again all these 14 images, the RAM eaten by my app is
>>> increasing until ~800MB, and if continue to read the same images, the RAM
>>> is increasing on an on. Why is this happen ?
>>>
>>> Here is the code that I am using for tesseract:
>>>
>>> BOOL CMyClass::GetTextFromImage()
>>> {
>>> PIX* pix = NULL;
>>> tesseract::TessBaseAPI* pTess = new tesseract::TessBaseAPI;
>>>
>>> do
>>> {
>>> if (pTess->Init(...))
>>> {
>>> m_sError.Format(_T("OCRTesseract: Could not initialize tesseract."));
>>> break;
>>> }
>>> // setup
>>> // read image
>>> PIX* pix = pixRead(m_sFileName);
>>> if (! pix)
>>> {
>>> break;
>>> }
>>> // recognize
>>> pTess->SetImage(pix);
>>> }
>>> while (FALSE);
>>>
>>> // cleanup
>>> // pTess->Clear();
>>> // pTess->End();
>>> delete pTess;
>>> pTess = NULL;
>>> pixDestroy(&pix);
>>>
>>> return TRUE;
>>> }
>>>
>>>
>>> Is there anything wrong here ? Why is increasing RAM while I am using
>>> tesseract ?
>>>
>>> --
>>> 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 https://groups.google.com/group/tesseract-ocr.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/tesseract-ocr/8be010ab-c948-47d3-b51e-ac141ce12bbd%40googlegroups.com
>>> <https://groups.google.com/d/msgid/tesseract-ocr/8be010ab-c948-47d3-b51e-ac141ce12bbd%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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 https://groups.google.com/group/tesseract-ocr.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tesseract-ocr/125c6502-4afa-4fe6-ae04-f2ef14c0815b%40googlegroups.com
> <https://groups.google.com/d/msgid/tesseract-ocr/125c6502-4afa-4fe6-ae04-f2ef14c0815b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/CAJbzG8wsw2t8%2BrJFCRsrCjL-vZDnHOCmJrGQgyZqVj1kNWCO7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to