tesseract::TessBaseAPI tess; if (tess.Init("e:\\resources\\tesseract\\tessdata","eng",tesseract::OEM_LSTM_ONLY)) { cerr << "OCRTess:could not initialize teseract" << endl; return -1; } tess.SetPageSegMode(tesseract::PageSegMode::PSM_SINGLE_LINE); cout<<"setVariable succeed? "<<tess.SetVariable("tessedit_char_whitelist","0123456789"); Rect r; Mat roi = src(r);//where r is the region of interest tess.SetImage((uchar*)roi.data, roi.size().width, roi.size().height, roi.channels(), roi.step1()); tess.Recognize(0); text = std::unique_ptr<char[]>(tess.GetUTF8Text()).get();
--
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 tesseract-ocr+unsubscribe@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
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/4415aaee-23e2-48af-b625-e3ab2b9902dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
OEM_LSTM_ONLY in tesseract 3.05[1]? Really???
Zdenko
On Thu, Jan 5, 2017 at 9:01 AM, Matthew Scott <beaut...@gmail.com> wrote:
version: 3.05 //I compiled the tesseract305.dllsystem: windows 10 x64I want to only recognize the number, so the code is as follows
tesseract::TessBaseAPI tess;if (tess.Init("e:\\resources\\tesseract\\tessdata","eng",tesseract::OEM_LSTM_ONLY)){cerr << "OCRTess:could not initialize teseract" << endl;return -1;}tess.SetPageSegMode(tesseract::PageSegMode::PSM_SINGLE_LINE);cout<<"setVariable succeed? "<<tess.SetVariable("tessedit_char_whitelist","0123456789");Rect r;Mat roi = src(r);//where r is the region of interesttess.SetImage((uchar*)roi.data, roi.size().width, roi.size().height,roi.channels(), roi.step1());tess.Recognize(0);text = std::unique_ptr<char[]>(tess.GetUTF8Text()).get();however, the output still contains the alphabet
--
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 tesseract-oc...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-ocr+unsubscribe@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
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/37aca96d-4415-4013-b26d-a93a0d9af529%40googlegroups.com.