How can i find the position of a subimage in larger image ?
4 views (last 30 days)
Show older comments
Hello I have a sub-image X ,which is a subimage of Y .How can find the position of this subiamge in the image Y ? Can anyone help me
0 Comments
Accepted Answer
Thorsten
on 13 Feb 2013
F = im2double(imread('cameraman.tif'));
I = rand(512);
I([1:size(F,1)] + 30, [1:size(F,2)] + 80) = F;
disp('Search target using imfilter, this may take some time...')
If = imfilter(I, F);
[maxval ind] = max(If(:));
[y x] = ind2sub(size(If), ind);
imshow(I)
hold on
plot(x, y, 'rx')
0 Comments
More Answers (1)
See Also
Categories
Find more on Image Processing and Computer Vision in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!