Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
noise.m
Package: wavelet_denoise.zip [view]
Upload User: lcj80317
Upload Date: 2007-01-26
Package Size: 625k
Code Size: 1k
Category:
Wavelet
Development Platform:
Matlab
- function nX = noise(varargin)
- % 图像加入噪声
- % 传入参数依次为:
- % X - 待处理的图像
- % type - 噪声类型
- % variance/density - 高斯噪声的方差/椒盐噪声的密度(optional)
- % M - 控制噪声区域的模板(optional)
- % 参数默认值
- variance = 0.01; %高斯噪声的方差 默认值为0.01
- density = 0.05; %椒盐噪声的密度 默认值为0.05
- M = ones(size(varargin{1})); %控制噪声区域的模板 默认对整个图像加噪声
- X = varargin{1}; %待处理的图像
- type = varargin{2}; %噪声类型
- % 可选参数
- if nargin>=3
- variance = varargin{3};
- density = varargin{3};
- if nargin == 4
- M = varargin{4};
- end
- end
- switch type
- case 'gaussian' %高斯噪声
- n = randn(size(X)) * sqrt(variance);
- n = n .* M;
- nX = X + n;
- case 'salt & pepper' %椒盐噪声
- nX = X;
- n = rand(size(X));
- n = n .* M;
- ind = find( n>0 & n<density/2);
- nX(ind) = 0;
- ind = find( n>=density/2 & n<density);
- nX(ind) = 1;
- end