Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Moving ROI

I'm working on a OCR application. The application scans serial numbers off of gun receivers. I've noticed that the receivers aren't always placed in the same location all the time. I need a ROI that can shift depending on the location of the Serial number. I know the lenth of the serial number, that won't change. If shifting the ROI isn't a good way to approach this problem, I'm open to other ideas.
 
- Eric
 
NI Vision Assistant
NIMAQ IEEE Drivers
Visual BASIC 6
Windows XP
0 Kudos
Message 1 of 2
(3,223 Views)

Hi Eric -

In a situation where the object under inspection has an indeterminate location within your image, it is common to define a coordinate system around that object.  The process is usually:

  1. Perform a pattern matching step to locate a distinctive feature that always appears in the image.
  2. Define a coordinate system with this feature at the origin.
  3. Use this coordinate system as an input to subsequent processing functions, so that their ROIs are defined with respect to the object, not the image pixels.

This lets you follow the location of your object (in this case, a serial number) regardless of where it is located in the image.

An excellent example of this process ships with the Vision Development Module.  It is called Battery Clamp Inspection. For a VB6 version of it, browse to C:\Program Files\National Instruments\Vision\Examples\MSVB\3. Applications\Battery Clamp Inspection and open the project there.

Note that the coordinate system definition steps aren't available in Vision Assistant, and will have to be coded manually using the Machine Vision libraries.

I hope this helps!

 
David Staab, CLA
Staff Systems Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,215 Views)