Author |
Topic |
|
activer
Hungary
14 Posts |
Posted - Nov 24 2013 : 12:34:53
|
Hi Support Team!
I wrote this method:
void __fastcall TForm5::Button1Click(TObject *Sender)
{
_di_TIEVisionOCR OCR;
_di_TIEVisionWString str;
wchar_t *cstr;
if (IEVisionAvailable()) {
_di_TIEVisionImage image= ImageEnView1->IEBitmap->GetIEVisionImage();
if (image) {
IEVisionLib()->createOCR("eng" , TIEVisionOCREngine::ievOCRFAST, false, OCR);
if (OCR) {
//OCR->setSegmentationMode(ievOCRAUTO );
OCR->recognize(image, IEVisionRect(0, 0, 0, 0), false, str);
str->c_str(false, cstr);
Memo1->Lines->Text = WideString(cstr);
} else {
ShowMessage("visionocr error");
}
} else {
ShowMessage("image error");
}
} else ShowMessage("couldn't find ievision.dll");
}
I can build it but at the OCR->recognize line I get a dll violation error.
What's wrong? The dll is in the exe's folder together with the eng language files. I tried to use your 2.png file
The project is here: http://bit.ly/1bgegMV
I use XE3 C++ with ImageEn 5.0.5 and IEVISIOn 2.0.0.
(The c++ version of ievision OCR demo doesn't work.) Thanks in advance!
|
|
xequte
38616 Posts |
Posted - Nov 27 2013 : 11:32:42
|
Hi
Specifically, do you mean that an Access Violation arised in the call to createOCR?
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
|
|
activer
Hungary
14 Posts |
Posted - Nov 27 2013 : 13:09:57
|
It happens at OCR->recognize(image, IEVisionRect(0, 0, 0, 0), false, str); line.
See the picture:
|
|
|
xequte
38616 Posts |
|
activer
Hungary
14 Posts |
Posted - Nov 27 2013 : 15:16:24
|
I used your demo images only.
I downloaded the two OCR demos, both gives this message:
Do the two compiled OCR demos work perfectly for you? |
|
|
xequte
38616 Posts |
Posted - Nov 27 2013 : 16:58:23
|
Yes, I do not encounter any errors on WinXP and Win7/64
What version of Windows are you using?
Nigel Xequte Software www.xequte.com nigel@xequte.com |
|
|
activer
Hungary
14 Posts |
Posted - Nov 28 2013 : 00:38:35
|
Hmmm, very interesting.
I'm using Win7/64bit Professional (Hungarian).
I tested again your compiled OCR demo but the error message appears always.
Are you using English version of Windows? |
|
|
xequte
38616 Posts |
Posted - Nov 28 2013 : 13:33:29
|
Hi
Yes, English version of Windows, though that should not be an issue.
Try restarting Windows and running the demo before you start up anything else.
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
|
|
activer
Hungary
14 Posts |
Posted - Nov 28 2013 : 15:13:47
|
My sons have a box with Win7/64bit Home Premium ENGLISH version. I tried: your OCR demo works on this machine!!! |
|
|
activer
Hungary
14 Posts |
Posted - Nov 28 2013 : 15:21:17
|
As you suggested I rebooted my machine (+switched off antivirus sw + I checked the clean dll environment before) but the demo doesn't work.
I added hun.traineddata file but it doesn't solve the problem. |
|
|
activer
Hungary
14 Posts |
Posted - Nov 28 2013 : 16:00:43
|
I made a win7/64bit pro English install to a new VirtualBox machine. The Ocr demo works on it too. |
|
|
xequte
38616 Posts |
Posted - Nov 29 2013 : 12:47:13
|
Hi
We test it on Italian Windows too, so I think your results may be indirect or coincidental.
It could be a path issue, try replacing:
IEVisionLib()->createOCR("eng", ievOCRFAST, false, OCR);
with:
IEVisionLib()->createOCR("C:\\path\path\\", "eng", ievOCRFAST, false, OCR);
Where "C:\\path\path\\" is the folder that contains the “eng.traineddata” file (double-slash only for C++).
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
|
|
activer
Hungary
14 Posts |
Posted - Nov 30 2013 : 02:51:55
|
SOLVED!
I installed Tesseract OCR some weeks ago then I uninstalled it. But the uninstaller didn't clear perfectly the registry: here remains a tag TESSDATA_PREFIX which points the original folder of traineddata files. Your demo (with the embedded Tesseract engine) tried to use this nonexisting folder... (I used Microsoft's Process Monitor to examine the situation.) I deleted this key from registry (it had two entries), then rebooted the machine and OCR demo works now! Thanks for your cooperation!
|
|
|
|
Topic |
|