Search code examples
imagematlabnoise

What does clipping at Canon or FinePix ISO image mean?


I'm trying to review about the camera noise. Also I have reference as following http://www.cs.tut.fi/~foi/

But I want to know what does clipping mean at the following code.

:code

%% ====================================================================================================================================
            %% LOAD BITMAP/RAW IMAGE    %  raw-data images which are loaded below can be downloaded from http://www.cs.tut.fi/~foi/sensornoise.html
            %% ====================================================================================================================================
            if 1 %% load "noise-free" image and add noise   (OTHERWISE LOAD RAW DATA, SEE BELOW)
                add_noise=1;                % add noise to image
                a=0.1^2;   b=0.04^2;        % noise parameters a,b
                %    a=0.1^2;   b=0.02^2;       % noise parameters a,b
                %    a=0.0^2;   b=0.2^2;        % noise parameters a,b
                %    a=(1/30);  b=0.1^2;        % noise parameters a,b

                clipping_below=1;   %  on/off   [keep off for pure-poissonian (no gaussian terms) noise, since there are no negative errors]
                clipping_above=1;   %  on/off
                prior_density=1;                 %  type of prior density to use for ML    (0)
                %                                %    1: zero_one uniform prior density [0,1];


                %     y=im2double(imread('image_man1024.tiff'));
                %     y=im2double(imread('image_testpat1024.tiff'));
                y=im2double(imread('y_piecewise.tif'));
                %     y=im2double(imread('y_piecewise_fibo.tif'));

            else %%  RAW  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                add_noise=0;  %% DO NOT ADD NOISE TO RAW-DATA (IT HAS ENOUGH NOISE ALREADY! :) )
                clipping_below=1;  %%%% on off   %% RAW-DATA IS ASSUMED TO BE CLIPPED FROM ABOVE AND BELOW
                clipping_above=1;  %%%% on off
                prior_density=0;                 %  type of prior density to use for ML    (0)
                %                                %    0: zero_infty uniform prior density (R+);  (default, use this for raw-data)

Solution

  • Clipping in general is what happens when a value exceeds some threshold and is forced to that threshold. Also known as saturation (when it's accidental), clamping (when deliberate) and others.

    It's common in digital systems, including digital photography, where you use a binary value with a specified number of bits to represent some data. That binary value then has upper and lower limits implied by the number of bits and the way they are used to encode values.

    In this context it looks like the code is generating noise to add to an image. The expression that generates the noise is not quoted but the comments suggest a Poisson distribution, which is a mathematical function which could produce outputs exceeding the dynamic range of the image. The two flags clipping_below and clipping_above are control flags which allow the user to specify whether those values should be clipped, i.e. constrained to the upper and lower limits of the datatype.