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

조회 수: 12 (최근 30일)
Mariem Harmassi
Mariem Harmassi 2013년 2월 13일
답변: Image Analyst 2015년 11월 7일
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

채택된 답변

Thorsten
Thorsten 2013년 2월 13일
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')

추가 답변 (1개)

Image Analyst
Image Analyst 2015년 11월 7일
Use normxcorr2(). See my demo of it, attached.

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by