I am using tesseract in a VC++ app. Which goes fine, but if I use this
library on and on without close the app, the RAM size is increasing a lot.
Actually, if I read 10 images, I am not close the app, and then I read
other 10 images, and then other 10 images, and so on, my app is taken huge
RAM size (several GB).
Here is the test code:
CTemp::CTemp()
{
m_Tess.Init(_T("C:\\tessdata-master\\"), _T("eng"),
tesseract::OcrEngineMode::OEM_TESSERACT_LSTM_COMBINED);
}
CTemp::~CTemp()
{
m_Tess.Clear();
m_Tess.End();
m_Tess.ClearPersistentCache();
}
BOOL CTemp::GetTextFromImage(CString sFileName)
{
PIX* pix = NULL;
do
{
// read image
PIX* pix = pixRead(sFileName);
if (! pix)
{
m_sError.Format(_T("Cannot open input file: %s."), sFileName);
break;
}
// recognize
m_Tess.SetImage(pix);
}
while (FALSE);
// cleanup
pixDestroy(&pix);
return m_sError.IsEmpty();
}
and here is the sample project that reveal the problem:
https://onedrive.live.com/?authkey=%21AJAfPxEA6Mmrx94&id=DEDCB6EF190B8FD4%21398&cid=DEDCB6EF190B8FD4
You can find there even a test app that show how much RAM could take
tesseract library, if you are reading images without closing the app. The
only thing is to have an folder in C:\ drive with trained data:
*C:\\tessdata-master\\*. That's all. In menu *File*, you go on *Read Images*
item, and you can browse in your PC to find and read images, the results
are written in status bar.
The project is VS2017 app, and the app run on Win10 64bit. Where can I
report this bug (if it is a bug), in order to be solved ?
--
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/505ac2ca-7829-45c2-884b-6712df597fa3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.