当前位置:网站首页>【图像去噪】基于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 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除
边栏推荐
- 论文《Deep Multifaceted Transformers for Multi-objective Ranking in Large-Scale E-commerce Recommender》
- 【暑期每日一题】洛谷 P1255 数楼梯
- 返回文件名问题
- 张驰咨询:企业实施精益管理的最大障碍,只把精益作为一种工具和方法
- HCIP day 3 experiment
- MySql - there is no insert, there is update or ignored
- PHP Warning: putenv() has been disabled for security reasons in phar
- Resolving C# non-static field, method or property "islandnum.Program.getIslandCount(int[][], int, int)" requires an object reference
- MySQL Advanced - MVCC (ultra-detailed finishing)
- (笔记整理未完成)【图论】图的遍历
猜你喜欢
随机推荐
About the local server problem after ue4.27 pixel streaming package
交换部分 VLAN
Understand C operators in one article
C# FileInfo类
【npm install 报错问题合集】- npm ERR! code ENOTEMPTY npm ERR! syscall rmdir
punch day05
MySQL (3)
pointer arithmetic in c language
PHP Warning: putenv() has been disabled for security reasons in phar
获取间隔的日期列表工具类
mysql 注入
PHP Warning: putenv() has been disabled for security reasons in phar
Connection reset by peer problem analysis
2022.07.31(LC_6133_分组的最大数量)
yml字符串读取时转成数字了怎么解决
Pagoda+FastAdmin 404 Not Found
张驰咨询:企业实施精益管理的最大障碍,只把精益作为一种工具和方法
Toolbox App 1.25 New Features at a Glance | Version Update
SphereEx苗立尧:云原生架构下的Database Mesh研发实践
分离轴定理SAT凸多边形精确碰撞检测








![[数据集][VOC]眼睛佩戴数据集VOC格式6000张](/img/66/37f76d9ce5d5f68d6ea0e18710fa04.png)
