Professional Documents
Culture Documents
Fuzzy
Sobel
Canny
Prewitt
Contoh fuzzy:
Dengan kodingnya
A=imread('D:\Fashion\2.jpg');
B= RGB2gray(A);
I = double(B);
classType = class(B);
scalingFactor = double(intmax(classType));
I = I/scalingFactor;
Gx = [-1 1];
Gy = Gx';
Ix = conv2(I,Gx,'same');
Iy = conv2(I,Gy,'same');
Contoh Sobel
A=imread('D:\Fashion\2.jpg');
I=RGB2gray(A)
BW0 = edge(I,'sobel');
subplot(1,2,1);imshow(I)
subplot(1,2,2);imshow(BW0)
Contoh Canny
A=imread('D:\Fashion\2.jpg');
I=RGB2gray(A)
BW2 = edge(I,'canny');
subplot(1,2,1);imshow(I)
subplot(1,2,2);imshow(BW2)
Contoh Prewitt
A=imread('D:\Fashion\2.jpg');
I=RGB2gray(A)
BW0 = edge(I,'sobel');
BW1 = edge(I,'prewitt');
BW2 = edge(I,'canny');
subplot(1,2,1);imshow(I)
subplot(1,2,2);imshow(BW1)