Note: It seems that it's not valid against jpg image.
I=imread('d:\Pict\tiff\spine.tif');
subplot(2, 2, 1); imshow(A);title('Original Image');
h = fspecial('sobel');
A = imfilter(I, h);
subplot(2, 2, 2); imshow(A);title('Horizontal Sobel');
B=edge(I, 'sobel', [], 'both');
subplot(2, 2, 3); imshow(B);title('Sobel');
C=edge(I, 'canny', [], 1);
subplot(2, 2, 4); imshow(C);title('Canny');