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/CAJbzG8zXBoW7Bu6PV3sqaWKgwGu_RSv7B%3DczURrhQ%3DdP4wjbNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to