*************************************
* Kernel Denoising Instructions *
*************************************
-------------------------------------------------------------------
Contents
-------------------------------------------------------------------
1) Instructions for the file Kernel_Denoising2.c
2) Instructions for the windows executable file
Kernel_Denoising.exe
3) Instructions for the test examples
-------------------------------------------------------------------
1) Instructions for the file Kernel_Denoising2.c
----------------------------------------------------
This file contains all the neccessary computer code needed to reproduce all the results presented in the paper. The algorithm is implemented in ANSI C. The input parameters are located in the variables declaration part of the code labelled with comments. You can change any one of them, compile the file and then run the executable. Although it may seem that a lot of input numbers are needed, this is superficial.
N usually takes the values: [5,5,5,5,5,5], [5,5,5,7,7,7], [7,7,7,7,7,7], [7,7,7,9,9,9], [9,9,9,9,9,9] (while N_0 is the maximum element), depending on the amount of noise presented in the image. On the other hand p usually takes values [0.1, 0.1, 0.1, 0.1, 0.2, 0.4] for images with a medium ammount of details (such as lena, boat, peppers) and [0.2, 0.2, 0.1, 0.1, 0.2, 0.2] for images with a high ammount of details (such as barbara). The other parameters have little effect and can be kept fixed.
The executable program reads two bitmap images (the original and the noisy one).
Firstly, it will ask you for an original image file (used to compute the PSNR after the denoising). Secondly, it will ask for the noisy image file. Once you will enter the names of the files (which should be located in the same directory with the executable program), the function "Kernel_Denoising_semi_parametric" is called and the denoising procedure starts. This may take several minutes.
You can see the psi-functions that the algorithm uses in the function "initialize_psi_vector".
Below you can see how each parameter is used by the algorithm.
Parameter Type Usage
a) L: (integer) The number of possible distinct types of regions depending on whether they contain edges or not.
b) N0 (odd integer) The size of the pixel-centered region for the initial step.
c) \mu_0 (real) The value for \mu and \mu_1 for the initial step of the algorithm.
d) p (vector L elements)
This vector is used to detect the type of region.
If the mean gradient of the region is larger than the 100(1-p_1)% of the mean gradients of all regions,
then the region is of type 1 (strongest edge). If the region is not of type 1 and its mean gradient is larger
than the 100(1-p_2)% of the mean gradients of all regions, then the region is of type 2 e.t.c.
e) N (vector L elements)
This vector contains the values of N (the size of the region) that will be
considered at each pixel according to its type. If the region is of type i then N = N_i.
f) \mu (vector L elements)
This vector contains the values of \mu that will be used to each region according to its type.
If the region is of type i then \mu = \mu_i.
g) \mu_2 (vector L elements)
This vector contains the values of \mu_2 that will be used to each region according to its type.
If the region is of type i then \mu_2 = \mu_{2,i}.
h) c vector (L elements)
This vector contains the information about how the final values of the pixels will be computed.
If the corresponding region is of type i then this information is stored in c_i.
c_i = 1 means that the final value of the centered-pixel will be computed as the mean value of all
the values assigned to it, by all the regions of the neighboring pixels.
c_i = 2 means that the final value of the pixel will be computed as the value assigned to it by its own region.
m (vector L elements)
This vector contains information about the optimization problem to be solved.
If m_i = 0, then we solve problem (9) since this is a smooth region.
If m_i = 1, then we solve problem (15). This is suitable for regions that contain mild edges.
If m_i = 2, then we solve problem (15), but this time we add more steps to the optimization algorithm
to ensure a more accurate estimation. This is suitable for rough edges.
\nu (integer)
The number of iteration steps.
s (vector \nu elements)
The step size from one pixel to the next for each iteration.
\lambda (real)
The regularization parameter of the optimization problem.
\sigma (real)
The parameter of the gaussian kernel
2) Instructions for the windows executable file Kernel_Denoising.exe
-----------------------------------------------------------------------
If you don't want to compile the code you can use the windows executable file instead. However, using this simple program you will not be able to control all the input parameters. Of course you will be able to control the crucial parameters N and p. This program reads two bitmap images (the original and the noisy one) and the parameters p and N (6 numbers each). Although it may seem that a lot of input numbers are needed, this is superficial.
N usually takes the values: [5,5,5,5,5,5], [5,5,5,7,7,7], [7,7,7,7,7,7], [7,7,7,9,9,9], [9,9,9,9,9,9], depending on the amount of nois presented in the image. On the other hand p usually takes values [0.1, 0.1, 0.1, 0.1, 0.2, 0.4] for images with a medium ammount of details (such as lena, boat, peppers) and [0.2, 0.2, 0.1, 0.1, 0.2, 0.2] for images with a high ammount of details (such as barbara).
3) Instructions for the test examples
-------------------------------------------------
In the excel file you can see the results of several experiments conducted with various parameter values on lena, peppers, barbara and boat. The last column shows the name of the corresponding denoised image. You can find the specific file in the rar file "tests.rar". For example, consider the experiment given below:
a) In the "Impulse uniform" tag of the excel file find the experiment located at the 24th line, i.e.
peppers 20% 5, 5, 5, 5, 5, 5 0.01, 0.1, 0.5 , 5, 50, 100 2, 2, 1, 1, 1, 0 0.1, 0.1, 0.1, 0.1, 0.20, 0.4 1,1,1,1,1,1 18,681 dB 32,757 dB 1260 d1
b) The filename is shown to be d1. Go to the "impulse\20% uni impulse\peppers" folder and locate the file "d1.bmp". This is the denoised image.