Edge

From Ilianko
Revision as of 14:19, 22 April 2015 by Anko (talk | contribs) (Created page with "<code><pre> im = imread("lena.tif"); Sy = [-1 -2 -1; 0 0 0; 1 2 1]; Sx = Sy'; Gr = im(:,:,1)*0.2+im(:,:,2)*0.7+im(:,:,3)*0.1; DimY = conv2(Sy,Gr); DimX = conv2(Sx,Gr); Dim...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
im = imread("lena.tif");

Sy = [-1 -2 -1; 0 0 0; 1 2 1];
Sx = Sy';

Gr = im(:,:,1)*0.2+im(:,:,2)*0.7+im(:,:,3)*0.1;

DimY = conv2(Sy,Gr);
DimX = conv2(Sx,Gr);

DimYn = DimY./max(max(DimY));
DimXn = DimX./max(max(DimX));
figure
imshow(DimYn);
figure
imshow(DimXn);


Dim = (DimY.^2 + DimX.^2).^(1/2);
Dimn = Dim./max(max(Dim));
figure
imshow(Dimn)
figure
imshow(Dimn > 0.2)