Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

live video pattern match

Hi,

I have created a program from where you can look at a live video (contious aquisition within a loop) and from that, create a template which you then use pattern match on. The idea is to be able to track movements of the template (in my case components on a PCB) in the live video. Everything works just fine, however, when I try to change the template in the program (I have a button in the GUI where you can either create a new template or load a previously saved template), the program for some reason still uses the "old" template. I'm not succeeding to change the template used in the pattern match part of the vision assistant express vi while I'm running the program.

If I stopp and restart the program I can load a new template however.

I'm beginning to think it has something with the image aqusition and not disposing images correctly, to do but I could need some help.

Is there an example out there that uses live video pattern match where you can load/create templates on the fly?

Thanks!

0 Kudos
Message 1 of 5
(3,905 Views)

See the atached post http://forums.ni.com/t5/Machine-Vision/pattern-matching-program/m-p/1914589#M34855 this may helps you.

---
Silver_Shaper | CLD
0 Kudos
Message 2 of 5
(3,890 Views)

Thanks Sasi,

I looked at the example but it not really what I looked for. In your example, the match is done on a previously recorded video file. What I would like to do is to do the matching on a live video.

I've managed to do matchpattern the first time I load or create a searchpattern. But if I want to change the match pattern template while running the VI, it continues to use the old one...(I'm aware I have trouble explaing the problem...)

The structure of my VI is as follows:

while (not stopped or stop aquisition of images)

 1. Continously aquire images

 2. Do a search pattern task (a -no pattern match, b -use "old" pattern, c - create new pattern and d -load a previously saved pattern)

 3. Do a pattern match (use vision assistant to do a pattern match on the image aquired in step 1, with the template from step 2.

 4. Overlay the match (if found) to the image aquired from step 1.

 5. Calculate the radial movement between two following frames (the calibrated matches array from vision assistant in step 3.

 6. Save radial movement to file

end

 

It works, but I have to restart the VI before I can use a new template (otherwise it just keeps showing the first match)

I guess it has something with how I aquire images, to do?

 

Best regards,

//Jonas

0 Kudos
Message 3 of 5
(3,885 Views)
Yes , got your point. It's easy to do. mobile right now.Will tell you when reached my lap.
---
Silver_Shaper | CLD
0 Kudos
Message 4 of 5
(3,881 Views)

Is it possible for you to share your vi?

0 Kudos
Message 5 of 5
(2,413 Views)