Matlab code for adding Gaussian noise of 30 db
    4 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Nithya SIvasamy
 il 19 Gen 2019
  
    
    
    
    
    Risposto: Image Analyst
      
      
 il 19 Gen 2019
            To an image I want to add the Gaussian noise of 5db to 50 db.Tried with the following code. But in the output image display,the output is common for 5db and 50 db
I = im2double(imread(('D:\Nithya\Original Brodatz\D001.gif')));
varI = std2(I)^2;
SNRdB = 5;
for i=1:numel(SNRdB)
  sigma_noise = sqrt(varI/10^(SNRdB(i)/10));
  N = sigma_noise*randn(size(I));
  IN1 = I+N; % using randn
  IN2 = imnoise(I, 'Gaussian', 0, sigma_noise^2); % using imnoise
  imshow([IN1 IN2])
  title(['SNR = ' int2str(SNRdB(i)) 'dB' ...
    ', \sigma_{noise} = ' num2str(sigma_noise)]);
 end
0 Commenti
Risposta accettata
  Image Analyst
      
      
 il 19 Gen 2019
        SNRdB is not a vector, so it makes no sense to do SNRdB(i) in your loop.  You will only get one value, whatever value it is, not both 5 and 50.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Image Segmentation and Analysis in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!