Template matching not invariant to rotation and scale, but should detect defects of 3x3 pixel size or more

2 次查看(过去 30 天)
Hello,
I want to compare the specific pattern as on the template. I want to send Yes/No based on the matching result.
It should be(Translation invariant and rotation invariant). Also I want the matching result as 'No' even if there is noise on the image and also if there is a small change in the pattern.
I am sending here the sample error images. I want the code to send the output as ' No'. for the first and the second image. Image1 details:Image where there is a smudge during the printing of the BAR CODE Image2 details: Bar code line is missing
Image3: Correct image without any defects.Template is extracted from this image
Errors block is marked with red
I tried the function
template_matching() in MATLAB .But this function detects even when the the line is missing in the image or even if it has noise.
I also tried Template Matching method using
Correlation Coefficients by Yue Wu. It is similar to the above method and also it takes more time.
In few cases where the pattern is completely absent also still it detects. All the methods which i have tried are rotation invariant.
So I am using SURF Feature extraction method and then finding the angle and re correcting the image using
imrotate() and then apply template matching,but still the output is not as per my requirements.
Any help from your side is appreciated.
Looking forward to hear from you .
Thanks
Pankaja

回答(1 个)

Dima Lisin
Dima Lisin 2015-3-20
This example may be helpful.

类别

Help CenterFile Exchange 中查找有关 Computer Vision with Simulink 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by