img = imread('.\lena.tif');
%%img = imread('.\images\lena_gray.tif');
img = double(img)/255;
img = img+0.05*randn(size(img));
img(img<0) = 0; img(img>1) = 1;
%img = imnoise(img,'gaussian');
figure, imshow(img,[])
title('原始图像')
d = 6;
sigma = [3 0.1];
resultI = BilateralFilt2(double(img), d, sigma);
figure, imshow(resultI,[])
title('双边滤波后的图像')
结果:
Reference:
1.C Tomasi, R Manduchi.Bilateral Filtering for Gray and Color Images, - Computer Vision, 1998.