⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compute_impulse_noise.m

📁 A toolbox for the non-local means algorithm
💻 M
字号:
function M = compute_impulse_noise(M,p,sigma,mu)% compute_impulse_noise - add impulse noise to an image%%	M = compute_impulse_noise(M,p,sigma,mu);%%	p is the probability that one pixel is corrupted.%	sigma is the deviation of the corrupted pixels (uniform noise)%	mu is the mean%%	Copyright (c) 2007 Gabriel Peyreif nargin<2	p = 0.05;endif nargin<3	sigma = max(M(:)) - min(M(:)); endif nargin<4	mu = (max(M(:)) + min(M(:)))/2;endn = size(M);t = randperm(n^2); t = t(1:round(p*n^2));M = M0;% Mn(t) = mu + sigma*randn(length(t),1);M(t) = rand(length(t),1)*sigma + mu;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -