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

9 views (last 30 days)
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
  2 Comments
Pankaja Tanjore
Pankaja Tanjore on 23 Mar 2015
Hello Image Analyst,
My requirement is
the pattern matching after the rotation.
Please let me know the function in MATLAB to do this.
Thanks
Pankaja

Sign in to comment.

Answers (1)

Dima Lisin
Dima Lisin on 20 Mar 2015
This example may be helpful.

Community Treasure Hunt

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

Start Hunting!