Pattern Extraction from Images using Correlation

2 views (last 30 days)
For this problem, use the files, image1.mat and image1_pattern.mat. The image1.mat is an image consisting of multiple patterns, of which one pattern has been extracted and stored in image1_pattern.mat. Your job is to use correlation to automatically extract the centre co-ordinates of the location on image1_pattern in the original image image1. Write a simple MATLAB script for this purpose. You only need to compute the crosscorrelation between image1_pattern and blocks from image1 by sliding the image1_pattern by one pixel each time (for each row) and repeat the same over all rows. The block size to be selected from image1 will be same as the size of the image_pattern1. Please comment your script properly and give plot of the correlation result (itself an image) using the imshow() or imagesc() function of MATLAB. Your final answer should be the centre co-ordinates of the pattern location in image1 identified automatically (and not hard coded, i.e., if I change image1_pattern, your code should still work.).
can any one give me code of above description...

Answers (1)

Image Analyst
Image Analyst on 2 Oct 2013
What version of MATLAB do you have? I have R2013a. Did you look up correlation in the help and notice the example? The example in the help for the xcorr2() function seems to be the answer to your question, maybe with only slight adaptations. Did you try it?

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!