ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 OCR recognize C++ - What's wrong? (SOLVED!)

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
activer 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!


12   L A T E S T    R E P L I E S    (Newest First)
activer 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!
xequte 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 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.
activer 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 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!!!
xequte 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 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 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 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 Posted - Nov 27 2013 : 14:43:39
Hi

Does it happen with all images, i.e. including the ones with the IEVision demo? Does our compiled demo (www.imageen.com/demos/) fail on the same files?



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
activer 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 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