Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

OCR train in .Net

Does anyone know how to do a OCR train in C# /VB.Net? simple sample code is good for me.

0 Kudos
Message 1 of 10
(6,771 Views)
This forum is dedicated for LabVIEW Machine vision only. Not for other languages or support.
Thanks
uday
0 Kudos
Message 2 of 10
(6,761 Views)

uday,

 

That is not correct.  This forum is for National Instruments Vision support.  Since the Vision library can be called from several languages, this forum includes those languages.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 3 of 10
(6,759 Views)
Thanks for correcting me Bruce 😛
Thanks
uday
0 Kudos
Message 4 of 10
(6,757 Views)

or what is steps before calling the OcrSession.Train Function? please help...

0 Kudos
Message 5 of 10
(6,749 Views)

I'm looking for the same thing:  example of OCR in .Net.

 

0 Kudos
Message 6 of 10
(6,360 Views)

Is there anyway to launch the NI OCR Training Interface from a command line or through a dll?

 

I need to include a training interface in my application and it seems like a waste to rewrite this application. The only other alternative is to run NI Vision Assistant, but that is an overkill.

0 Kudos
Message 7 of 10
(6,301 Views)

i'm looking for the same things too, Process.Start with argument seem doesn't work, anyone know how to start OCR Training Intrerface with input parameter like image path and .abc path in c#?

0 Kudos
Message 8 of 10
(4,499 Views)

@lkleong wrote:

i'm looking for the same things too, Process.Start with argument seem doesn't work, anyone know how to start OCR Training Intrerface with input parameter like image path and .abc path in c#?


Have you tried this Solution?:

 

 

Using Command Line Arguments with the NI OCR Training Interface:

 

The NI OCR Training Interface accepts command line arguments with the following syntax:

"OCR Training.exe" [/fontpath ["File Path"] [/imagespath ["Folder Path"]

  • /fontpath ["File Path"]—Specifies a character set file path.
  • /imagespath ["Folder Path"]—Specifies a folder path of images to load.

Examples

 

"C:\Program Files (x86)\National Instruments\Vision\Utility\OCR Training Interface\OCR Training.exe" /fontpath "C:\Program Files (x86)\National Instruments\Vision\Utility\OCR Training Interface\OCR Tutorial\NIOCRTutorial.abc"Opens the OCR Training Interface and loads the NIOCRTutorial.abc character set from the OCR Tutorial folder.
"C:\Program Files (x86)\National Instruments\Vision\Utility\OCR Training Interface\OCR Training.exe" /imagespath "C:\Program Files (x86)\National Instruments\Vision\Utility\OCR Training Interface\OCR Tutorial"Opens the OCR Training Interface and loads images from the OCR Tutorial folder.
0 Kudos
Message 9 of 10
(4,471 Views)

Thank you Andrey Dmitriev.

Yes, It's working now in C#, and below is my code, I miss the " in previous run that's why not working.

 

By the way, is there similiar way to call other utility like Color Classification Training Interface and Classification Training Interface? it's not accepting command arguments?

 

ProcessStartInfo pi = new ProcessStartInfo();
pi.FileName = @"C:\Program Files (x86)\National Instruments\Vision\Utility\OCR Training Interface\OCR Training.exe";
string ocrpath = "\"" + [ocrfilepath] + "\"";
string imgpath = "\"" + [imagepath] + "\"";
pi.Arguments = @" /fontpath " + ocrpath + @" /imagespath " + imgpath;
Process.Start(pi);

0 Kudos
Message 10 of 10
(4,462 Views)