Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create Learn Mask for Imaq learn geometric pattern

We are creating an application where the user will create a recipe and I would like to create a vi that can paint the Learn Mask on the image similar to how vision builder does it.
0 Kudos
Message 1 of 4
(3,849 Views)

Hi Mark,

The VI's that you would need to use are the IMAQ Overlay VI's.  These are located in the Vision Utilities palette.  You can choose the VI that overlays the shape you want.  The Circle Distance Example.vi located in the NI Example Finder demonstrates how these overlay VI's are used.

0 Kudos
Message 2 of 4
(3,831 Views)
Hi Michael,
 
We have done it using the Imaq overlay vi's.  The problem is we want to dynamically paint the overlay on the image so that we can mask out regions to ignore.  We are trying to recreate the NI Geometric Matching Training Interface section that is Draw Regions to Ignore.  We can paint on the image by setting up the overlay oval and defining the circle size, but it will only paint with mouse moves with the left mouse button pressed.  If we press the mouse button the image will no longer draw the overlay region.  I have attached a simple example of what we have now.
 
Thanks,
 
0 Kudos
Message 3 of 4
(3,825 Views)
Hi Mark,
 
The method that you want to invoke is Get Last Event.  This returns the coordinates from the action on the image.  You can use any of the tools (rectangle, circle, or freehand) and use the overlay functions of whatever shape you want to use.  I have included a modified version of your VI to show this.  I hope this helps.
0 Kudos
Message 4 of 4
(3,807 Views)