Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to improve Pattern Matching Algorithm?

Do you have specific problem / reason that you want to improve the Pattern Matching Algorithm or is it complitly academic?

I might be able to help if you could discribe the issue. I am working with Pattern Matching on many projects.

Amit Shachaf
0 Kudos
Message 11 of 18
(2,491 Views)

Hi Amit, thank you for your interest.


Well, I do not have a specific problem. We're developing a user-programmable application to check for PTH components in PCBs. I found that sometimes the Pattern Match Alg. is not very consistent and could lead to unexpected behaviours. I think that the problem is that i try to apply only one type of P.M. Alg. (grayscale pyramid) to all the different components of the PCB. The biggest problems appear when a component could be rotated. Maybe you can give some guidelines to use one or others type of P.M. Alg.(Low Discrepancy vs Grayscale Pyramid vs Gradient Pyramid)?

 

Thank you very much!

 

Francesco

 

 

0 Kudos
Message 12 of 18
(2,453 Views)

I want to knote first that all PM algorithms (edge base and gray scale base) usually using image pyramid for doing the matching.

Consideration are somewhat diffrent.

Gray scale is very fast. But is not so good if you have contrast changes / dominat features changing.

Edge base is slower. But can have problem with high complexity target.

Both algorithms usually can handle rotation fairly well (depends on implamentation).

Would you be able to share some data? I could advice you better if I see images.

 

 

Amit Shachaf
0 Kudos
Message 13 of 18
(2,440 Views)

I will manage to obtain some images (i have no machine in my lab right now) menwhile: did ever used Low Discrepancy? Because seems to me that it's the most unstable.

0 Kudos
Message 14 of 18
(2,425 Views)

You need to clarify what is Low Discrepancy? Is it input to one of hte functions? Is it property of the images you get? 

Amit Shachaf
0 Kudos
Message 15 of 18
(2,408 Views)

NI Vision implements two pattern matching methods - Pyramidal matching and image understanding (low discrepancy sampling). Both methods use normalized cross-correlation as a core technique.

 

Pyramidal matching:The algorithm attempts to find an 'optimal' pyramid level (based on an analysis of template data) which would give the fastest and most accurate match. Two kinds of data can be used - gray value (based on pixel intensities) and gradients (based on select edge information).

 

Low discrepancy sampling extracts the most significant information to represent an image. While this leads to a very sparse and efficient representation in most cases, certain types of images are known to cause problems:

  • Templates containing large regions of similar grayscale information, with very little information, can sometimes exhibit inconsistent behavior due to a low number of sample points.
  • Templates with skewed or long aspect ratios (1:6) may suffer from inconsistent results when searching for rotated matches.
  • Very small templates are sometimes found to contain an insufficient number of samples for reliable training.

If these limitations negatively impact the performance of your application, use a pyramidal matching method.

-Having said that, Pattern matching algorithm works well with rotations provided you have taken proper care at creating template and learning phase.

-You can also try All option which takes all three methods into account and find the match.

-If you can take some sample images where it is failing along with template image it can help better to judge the accuracy.

 

Ref: http://zone.ni.com/reference/en-XX/help/370281AC-01/nivisionconcepts/pattern_matching_techniques/ and http://zone.ni.com/reference/en-XX/help/370281AC-01/imaqvision/imaq_match_pattern_4/

Thanks
uday
Message 16 of 18
(2,397 Views)

Excellent Explanation... Smiley Happy

0 Kudos
Message 17 of 18
(2,376 Views)

This is very simple . All you have to do two things 

1. set up the image acquistion setup(use camera, webcam)

2. Next use ni vision assistant to pattern matching by loading in templete . 

Note before creating labview vi form vision assistant do not forget to select control , plase make sure to select path of templete and second the number of match which give interger value of 0 or 1 of matching 

0 Kudos
Message 18 of 18
(2,329 Views)