1 简介
随着工业技术的发展,数字化图像获取设备越来越多,数字图像的应用环境也越来越广泛。数字图像在医学、航天、军事、气象、传媒等诸多领域都起着举足轻重的作用。由于图像在获取和传播过程中不可避免地会受到噪声污染,因此,图像去噪是图像处理的一个关键环节。
去噪效果也直接影响到图像分析、识别等后续任务。图像去噪目的是在尽可能保持图像有用细节的前提下,通过去除噪声,从而获得更为真实的图像。当今,无论在学术界还是工业界,图像去噪都是一个研究热点。
2 部分代码
%%denoising demo using Non-Local Euclidean Medians (NLEM)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% img : clean grayscale image
% h : width of Gaussian
% P : half-size of patch
% S : half-search window
%
% Author: Kunal N. Chaudhury
% Date: June 10, 2012
%
% Reference:
% K. N. Chaudhury, A. Singer, "Non-Local Euclidean Medians", IEEE Signal
% Processing Letters, vol. 19, no. 11, 2012.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc; clear all; close all force;
% clean image
img = double(imread('ckb.jpg'));
[m, n] = size(img);
% add noise
sigma = 70;
imgNoisy = img + sigma * randn(m,n);
% NLEM parameters
S = 10;
P = 3;
h = 10 * sigma;
% call NELM (or NLEM_kNN)
imgDenoised = NLEM(imgNoisy, h, P, S);
% show results
peak = max(max(img));
PSNR0 = 10 * log10(m * n * peak^2 / sum(sum((imgNoisy - img).^2)) );
PSNR1 = 10 * log10(m * n * peak^2 / sum(sum((imgDenoised - img).^2)) );
figure();
colormap gray,
subplot(1,3,1), imagesc(img),
title('Original', 'FontSize', 10), axis('image', 'off');
subplot(1,3,2), imagesc(imgNoisy),
title([ 'Noisy, ', num2str(PSNR0, '%.2f'), 'dB'] , 'FontSize', 10),
axis('image', 'off');
subplot(1,3,3), imagesc(imgDenoised),
title([ 'NLEM filtered, ', num2str(PSNR1, '%.2f'), 'dB'] , 'FontSize', 10),
axis('image', 'off');
3 仿真结果
4 参考文献
[1]孙忠贵. 非局部均值滤波器研究及应用[D]. 南京航空航天大学.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。