how to make feature vector after edge detection?
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
Image Analyst
2017 年 4 月 19 日
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.
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!