Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Template matching

Hello,

 

I am trying to make a pattern matching algorithm using NI Vision.  My target is to find a particular IC on different PCB boards when the PCB boards are on a conveyer belt. We found that when the PCB boards are not busy it is very easy to find a particular IC. But when the PCB board is busy it is very difficult to find the IC, and even the time is not very fast. To solve the problem, I am trying to understand how the Labview program really works. I have seen some online literature on Labview but that is not so details. Anyone can help me solve the problem.

 

 

0 Kudos
Message 1 of 10
(7,277 Views)

Hello,

 

have you seen this:

 

http://zone.ni.com/reference/en-XX/help/372916M-01/TOC17.htm

 

What do you mean by PCB is busy?

 

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
(7,273 Views)

Thanks for replying. By busy I am trying to say whyen there are lot of other connections. We have seen that,  for a particular PCB image when we tried to find a particular IC by applying a template matching algorithm in Labview the algorithm doesnt work. But from the same image when  we remove all the other materials (like other ICs, connections, etc) the algorithm works(it means that the algorithm is capable of finding the particular IC).

0 Kudos
Message 3 of 10
(7,254 Views)

Klemen

I have seen the link. But they have explaind only one concept, that is cross-correlation what we already know. They hvent explaind how they have done it. In labview they have used a built in vis. That is in the NI Vision development module IMAQ Match Pattern 4 VI. I want to know how IMAQ Match Pattern 4 VI really works.

Thanks

0 Kudos
Message 4 of 10
(7,252 Views)

Hello,

 

actually its normalized cross correlation, not just correlation (the difference is in the denominator - normalized correlation is invariant to uniform intensity changes).

 

I don't know what more there is to say about "how" Match Pattern 4 works. Did you check the normalized cross-correlation formula? Its simple, you can implement it yourself. It basically just moves the template over the image and calculates the normalized correlation score (maybe this will make it clearer?: http://docs.opencv.org/doc/tutorials/imgproc/histograms/template_matching/template_matching.html ). The normalized cross correlation is not the only metric for matching patterns. The only thing to add is that Labview uses two different algorithms (i think there was only low discrepancy sampling in Pattern match 3):

 

1. Low discrepancy sampling and

2. Pyramid based matching (which is further divided into grayscale and gradient).

 

These features are used mainly for computational time purpose. For example, pyramid matching reduces the size of the source image and the template and thus achieving less computational cost. You can read about pyramid based correlation online - there are quite a few papers that deal with it...

 

Anyway, pattern matching will not work with significant scale changes or occlussions. Use geometric matching to deal with these.

 

Could you show an image of positive and negatve match?

 

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 5 of 10
(7,248 Views)
Hi
All I know about the pattern matching algorithm of LabView is from the link
Can you give any detail information on that? and I know that is normalized cross-correlation not only cross-correlation
Thanks for helping me
0 Kudos
Message 6 of 10
(7,234 Views)

Hello,

 

http://lmgtfy.com/?q=template+matching+using+normalized+cross+correlation

 

http://zone.ni.com/reference/en-XX/help/372916P-01/nivisionconcepts/pattern_matching_indepth/

 

(the above link seems to be missing the normalized cross correlation part - check the NI Vision Concepts Manual on your hard drive)

 

Also, I have attached an example of normalized cross correlation calculation using the Labview's inbuilt .vi (that essentially calculates the normalized correlation metric).

 

Since you were asking about pattern match 4, the Labview example is saved for 2013 version.

 

Hope this helps!

 

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 7 of 10
(7,230 Views)

Kelemn

I know what is normalized cross-correlation and i already madde a VI on that. I want to know in depth information about how they are doing the process like low discrepancy sampling and Pyramid based matching (which is further divided into grayscale and gradient). I want to know how they are doing it.

Thanks

0 Kudos
Message 8 of 10
(7,215 Views)

Hello,

 

in this case I suggest you search for some related papers, for example:

 

http://link.springer.com/article/10.1007%2Fs00138-007-0089-8

 

I think all algorithms implemented in image processing software have some background and were previously published one way or another.

 

Your original question was about negative detection of your object in some cases. Have you checked the advances options for pattern matching (max pyramid level or low discrepancy step size, etc...).

 

Sorry I can't be of any more help!

 

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 9 of 10
(7,202 Views)

Uses a grayscale value pyramid algorithm. This algorithm uses normalized gray values as features. It is useful when the template does not contain structured information but has intricate textures for dense edges



Don't understand this         grayscale value pyramid  


Do you know there is an algorithm for this


thank



0 Kudos
Message 10 of 10
(2,899 Views)