当前位置:网站首页>【图像去噪】基于matlab双立方插值和稀疏表示图像去噪【含Matlab源码 2009期】
【图像去噪】基于matlab双立方插值和稀疏表示图像去噪【含Matlab源码 2009期】
2022-08-02 06:34:00 【海神之光】
一、稀疏表示模型简介
图像的稀疏表示能够更好地表示出图像的特征, 其理论依据就是, 有用的图像信号是有序的, 而噪声普遍是杂乱无章的, 因此可以提取出能够表示图像特有奇异性特征的信息, 比如边缘、线段、条纹、端点等, 再用特定的过完备字典中的原子进行线性组合, 重构出这些特征信息。红外图像相比于普通的可见光图像更易于受到各种噪声的干扰, 图像的边缘以及纹理等特征更加模糊不清。传统的空域、频域图像去噪方法对红外图像的去噪效果并不理想, 所以我们提出基于稀疏表示的红外图像去噪方法。
基于稀疏表示的图像去噪方法先将待处理的图像分成n×n的图像块, 然后对这些图像块分别进行稀疏分解, 以滤除图像中的噪声, 再将图像块拼接成去噪后的完整图像。
对于一个给定的图像块信号x∈RN, 用一个过完备字典Φ=[d1, d2, …, dK]∈RN×K (N<K) 中元素的线性组合来表示:
α=[α1, α2, …, αK]T∈RK是稀疏矩阵信号, 则基于过完备字典的图像稀疏表示x即:
l0范数可以转换为l1范数的凸优化问题, 即:
考虑到实际情况下红外图像去噪这一问题, 上式可以写为以下不等式:
把式 (4) 中求解得到的每一个图像块拼接在一起, 得到去噪后的完整图像。对于给定的图像X∈RM, 可以分割成许多小的图像块xi=Rix, 其中Ri为分割矩阵[5]。为了防止在图像边界留下拼接的痕迹, 采用重叠的方式分解图像, 因此这种方法会在图像块元素间存在冗余。所以由图像块重构的去噪后的图像是一个欠定问题, 可用最小二乘法来解决, 得到以下的解析解:
二、部分源代码
clear all; clc;
% read test image
im_l = imread('Data/Testing/input.bmp');
% set parameters
lambda = 0.2; % sparsity regularization
overlap = 4; % the more overlap the better (patch size 5x5)
up_scale = 2; % scaling factor, depending on the trained dictionary
maxIter = 20; % if 0, do not use backprojection
% load dictionary
load('Dictionary/D_1024_0.15_5.mat');
% change color space, work on illuminance only
im_l_ycbcr = rgb2ycbcr(im_l);
im_l_y = im_l_ycbcr(:, :, 1);
im_l_cb = im_l_ycbcr(:, :, 2);
im_l_cr = im_l_ycbcr(:, :, 3);
% image super-resolution based on sparse representation
[im_h_y] = ScSR(im_l_y, 2, Dh, Dl, lambda, overlap);
[im_h_y] = backprojection(im_h_y, im_l_y, maxIter);
% upscale the chrominance simply by "bicubic"
[nrow, ncol] = size(im_h_y);
im_h_cb = imresize(im_l_cb, [nrow, ncol], 'bicubic');
im_h_cr = imresize(im_l_cr, [nrow, ncol], 'bicubic');
im_h_ycbcr = zeros([nrow, ncol, 3]);
im_h_ycbcr(:, :, 1) = im_h_y;
im_h_ycbcr(:, :, 2) = im_h_cb;
im_h_ycbcr(:, :, 3) = im_h_cr;
im_h = ycbcr2rgb(uint8(im_h_ycbcr));
% bicubic interpolation for reference
im_b = imresize(im_l, [nrow, ncol], 'bicubic');
% read ground truth image
im = imread('Data/Testing/gnd.bmp');
% compute PSNR for the illuminance channel
bb_rmse = compute_rmse(im, im_b);
sp_rmse = compute_rmse(im, im_h);
bb_psnr = 20*log10(255/bb_rmse);
sp_psnr = 20*log10(255/sp_rmse);
% show the images
figure,
subplot(131),imshow(im_l);title('原图')
subplot(132),imshow(im_h);
title(['PSNR for 稀疏表示',num2str( sp_psnr)]);
subplot(133), imshow(im_b);
title(['PSNR for 双立方插值',num2str(bb_psnr)]);
三、运行结果

四、matlab版本及参考文献
1 matlab版本
2014a
2 参考文献
[1] 何培亮,舒倩.基于稀疏表示的红外图像去噪算法研究[J].红外. 2018,39(10)
3 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除
边栏推荐
猜你喜欢

CAT1 4G+Ethernet development board Tencent cloud mobile phone WeChat applet display temperature and delivery control

张驰课堂:六西格玛测量系统的误差分析与判定

有人开源全凭“为爱发电”,有人却用开源“搞到了钱”

Vscode连接远程服务器出现‘Acquiring lock on/home/~’问题

Vscode connect to remote server "Acquiring the lock on the/home / ~ 'problem

Clapper that can interact with the audience in real time

Unity Shader学习(七)纹理图像的简单使用

See the picture to understand | How to choose sales indicators to measure the health of business growth

关于ue4.27像素流送打包后的本地服务器问题

堡垒机、堡垒机的原理
随机推荐
项目开发规范
chrome plugin development guide
Servlet
In-depth analysis of the initialization of member variables and local variables
MySQL Advanced Statements (1)
postgres 多个变量填充字符串,字串格式化
Expert Insights | 3 ways to seize innovation opportunities in a downturn
(笔记整理未完成)【图论】图的遍历
chrome 插件开发指南
返回文件名问题
System.Security.SecurityException: 未找到源,但未能搜索某些或全部事件日志。不可 访问的日志: Security
宝塔+FastAdmin 404 Not Found
MQ带来的一些问题、及解决方案
(Part of it is not understood, and the notes are not completed) [Graph Theory] Difference Constraints
APP special test: traffic test
暑期总结(三)
Understand C operators in one article
Connection reset by peer 问题解析
rhce homework
【暑期每日一题】洛谷 P1192 台阶问题