how to make feature vector after edge detection?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
A=imread('218.jpg');
% HSV=rgb2hsv(A);% I=uint8(I);
% figure,imshow(HSV);title('Filtered Image');
%
% imshow(HSV);
HSV=zeros(size(A));
F1=[-1 -1 -1;0 0 0; 1 1 1];
F2=[-1 0 1;-1 0 1; -1 0 1];
A=double(A);
% Gx=[-1+0+1]-[-1+0+1];
% Gy=[-1+0+1]-[-1+0+1];
for i=1:size(A,1)-2
for j=1:size(A,2)-2
%Gradient operations
Gx=sum(sum(F1.*A(i:i+2,j:j+2)));
Gy=sum(sum(F2.*A(i:i+2,j:j+2)));
%Magnitude of vector
HSV(i+1,j+1)=sqrt(Gx.^2+Gy.^2);
end
end
%Define a threshold value
Thresh=210;
B=max(HSV,Thresh);
B(B==round(Thresh))=0;
figure,imshow(B);title('Edge detected Image');
3 comentarios
Image Analyst
el 19 de Abr. de 2017
Why? And it's easy to take the coordinates of an edge as a list of (x,y) coordinates if that's what you want using the find() function.
Respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!