File Exchange Pick of the Week

Our best user submissions

How noisy are your images…revisited


Brett's Pick this week includes nods to two readers, and a submission called Fast Noise Estimation in Images by Tolga Birdal.

In my last post, back in September, I discussed several files for quantifying noise in images, without reference to a gold-standard image. I Picked and compared three submissions that simplified the quantification of image noise in isolated images. All of my tests, however, were conducted against image files that I had artificially blurred. Eric and Marco correctly took me to task for that, pointing out that 'blur' is not synonymous with 'noise' (though maybe we can agree that it can be a type of noise.)

Marco further pointed me to Tolga's submission, a fiendishly simple function that convolves the test image with a reference kernel to quantify noise.

In today's post, I would like to revisit noise quantification using my previous Picks, and Tolga's, and to look at their application to images containing different types of noise. I will again use the "rice.png" image that ships with the Image Processing Toolbox to consider how each does in quantifying the five types of noise-- "contant Gaussian," "locally varying Gaussian," Poisson, salt-and-pepper, and speckle--created by the imnoise function. To start, I'm going to use default input parameters (where possible) in the calls to imnoise.

Create Noisy Images

img = cell(6,1);
img{1} = imread('rice.png');
imshow(img{1});title('No Noise');
img{2} = imnoise(img{1},'gaussian');
img{3} = imnoise(img{1},'localvar',0.05*rand(size(img{1})));
imshow(img{3});title('Local Gaussian');
img{4} = imnoise(img{1},'poisson');
img{5} = imnoise(img{1},'salt & pepper');
imshow(img{5});title('Salt & Pepper');
img{6} = imnoise(img{1},'speckle');

Quantifying Noise

Now consider how each of the tools we've discussed:

quantifies noise in each of these images:

for ii = 1:6
   imageBlur(ii) = blurMetric(img{ii});
   blindImageQuality(ii) = blindimagequality(img{ii},2);
   noiseLevel(ii) = NLEstimate(img{ii});
   fastNoiseEstimate(ii) = estimate_noise(img{ii});

Tabulate Results

NoiseTypes = {'NoNoise';'Gaussian';'LocalGaussian';'Poisson';'SaltAndPepper';'Speckle'};
Results = table(imageBlur,blindImageQuality,noiseLevelEstimage,fastNoise,...


Interpreting this table is difficult and subjective. We can't necessarily compare metrics (which are on different scales), and we can't assess how each metric reflects different levels of noise. So let's do another series of analyses, increasing the noise successively, and recalculating the metrics. We can then plot some trends.

Improving the analysis

Let's increment four types of noise (omitting Poisson noise, for which imnoise is not adjustable) five times and recompute the metrics:

noNoise = imread('rice.png');
index = 0;
for noiseType = 1:4
 % Loop over noise types
 for noiseLevel = 1:5
   index = index + 1;
   level = 0.01*noiseLevel;
   % Create noisy images and loop over metrics
   switch noiseType
    case 1
      str = ['Gaussian (' num2str(level) ')'];
      img{noiseType} = imnoise(noNoise,'gaussian',0,level);
    case 2
      str = [' Local Gaussian (' num2str(level) ')'];
      img{noiseType} = imnoise(noNoise,'localvar',level*rand(size(noNoise)));
    case 3
      str = ['Salt & Pepper (' num2str(level) ')'];
      img{noiseType} = imnoise(noNoise,'salt & pepper',level);
    case 4
      str = ['Speckle (' num2str(level) ')'];
      img{noiseType} = imnoise(noNoise,'speckle',level);
   imageBlur(noiseType,noiseLevel) = blurMetric(img{noiseType});
   blindImageQuality(noiseType,noiseLevel) = blindimagequality(img{noiseType},2);
   noiseLevelEstimage(noiseType,noiseLevel) = NLEstimate(img{noiseType});
   fastNoise(noiseType,noiseLevel) = estimate_noise(img{noiseType});

Plotting the results

f = figure;
NoiseTypes = {'Gaussian';'LocalGaussian';'SaltAndPepper';'Speckle'};
for noiseType = 1:4
   ax = subplot(4,1,noiseType);
   noise = [Results{1,1},imageBlur(noiseType,:)];
   if noiseType == 1
      title('Normalized Noise Metrics','fontsize',12);
   hold on
   noise = [Results{1,2},blindImageQuality(noiseType,:)];
   noise = [Results{1,3},noiseLevelEstimage(noiseType,:)];
   noise = [Results{1,4},fastNoise(noiseType,:)];
   ax.XTick = 1:6;
   ax.XTickLabel = [];
ax.XTickLabel = 0:5;
xlabel('NOISE LEVEL')


Conclusions are easier to draw now. For the most part, we can see metric values monotonically increasing or decreasing with the amount of noise. (The trend is less important than the monotonicity; we can easily think of the metric values as quantifying image quality.)

One final comment: it's very possible--maybe even likely--that these metrics can be tweaked to give better results, and that they will perform differently for different image and noise types. I encourage you to play around with the inputs using your own images; hopefully this discussion will give you a framework for evaluating the different noise metrics.


Swag, and thanks, are due to Eric, Marco, and Tolga!

As always, I welcome your thoughts and comments.

Published with MATLAB® R2014b

  • print
  • send email


要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。