I=imread('a.jpg');
r=rgb2gray(I);

BW2 = edge(r,'roberts');
figure('name','roberts');
imshow(~BW2);
BW3 = edge(r,'sobel');
figure('name','sobel');
imshow(~BW3);
BW4 = edge(r,'prewitt');
figure('name','prewitt');
imshow(~BW4);
BW5 = edge(r,'LoG');
figure('name','LoG');
imshow(~BW5);
BW6 = edge(r,'canny');
figure('name','canny');
imshow(~BW6);