From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

pattern matching tool does not support more than one template

Solved!
Go to solution

Hello,

 

I used pattern matching and it is amazing tool.

However, it does not support multiple templates. As I have too many template I am forced to use single tool multiple times.

It also increases the processing time as one tool will take 15 ms time on average.

 

Is there any way to include multiple templates for single pattern matching tool?

 

Thanks,

0 Kudos
Message 1 of 10
(5,129 Views)

Hello,

 

you cannot avoid additional processing time, if you want to test for multiple patterns. Each template needs to be moved accross the image and NCC calculated. You could try to optimize the process by using parallel matching (not a single for loop for all templates) and increasing the pyramid levels.

 

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."
0 Kudos
Message 2 of 10
(5,052 Views)

Thank you Klemen.

 

In vision builder, there is concept of state diagram.

compiler  will choose only one path at a time only.

 

state can have multiple ins and outs. if >2 outs, we can provide priority in case of condition for >1 path becomes true.

 

1. How can I run tools in parallel?

2. When using classification tool, Vision builder stops responding when training database is of >1000 images.  Can this be avoided?

3. My application needs at least 100 templates. I am worried because VB may stop responding.

 

 

Thanks

0 Kudos
Message 3 of 10
(5,004 Views)

OCR is a form of pattern matching that uses a large number of templates all at once.  Depending on your application, you could try that approach.

 

If you can convert your images to binary, you can use the classification routines, which probably use algorithms very similar to OCR to rapidly identify a shape.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 10
(4,996 Views)

Thank you Bruce.

 

My application doesn't allow me to use binary images.

I am required to find greyscale (sometimes color) template matching test images.

 

Thanks,

0 Kudos
Message 5 of 10
(4,979 Views)

Perhaps you could do it in two steps.  Find a way to reduce the number of candidates using a set of properties, then you only have to do a few searches to narrow it down to one.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 6 of 10
(4,955 Views)

That is a good point Bruce.

 

But this is already second step, where further steps can be generated by pattern matching only.

 

BTW, is it possible to execute steps/states in parallel, in Vision builder?

 

I think no, because In vision builder, there is concept of state diagram. compiler  will choose only one path at a time only.

 

0 Kudos
Message 7 of 10
(4,952 Views)
Solution
Accepted by topic author LearningLV

I don't think you can do it in Vision Builder.  This is a time when switching to LabVIEW would be productive.  You can run several parallel searches in LabVIEW easily.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 8 of 10
(4,942 Views)

The use of LabView will solve the issue.

Good recommandation.

 

Thanks Bruce.

0 Kudos
Message 9 of 10
(4,940 Views)

Hi guy,

About this question how could you to sloved by LV.Currently, I have had stuck .

can you share.

0 Kudos
Message 10 of 10
(3,308 Views)