Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using Pattern Matching with rotated patterns

Good day to all,
i was trying to improve my application that made use of the pattern matching algorithm found in the vision module. I need to implement the possibility to find rotated patterns of about 30°. So i open the Vision assistant and made some experiments. I had found a strange behavior that i will try to explain. Using the low discrepancy sampling the vision assistant was not able to identify correctly the pattern, if the search are was too strict to the object of inspection (but containing it completely). Enlarging the inspection are allowed the algorithm to correctly find the pattern. My question is: what size i must consider to permit the algorithm to work correctly?
I attach some images to explain better!

 

Immagine.jpg

 

Immagine2.jpg

 

The template used:

asde.png

0 Kudos
Message 1 of 6
(4,815 Views)

Hi,

pattern matching algorithm process the color distribution of the image. I suppose that the score result of the algorithm is lower on the smaller ROI. You can try reducing minimum score on Pattern Matching settings or increment the contrast and use Geometric Matching.

0 Kudos
Message 2 of 6
(4,795 Views)

I suspect it is related to the shape of the pattern and the rotation.  The search area has to fit inside the original ROI, so it needs to be as wide as the original pattern.  I think it only searches where the pattern completely fits inside the ROI.

 

If you rotated your pattern, I think the search would work with the original ROI.  Since your pattern is wide, you need a wide ROI for it to work.

 

If your pattern was square, this probably wouldn't be an issue at all.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 3 of 6
(4,787 Views)

I think you're right Bruce. Problem is i need to find a way to automate the roi shape calculation in case of rotated pattern.

0 Kudos
Message 4 of 6
(4,776 Views)

Calculate the diagonal length of your pattern, and that is the minimum width and height for your ROI.  That covers any rotation angle, as long as the match is entirely within the ROI.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 6
(4,769 Views)

BruceAmmons ha scritto:

Calculate the diagonal length of your pattern, and that is the minimum width and height for your ROI.  That covers any rotation angle, as long as the match is entirely within the ROI.

 

Bruce



I had done exactly like you suggest! Now some testing...

0 Kudos
Message 6 of 6
(4,764 Views)