OCR (C#) : IRIS (iDRS 14.0) Part 1 - Getting Started
I was unable to find ANY examples on the internet on how to use the iDRS libraries supplied by
IRIS, which probably means that they've got some kind of weird copyright law prohibiting anyone to
blog about it, making them the sole means of support on the net
(or alternatively its a crap
product, which I dont believe it is).
But why would a company willingly shoot itself in the foot? Basically it means that you're not allowed to advertise
their product, since showing people how to use it is also a form of advertising.
So these posts will remain active until IRIS asks me to remove it.
Assuming you've downloaded the SDK and bought the product
(else click
on this link), follow the following steps.
Setting up the licenses
Step 1
Install sentinel Licence Manager located under redist/software_protection folder; used to validate licences against
their servers.
Step 2
Retrieve computer specific id by running the idrs_sentinel_computer_id.exe located in your bin folder.
Step 3
Retrieve your generated keys by passing the serial numbers IRIS supplied you in combination with the computer id generated
in step 2 via the the idrs_sentinel_software_key command like seen below:
idrs_sentinel_software_key.exe 0000000000000000000000000000000000 iDRS14_STD2_Desktop 1 IDRS14_STD2_DRS *RetrievedComputerId
Which will return you some funky code which you need to use in your license class, you will need to repeat this step for
every module you've got licenses for.
Adding references
I found it a bit cumbersome adding the needed references to my solution, since basically your executable needs to reside
in the same folder as the assemblies making out the OCR engine.
(the millions of assemblies you'll find under the bin folder
of the SDK)
The way they did it in their sample files is to simply compile the application to the bin folder of the SDK, not very portable
don't you think?
So what I did instead was to create a folder in my solution named Assemblies and copied all the needed assemblies to that folder and
set a prebuild script to copy the assemblies to my application folder like seen in the following image.
Right click solution >
Select Properties >
Click on Build Events Tab >
Edit Pre-build Command Line with the following text.
Copy $(ProjectDir)Assemblies\*.* $(TargetDir)
As for the .net assembly
(idrskrn_net14.dll bit of a poorly named assembly according to .net standards),
you simply add like you'd add any other .net assembly.
Chances are good that you'll get the following BadImageFormatException
(bad image format, bad boy, down boy) as soon as you attempt
to run your application.
You'll need to set your executable platform target to x86 like seen in the following image.
Right click solution >
Select Properties >
Click on Build Tab >
Select x86 on Platform target dropdown
In the
next part of this post we're going to have a look at how to retrieve text from an image using the iDRS SDK.
Posted by - Christoff Truter
Date - 2011-08-04 16:44:04
Comments
Post comment