里面用的代码和图片
clear
ori_mag=imread('photo3.bmp');
r=double(ori_mag(:,:,1));
g=double(ori_mag(:,:,2));
b=double(ori_mag(:,:,3));
figure,imshow(ori_mag,[]);title('original image')
cc=cat(3,r,g,b);
% w=double([0,-1,0;-1,5,-1;0,-1,0]); %sharpen 锐化 算子
% w=double(ones(20)); %blur 模糊 smooth average
% w=double(diag([1,1,1,1,1,1,1,1,1]));% motion blur 9*9
% w=double([0,0.2,0;0.2,0.2,0.2;0,0.2,0]); % blur 邻域加权
% w=double([0,0,0;-1,1,0;0,0,0]); %edge_enhance 边缘增强
% w=double([0,1,0;1,-4,1;0,1,0]); %edge_detect 边缘检测 图像锐化,拉普拉斯算子
% w=double([0,0,0;-1,2,-1;0,0,0]); % edge_detect horizontal 水平边缘检测
% w=double([0,-1,0;0,2,0;0,-1,0]); % edge_detect vertical 垂直边缘检测
% w=double([-2,-1,0;-1,1,1;0,1,2]); %emboss 浮雕
% w=double([-1,-1,-1;0,0,0;1,1,1]); % gradient detection 3*3 convolution
% kernels GH 水平梯度 kron([-1,0,1]',[1,1,1])