%代码
I=imread('body.tif');
I=im2double(I);
subplot(2,4,1),imshow(I),title('1:原始图像');
%为原始图像增加模版为[ ... ...](此处省略)的滤波器对图像进行拉普拉斯操作
h=[-1,-1,-1;-1,8,-1;-1,-1,-1];
I1=imfilter(I,h);
subplot(2,4,2),imshow(I1,[ ]),title('2:拉普拉斯');
I2=I+I1;
subplot(2,4,3),imshow(I2,[ ]),title('3:图1和图2叠加');
%对原图用sobel梯度操作,照样用gx,gy的分量模版
hx=[-1,-2,-1;0,0,0;1,2,1];
hy=[-1,0,1;-2,0,2;-1,0,1];
gradx=filter2(hx,I,'same');
gradx=abs(gradx);
grady=filter2(hy,I,'same');
grady=abs(grady);
I3=gradx+grady;
subplot(2,4,4),imshow(I3,[ ]),title('4:sobel梯度处理');
%用5*5的均值滤波器对图4做平滑处理
h1=fspecial('average',5);
I4=imfilter(I3,h1);
subplot(2,4,5),imshow(I4,[ ]),title('5:平滑后的sobel图');
%图3和图5相乘 进行点乘
I5=I2.*I4 %如若报错,则需要数字图像转换成double类型
subplot(2,4,6),imshow(I5,[ ]),title('6:图3和图5相乘');
%图