%浮雕效果 handles.pic=imread('I:\技术照片\手绘油画\psb.jpg');% handles.pic=imread('I:\技术照片\手绘油画\IMG_0418_083349.jpg');%改为灰度图像 f0=rgb2gray(handles.pic); %加入高斯噪声 f1=imnoise (f0,'speckle',0.01); %加入密度0.01的高斯乘性噪声 f1=im2double(f1); %给定均值滤波窗口 h3=1/9.*[1 1 1; 1 1 1; 1 1 1 ]; %采用H3对F2进行卷积滤波 f4=conv2(f1,h3,'same'); %进行sobel滤波h2=fspecial('sobel'); g3=filter2(h2,f1,'same'); K=mat2gray(g3); figure(5),imshow(K);title('浮雕效果');