Adding Random valued impulse noise to an image

Version 1.0.0.0 (997 octets) par Sajid Khan
This function add random valued impulse noise of certain noise density and width
70 téléchargements
Mise à jour 3 avr. 2016

Afficher la licence

function [ image_noisy ] = addRVIN( image_input, ND, noise_width )
%ADDRVIN adds Random valued impulse noise to an image
% image_input Input noise free image
% ND is noise density that ranges from 0 to 1
% noise_width is width of random valued impulse noise
[~,x] = imhist(image_input);
init_width = x(noise_width);
image_noisy = image_input;
Narr = rand(size(image_noisy));
p = ND/2;
% image_noisy = (image_input + p*rand(size(image_input)))/(1+p);
image_rand = rand(size(image_input));
range_init = init_width;
image_randInit = image_rand*range_init;
% image_noisy(Narr<ND/2) = (init_width + image_rand(Narr<ND/2));
image_noisy(Narr<ND/2) = (image_randInit(Narr<ND/2));
% image_noisy(Narr<ND/2) = (noise_width + p*rand(size(image_input)))/(1+p);
image_randFinal = image_rand*range_init+ x(end) - x(noise_width+1);
image_noisy((Narr>=ND/2)&(Narr<ND)) = image_randFinal((Narr>=ND/2)&(Narr<ND));
% figure, imhist(image_input)
% figure, imhist(image_noisy)

end

Citation pour cette source

Sajid Khan (2024). Adding Random valued impulse noise to an image (https://www.mathworks.com/matlabcentral/fileexchange/56324-adding-random-valued-impulse-noise-to-an-image), MATLAB Central File Exchange. Extrait(e) le .

Compatibilité avec les versions de MATLAB
Créé avec R2015b
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version
1.0.0.0

Histogram added