You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
%% Regenration des variables%chargement imagecanards=imread('canards.png');#conversion en niveaux de grisim=double(rgb2gray(canards));save("canards.mat",'im')%Initialisation de la graine pour le generateur de nombres aleatoiresseed_number=2020;rand("seed",seed_number);randn("seed",seed_number);%Ajout de bruit blanc GaussianSignalToNoiseRatio=5e2; #Rapport Signal a Bruitsigma=norm(double(im))/SignalToNoiseRatio;im_b=im+sigma*randn(size(im));save("canards_gauss.mat",'im_b');%Ajout de bruit selratio = 4e-1; %ratio de pixel bruitesbruit_sel = rand(size(im))<ratio;max_type = double(intmax(class(canards))); %get the maximum of data typeim_sel=im+bruit_sel*max_type;save("canards_sel.mat",'im_sel');%Ajout de bruit selbruit_poivre = rand(size(im))>ratio;im_poivre=im.*bruit_poivre;save("canards_poivre.mat",'im_poivre')#affichagefigure(1)subplot(221)colormap('gray')imagesc(im)title('Originale')subplot(222)colormap('gray')imagesc(im_b)title('Bruit Gaussien')subplot(223)colormap('gray')imagesc(im_sel)title('Bruit Sel')subplot(224)colormap('gray')imagesc(im_poivre)title('Bruit Poivre')