✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
在联合冲击滤波器和非线性各向异性扩散滤波器对含噪图像做预处理的基础上,利用边缘检测算子选取自适应参数,构建能同时兼顾图像平滑去噪与边缘保留的自适应全变分模型,并基于 Bregman 迭代正则化方法设计了其快速迭代求解算法。实验结果表明,自适应去噪模型及其求解算法在快速去除噪声的同时保留了图像的边缘轮廓和纹理等细节信息,得到的复原图像在客观评价标准和主观视觉效果方面均有所提高。
⛄ 部分代码
% Read noise-free image
InputType=0;
while (InputType~=1 & InputType~=2 & InputType~=3 & InputType~=4)
InputType = input('\nReference image format:\n1. "*.tif"\n2. "*.sg2"\n3. "*.mat"\n4. "*.bmp"\n>> ');
end
imageload;
Iimage = SCAN; clear SCAN;
Iimage = double(Iimage);
% % add gaussian noise (standard deviation)
noisestd = input('Standard Deviation of added noise: ');
Nimage = Iimage + noisestd*randn(size(Iimage));
% % adaptive total variation denoising model
% % with fast solving algorithm
lambda = 0.005; % % regularization parameter
mu = 0.05;
% % smoother: smaller mu; larger lambda
kmax = 500; % maximum iteration number
threshold = 5e-5;
Dimage = Nimage; % initialization
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if size(Iimage,3) == 1
% % gray image
tic
Cparameter = ComputeParameter(Dimage,1);
[Dimage,Cparameter] = FastATV(Nimage,Dimage,Cparameter,lambda,mu,kmax,threshold);
toc
else
% % color image
tic
Cparameter = ComputeParameter(double(rgb2gray(uint8(Dimage))),1);
for k = 1:size(Iimage,3)
[Dimage(:,:,k),Cparameter]= FastATV(Nimage(:,:,k),Dimage(:,:,k),Cparameter,lambda,mu,kmax,threshold);
end
toc
end
% % save the restored image
imwrite(uint8(Nimage),['noiseimage',num2str(noisestd),'.tif'])
imwrite(uint8(Dimage),['denoisedimage',num2str(noisestd),'.tif'])
% % plot the denoised version
figure(1),
subplot(221);imshow(uint8(Iimage));title('原图')
subplot(222);imshow(uint8(Nimage));title('加噪图')
subplot(223);imshow(uint8(Dimage));title('去噪图')
subplot(224);,imagesc(Cparameter),colorbar,title('adaptive parameter')
⛄ 运行结果
⛄ 参考文献
[1] 牛和明, 杜茜, 张建勋. 一种自适应全变分图像去噪算法[J]. 模式识别与人工智能, 2011, 24(6):798-803.
[2] 周先春, 陈璟, 昝明远,等. 一种权值自适应混合阶全变分图像去噪算法:, CN112767272A[P]. 2021.
[3] 牛和明, 杜茜, 张建勋. 一种自适应全变分图像去噪算法[J]. 模式识别与人工智能, 2011, 24(6):6.
[4]刘文, 吴传生, 许田. 自适应全变分图像去噪模型及其快速求解[J]. 计算机应用研究, 2011, 28(12):4.