how to match two imaes
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
sir i want to matchtwo iamgesin if statement me usee the code is given below:
h=subImage;
h1=imread('14.jpg');
A=rgb2gray(h);
A1=rgb2gray(h1);
% axes(handles.axes10);
% imshow(I);
% figure, imshow(A);
J=imhist(A);
J1=imhist(A1);
figure, imshow(J1);
E_distance= sqrt(sum((J-J1).^2));
if E_distance == 0
figure, imshow('14.jpg');
else E_distance == 1
figure, imshow('dar.jpg');
% w=imread('6.jpg');
% figure;
% imshow(w);
end
guidata(hObject, handles);
axis equal;
axis tight;
axis off;
the ans in cammand window is 0, but show the the pic which is in else block.. check my codee plzz
0 comentarios
Respuestas (2)
SRI
el 26 de Jul. de 2014
Hi Reema Just try this Code you can Find How many times does the image will be displayed, after running the program keep the mouse cursor on Flag and Count of the program it will show the number that much times your output will be displapayed..
clc; warning off;
A = imread('cameraman.tif');
B = imread('circles.png');
c = im2bw(A);
d = im2bw(B);
E = sqrt(sum(c-d).^2);
count = 1;
flag = 1;
for i = 1:length(E)
if E(i) > 100
imshow(c);
count = count+1;
else E(i) <= 100;
imshow(d)
flag = flag + 1;
end
end
0 comentarios
Image Analyst
el 26 de Jul. de 2014
When you say
if E_distance == 0
figure, imshow('14.jpg');
else E_distance == 1
figure, imshow('dar.jpg');
% w=imread('6.jpg');
% figure;
% imshow(w);
end
You're really doing
if E_distance == 0
figure
imshow('14.jpg');
else
E_distance == 1
figure
imshow('dar.jpg');
end
And since E_distance is not 1, and there is no semicolon, it will spit out an "ans = 0" to the command window.
12 comentarios
Image Analyst
el 9 de Ag. de 2014
Depends on what you mean. You can match histograms using this method or using the built-in imhistmatch(). You can find templates in a larger image using normxcorr2(). You can use SIFT or SURF (patented techniques) to do CBIR. You can use CBIR methods (Google it). Or you can just look at how everyone else does face recognition and copy their method.
Ver también
Categorías
Más información sobre Image Preview and Device Configuration en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!