01-08-2015 06:11 AM
Hi friends,
I am trying to use NI OCR Trainer module in LabVIEW directly which is now only accessable in vision assistant. But it is not loadable and i am not able to open the VI from OCR library of vision assistant. Is there any possible method to call NI OCR Trainer from LabVIEW?
Solved! Go to Solution.
01-08-2015 01:04 PM
The OCR Training Interface ships with Vision Development module as an executable.
You can it from your LabVIEW application using a System Exec call and even pass command line argument to load images, and character set file.
The executable is installed at the following location:
C:\Program Files (x86)\National Instruments\Vision\Utility\OCR Training Interface\OCR Training.exe
The help file C:\Program Files (x86)\National Instruments\Vision\Utility\OCR Training Interface\TrainOCR.chm details the possible command line arguments.
Look at the section "Using Command Line Arguments with the 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"]
Refer to the following examples of command line arguments for the NI OCR Training Interface:
Command line argument | Result |
---|---|
"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. |
01-09-2015 01:51 AM
Thank you ChristopheC !
The solution you gave me works fine.Now i am able to launch NI OCR trainer with image folder and char set file path as inputs. Another help i need from your side is, receiving arguments from NI OCR trainer in LabVIEW. If there is any possible solutions please say me.
01-09-2015 09:09 AM
Currently, the command line arguments I mentioned is the only way to pass parameters between LabVIEW and the OCR Training executable.
Once you're done in the training interface, if you've made changes, the software will prompt you to save the character set file at the location you specified.
Back in LabVIEW, you can use the OCR VIs located in the Machine Vision>>OCR palette to open that character set file and get all the properties that were set in the training interface.
Look at the VIs IMAQ OCR Read Character Set File, IMAQ OCR Property.
Hope this makes sense.
Christophe
01-10-2015 04:08 AM
Thankyou ChristopheC
It works fine.
Regards,
Sakthi.
09-14-2016 03:05 AM
Hi ChristopheC,
I used attached LabVIEW 2014 vi, it can work on NI OCR Trainning Interface 2014. When I used in LabVIEW 2010 to call NI OCR Trainning Interface 2010, it shows could not be opened image folder and abc file.
B/R
Ancle
09-14-2016 08:55 AM
Command line arguments for the OCR Training Interface have been added in Vision Development Module 2011 SP1.
09-15-2016 02:33 AM
Hi ChristopheC,
Thanks for reply.
B/R
Ancle
04-23-2021 02:35 AM
請問NI工程師,OCR Training.exe 這支程式除了可以帶下面2個參數外,不知是否可以帶ROI的參數?
因為用 NI Vission Assistant 載入OCR Training.exe時,這ROI範圍和上一層是一樣的
/fontpath
/imagespath