how to make feature vector after edge detection?

1 Ansicht (letzte 30 Tage)
MAYA M
MAYA M am 11 Apr. 2017
Kommentiert: Image Analyst am 19 Apr. 2017
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 Kommentare
MAYA M
MAYA M am 19 Apr. 2017
my question is after detecting edge of 10 images. How can we make vector of this edge.
Image Analyst
Image Analyst am 19 Apr. 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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by