How can i find the position of a subimage in larger image ?

12 vues (au cours des 30 derniers jours)
Mariem Harmassi
Mariem Harmassi le 13 Fév 2013
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

Réponse acceptée

Thorsten
Thorsten le 13 Fév 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')

Plus de réponses (1)

Image Analyst
Image Analyst le 7 Nov 2015
Use normxcorr2(). See my demo of it, attached.

Catégories

En savoir plus sur Geometric Transformation and Image Registration dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by