Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get the visual pattern matching results that NI Vision Assistant gives me into my LabVIEW code?

I have used NI Vision Assistant to build a script that successfully matches patterns in my image. The image has three checkerboard patterns, and NI Vision Assistant finds them, gives me their coordinates, and visually shows me where they are on the image by surrounding them with little red rectangles (with crosshatches showing the rectangles' centers).

 

I have used the NI Vision Assistant "Tools" menu to create LabVIEW code from this script, and it worked perfectly the first try. But in LabVIEW, the resulting images do not have the little red rectangles showing me where the three successful pattern matches are. Is there a simple way to get these rectangles that NI Vision Assistant gives to show up in the LabVIEW image?

 

My code and related files are attached if you're curious; but none of that should be needed to answer this post. If you try the attached code, create the folder "C:\temp\find_three_checkerboards", put the four files in there, then use LabVIEW 2012 and NI Vision 2013.

0 Kudos
Message 1 of 4
(5,498 Views)

Hello,

 

this has been answered a couple of times. For example:

 

http://forums.ni.com/t5/Machine-Vision/show-tracked-pattern/m-p/2517574#M39557

 

Best regards,

K

 


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 2 of 4
(5,496 Views)

Thanks, that was really close!

 

The rectangle and crosshairs look similar, but there is a significant difference; the crosshair, or "Position" of the pattern match is rounded down to the nearest integer in NI Vision Assistant, whereas the VI in that link "Draw Pattern Matches Position.vi" rounds to the nearest integer.

 

I consider rounding to the nearest integer more appropriate, but nevertheless I rewrote and slightly renamed the VI in that link so it matches NI Vision Assistant; it rounds down the x-y coordinates of the matched position.

 

To illustrate this, my code and related files are attached (they use LabVIEW 2012 and NI Vision 2013). Create the folder "C:\temp\find_three_checkerboards" and put the four files in there, as they depend on that path. Run "find_three_checkerboards.vi" with its "Round Position Down?" input checked then not to see which one matches NI Vision Assistant.

0 Kudos
Message 3 of 4
(5,486 Views)

I forgot to attach the code on that last post; here it is.

0 Kudos
Message 4 of 4
(5,485 Views)