06-23-2015 07:41 AM
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!
The template used:
06-24-2015 03:47 AM
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.
06-24-2015 10:34 AM
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
06-25-2015 03:35 AM
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.
06-25-2015 08:30 AM
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
06-25-2015 08:57 AM
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...