-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.txt
117 lines (74 loc) · 3.16 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#TITLE
Implementation of Image Denoising based on Backward Stochastic
Differential Equations
#VERSION
2.0
#AUTHOR
Dariusz Borkowski <[email protected]>
#CONTENTS
./BSDE.cpp - This program reads PNG images, runs BSDE
method and writes PNG images. Only 8bit (grayscale
and RGB) PNG images are handled.
./libdenoising.cpp, ./libdenoising.h - Implementation of BSDE
method: Algorithm 1, Algorithm 2, Algorithm 3.
This source code provides an implementation of the BSDE
denoising algorithm.
./lib.cpp, ./lib.h - Implementation of classes dbImageRGB
and dbImage representing RGB and greyscale images and
operations on them.
./io_png.c, ./io_png.h - PNG read/write interface by Nicolas
Limare <[email protected]>.
./lena.png, ./dice.png, ./traffic.png, ./computer.png,
./book.png, book10.png - Test PNG images.
The code is written in C/C++ and should compile on any system
with an g++ compiler.
The libpng header and libraries are required on the system for
compilation and execution.
The implementation uses OPENMP which not supported by old
versions of g++.
Ubuntu 22.04 LTS installation:
sudo apt-get install make
sudo apt-get install g++
sudo apt-get install libpng-dev
# COMPILATION INSTRUCTIONS
Simply use the provided makefile, with the command `make`.
# USAGE
usage: ./BSDE original.png sigma noisy.png denoised.png add_noise c
BSDE takes 6 parameter:
* original.png : initial noise free image (PNG image)
* sigma : the noise standard deviation
(non negative real number)
* noisy.png : noisy image used by the denoising
algorithm (PNG image)
* denoised.png : denoised image (PNG image)
* add_noise : the add noise option (integer number
from the set {0,1})
* c : the enhancing parameter c (non-negative
real number from the range [0, 1])
# EXAMPLES OF USE
Use the provided makefile, with the command `make tests`
Example 1.
We add noise with a standard deviation sigma=20 to lena.png original
image and reconstruct it without the enhancing effect c=0.0. We save
the noisy and reconstructed image as in.png and out.png, respectively.
The program displays the PSNR value of the original and reconstructed
image.
./BSDE lena.png 20 in.png out.png 1 0.0
Example 2.
We reconstruct lena.png noisy image with a sigma=10 and the enhancing
effect c=0.4. We save the noisy and reconstructed image as in.png and
out.png, respectively. In this case, we omit the display of the PSNR
value.
./BSDE lena.png 10 in.png out.png 0 0.4
# COPYRIGHT AND LICENSE INFORMATION
Copyright (c) 2023 Dariusz Borkowski
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.