LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to put in multiple template for IMAQ pattern matching labview / vision assistant

Solved!
Go to solution

I'm currently making a pattern matching program that detects key. But somehow its accuracy in a real time detection is really bad because of the light environment. I'm thinking of putting several templates of different brightness and different background color but I don't know which function should I use.

 

0 Kudos
Message 1 of 7
(1,712 Views)
Solution
Accepted by PULSE.Wannabe

So you are using Geometric Matching, which should be more or less independent from brightness, rotation, scale and partial occlusion.

 

I would try using "IMAQ Advanced Setup Match Geometric Pattern 2", there are some advanced tuning parameters that make the balance between grayscale correlation (which depends on brightness) and edge geometry detection (which depends on edge quality):

 - Enable Contrast Reversal

 - Scoring Method

 - Enable Correlation score

 - Enable Target Template Curve Score

 

See the help of the VI for parameters explanation.

0 Kudos
Message 2 of 7
(1,592 Views)

is it possible when pattern matching is used instead of geometric matching for multiple matching?

0 Kudos
Message 3 of 7
(1,242 Views)

Hi,

 

Depending on the quality of your images, there are several pattern matching algorithms that you can use: Low Discrepancy Sampling, Grayscale Value Pyramid, Gradients Pyramid.

The VIs "IMAQ Learn Pattern" and "IMAQ Match Pattern" also have an input for advanced parameters.

 

I highly recommend using Vision Assistant first to test your algorithm and parameters. Often, the preset parameters are already very good.

Then you can export to LabVIEW code to integrate it into your application.

 

Regards,

Raphaël.

0 Kudos
Message 4 of 7
(1,235 Views)

Thank you @raphschru !

 

Yes, I tried using the advanced option and it worked. But I am looking for a way of using two different templates and matching those templates to one image.

 

0 Kudos
Message 5 of 7
(1,149 Views)

When you have multiple templates, just execute the match function multiple times, each time with a different pattern.

 

Then you will need to merge your results and filter out matches from different templates that are at similar positions.

For that, you will need a clustering algorithm that can group together points that are close to each other (based on proximity).

Then for each "group", take the match with the highest score.

 

If you are not familiar with the term clustering: https://en.wikipedia.org/wiki/Cluster_analysis

0 Kudos
Message 6 of 7
(1,139 Views)

Thanks for this @raphschru. 

 

 

1. When you have multiple templates, just execute the match function multiple times, each time with a different pattern.

I'm finished with this one. 

 

2. Then you will need to merge your results and filter out matches from different templates that are at similar positions.

I am stuck with this; I am thinking of passing the match info (Bounding box x &y or Position) to Excel and doing the formula in there. But I am also thinking if there is another way other than using a third-party app.

 

3. Then for each "group", take the match with the highest score.

Yes, I will select the one with the highest score match after I did step 2. 

 

image.png

 

0 Kudos
Message 7 of 7
(1,121 Views)