基于稀疏约束的图像去噪算法研究(Matlab代码实现)

编程入门 行业动态 更新时间:2024-10-23 07:25:41

基于<a href=https://www.elefans.com/category/jswz/34/1767749.html style=稀疏约束的图像去噪算法研究(Matlab代码实现)"/>

基于稀疏约束的图像去噪算法研究(Matlab代码实现)

 💥💥💞💞欢迎来到本博客❤️❤️💥💥

🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

⛳️座右铭:行百里者,半于九十。

目录

💥1 概述

📚2 运行结果

🎉3 参考文献

🌈4 Matlab代码实现

💥1 概述

图像数据在人们日常的沟通和交流中不可或缺,然而图像在传输和接收等过程中,往往会因为硬件设备等原因受到噪声的干扰,这会降低图像的质量,并影响后续对图像的处理与分析。因此,去除图像噪声至关重要。目前,如何在去除噪声的同时保护图像的纹理细节仍是亟待解决的问题。近年来,稀疏表示理论的兴起使图像去噪取得了较大的突破。

📚2 运行结果

 部分代码:

pathname        = uigetdir;
allfiles        = dir(fullfile(pathname,'*.jpg'));
xts=[];         % initialize testing inputs
for i=1:size(allfiles,1)    
x=imread([pathname '\\' allfiles(i).name]);
x=imresize(x,gamma);
x=rgb2gray(x);
x=double(x);
xts=[xts; x];% testing set building
end

%% Initialization of the Algorithm
NumberofHiddenNeurons=500;  % number of neurons
D_ratio=0.35;               % the ratio of noise in each chosen frame
DB=1;                       % the power of white gaussian noise in decibels 
ActivationFunction='sig';   % Activation function
frame=20;                   % size of each frame
%% Train and test
%%

%  During training, gaussian white noise and zeros will be added to 
%  randomly chosen frames .
%  The Autoencoder will be trained to avoide this type of data corruption.

[AE_net]=elm_AE(xtr,xts,NumberofHiddenNeurons,ActivationFunction,D_ratio,DB,frame)
%% Important Note: 
%%

%  After completing the training process,we will no longer in need  To use 
%  InputWeight for mapping the inputs to the hidden layer, and  instead of 
%  that we will use the Outputweights beta  for coding and decoding phases
%  and also we can't use the activation  functon because  beta  is coputed 
%  after the activation .
%  The same thing is applied on biases (please for more details check the 
%  function'ELM_AE' at the testing phase).

%% Illustration
subplot(121)
corrupted=AE_net.x(:,1:gamma(2)*2);
imshow(corrupted')
title('corrupted images ');
subplot(122)
regenerated=AE_net.Ytr_hat(:,1:gamma(2)*2);
imagesc(regenerated'), colormap('gray');
title('regenerated images');

%% scale training dataset
T=Tinputs';T = scaledata(T,0,1);% memorize originale copy of the input and use it as a target
P=Tinputs';
%% scale training dataset
TV.T=Tsinputs';TV.T = scaledata(TV.T,0,1);% memorize originale copy of the input and use it as a target
TV.P=Tsinputs';TV.P = scaledata(TV.P,0,1);% temporal input
TVT=TV.T;%save acopy as an output of the function

%% in the 1st and 2nd step we will corrupte the temporal input
PtNoise=zeros(size(P));
i=1;
while i < size(P,2)-frame
gen=randi([0,1],1,1);
PNoise=[];

%%% 1st step: generate set of indexes to set some input's values to zero later 
%%% (here we set them randomly and you can choose them by probability)%%%
[zeroind] = dividerand(size(P,1),1-D_ratio,0,D_ratio);% generate indexes
%%% 2nd step: add gaussian noise 
if gen==1
Noise=wgn(1,size(P,1),DB)';% generate white gaussian noise
else
Noise=zeros(1,size(P,1))'; 
end

for j=1:frame;%copy  noise
PNoise=[PNoise Noise];
end
if gen==1
for j=1:length(zeroind);% set to zero
    PNoise(zeroind(j),:)=0;
    P(zeroind(j),i:i+frame)=0;
end
end

PtNoise(:,i:i+frame-1)=PNoise;
i=i+frame;
end
 

🎉3 参考文献

部分理论来源于网络,如有侵权请联系删除。

[1]P. Vincent, H. Larochelle, I. Lajoie, Y. Bengio, and P.-A. Manzagol, “Stacked Denoising Autoencoders: Learning Useful Representations in a Deep Network with a Local Denoising Criterion,” J. Mach. Learn. Res., vol. 11, no. 3, pp. 3371–3408, 2010.
[2]L. le Cao, W. bing Huang, and F. chun Sun, “Building feature space of extreme learning machine with sparse denoising stacked-autoencoder,” Neurocomputing, vol. 174, pp. 60–71, 2016.
[3]G. Bin Huang, “What are Extreme Learning Machines? Filling the Gap Between Frank Rosenblatt’s Dream and John von Neumann’s Puzzle,” Cognit. Comput., vol. 7, no. 3, pp. 263–278, 2015.

🌈4 Matlab代码实现

更多推荐

基于稀疏约束的图像去噪算法研究(Matlab代码实现)

本文发布于:2024-03-08 19:23:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1722022.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:稀疏   算法   图像   代码   Matlab

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!