Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Using OCR with Coordinate System

Using OCR with Coordinate System

I have an application where I need to read the text on a sticker.  The sticker is not always in the exact same place.  But the text I need to read is always within the same area of the sticker.

Using Pattern Matching, I am able to find the location of the sticker.  But I have so far been unsuccessful in using that information to translate the location of my OCR ROI.

I know that I need to change the global rectangle values on the OCR Read Text.vi based on what the Pattern Matching VI returns.  I'm just not sure how to do that.   


--

Patrick Allen
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 1 of 5
(3,954 Views)
Patrick,
 
Thanks for your post.  There is actually a LabVIEW shipping example that shows how to rotate the coordinate system for just such an application.  If you open the LabVIEW Example Finder, from the browse tab open "Toolkits and Modules>>Vision>>Applications" and select the "Battery Clamp inspection example.  You can also find it at:
 
C:\Program Files\National Instruments\LabVIEW 8.0\examples\Vision\3. Applications.
 
That are lots of examples in there (I also attached this file if you can't find it, but it loads images from the folder described so you will need those for it to run properly).  The examples shows a battery clamp that constanly rotates around and the program locks on and rotates all of the ROIs as needed.  It performs a clamp measurement, but that could be replaced with any function, including OCR.  Hope this helps!
 
Thanks,
 
Scott Savage
National Instruments
Applications Engineering
0 Kudos
Message 2 of 5
(3,950 Views)
Thanks for your reply Scott,

There is actually a LabVIEW shipping example that shows how to rotate the coordinate system for just such an application.

It's funny that I just answered a post here with pretty much the exact same thing.  I had a look at this example already.  But I wasn't sure how to take the output from the the IMAQ Find Coordinate System.vi and apply it to the IMAQ OCR Find Text.vi  

Simply taking the Coordinate System Out and wiring it to the ROI Descriptor in doesn't work.  

The IMAQ OCR Find Text.vi takes a cluster of two elements; Global Rectangle (1D array, I32), Contours (cluster of 3 elements; ID, Type, Coordinates)    
 
What I'm not sure of is which elements of the Coordinate System Out I need to unbundle to provide the correct information for the ROI Descriptor in.

For the interim, I've got an ugly work around.  (almost)  But I know for sure there has to be a more elegant solution.
 
--

Patrick Allen
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 3 of 5
(3,946 Views)
This is the best I've managed so far.  I'm sure there must be a better way.

I'm still a novice when it comes to figuring out how to manipulate clusters and arrays of clusters.  So it  took quite awhile to figure out how to configure the ROI input properly.  Again, I know there must be a better way of doing this. 





---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 4 of 5
(3,942 Views)

Patrick,

Thanks for the follow up.  I am not exactly sure what you are working to accomplish here, but these VIs look OK.  They could be cleaned up a bit (make more modular, etc), but process you are using for working with the clusters is the right approach.  There are no premade VIs for your task (short of the examples linked above) in the Vision Development Module, but you are heading in the right direction!

Thanks,

Scott Savage
National Instruments
Applications Engineering
www.ni.com/support 

Message Edited by Savageaggie on 06-23-2006 12:25 PM

0 Kudos
Message 5 of 5
(3,925 Views)