Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Geometric Template Matching Scale Factor

Hey,

 

I've been having some problems with the Geometric Pattern matching. I have a few images that I've been testing, and it seems like the scale factor I specify doesn't compensate for different sizes in the image.

 

The three images are attached below. all.jpg is being successfully matched and the match cluster says it has a scale factor of 70%. I took the all image and increased it's size slightly to create all2.jpg. all2.jpg cannot be matched. I increased the size by 25%, and in the geometic pattern matching stuff I have a range of 25% to 150% so it seems like it should still be matched.

 

Any help would be appreciated,

Kevin

Download All
0 Kudos
Message 1 of 4
(3,825 Views)

Here is the vi I was testing with.

0 Kudos
Message 2 of 4
(3,824 Views)

Rotation is most likely the problem. If possible try to either rotate your images or your template. Another thing is that providing wide range of input parameters doesn't make results better. So when you put scale range from 50 to 150 it doesn't mean that algorithm will be as accurate as when you put say from 95 to 105. It actually interesting how these numbers work because sometimes changing them just by one (for example 49 to 151 or something like that) make it possible to find a match.

www.xinstruments.com - Custom Software for Industrial Automation

www.hdrconverter.com - Picture processing made easy

0 Kudos
Message 3 of 4
(3,759 Views)

That's interesting you would think that rotation was the problem after I explained taking all.jpg and increasing it's size to create all2.jpg, and that change caused all2.jpg to no longer contain a pattern match. So, I took all2.jpg and created all3.jpg by rotating all2.jpg to match the rotation of template.jpg. all3.jpg also does not contain a pattern match. Now for fun, I'll take all.jpg and create all4.jpg by rotating all.jpg to match template.jpg. all4.jpg also contains a match. So to summarize my findings:

 

  1. all.jpg - original - pattern found
  2. all2.jpg - all.jpg size increase - pattern not found
  3. all3.jpg - all2.jpg rotated - pattern not found
  4. all4.jpg - all.jpg rotated - pattern found

 

This leads me to believe that the pattern matching is not accounting for the scale factor, but is accounting for the rotation. Although, the interesting thing is all2.jpg is closer in size to the template than all.jpg.

Download All
0 Kudos
Message 4 of 4
(3,744 Views)