-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
186 lines (137 loc) · 6.13 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
Point Spread Function Estimation from a Random Target
======================================================
Version 1.3 - December 26, 2011 (see list of BUGS)
by Mauricio Delbracio <[email protected]>
Pablo Muse
Andres Almansa
Introduction
-----------
Extrinsic image blur can be observed when the camera's focal distance is not
correctly adjusted by the user, when the objects in the scene appear at
different depths, or when the relative motion between the camera and the
scen is faster than the shutter speed (motion blur). Besides these sources
of blur, even in ideal acquisition conditions there is a permanent intrinsic
physical camera blur due to light diffraction, sensor resolution, lens
aberration, and anti-aliasing filters. Our goal here is to accurately
estimate the Point Spread Function - PSF, that models the intrinsic camera
blur. This function can be locally interpreted as the response of the camera
to a point light source.
In [1] we presented a theoretical study proving that the sub-pixel PSF
estimation problem is well-posed even with a single image capture, as long as
the captured scene is well chosen. Indeed, theoretical bounds show that a
near-optimal accuracy can be achieved by taking a single snapshot of a
calibration pattern mimicking a Bernoulli(0.5) white noise. We first use an
algorithm to accurately estimate the pattern position and its illumination
conditions. This allows for accurate geometric registration and radiometric
correction; Once these procedures have been applied, the local PSF can be
directly computed by inverting a linear system that is well-posed and
consequently its inversion does not require any regularization or prior model.
Files
-----
COPYING
Makefile
README.txt
VERSION
lsd.c
lsd.h
thin_plates.c
thin_plates.h
image.c
image.h
io_pgm.c
io_phm.h
detect_pattern.c
detect_pattern.h
psf_estim.c
psf_estim.h
psf_estim_main.c
nnls.c
nnls.h
pattern_noise.pgm
img_example.pgm
doxygen.config
Requirements
------------
- The fftw3 header and libraries are required on the system for
compilation and execution. See http://www.fftw.org/
- The cblas header and libraries are required on the system for
compilation and execution.
- The lapack library is required on the system for
compilation and execution.
Compilation
-----------
Simply use the provided Makefile, with the command `make`. You need to set
the directory where the libraries: ffw3, cblas and lapack have the respective
header and libraries files.
Running
-------
Usage: ./psf_estim [options] <input file> <output file>
Only PGM 16/8 bits images are supported.
Options:
-s <number> The super-resolution factor, positive integer (default 4)
-k <number> PSF support size (default 4s+1)
-o <file> Estimated PSF saved to a 8bits PGM image
-p <file> Noise Pattern PGM image
-d <file> Save the input image with detected pattern marked (24bits PPM)
-t <0,1,2> Least Squares solver:
0 - Least Squares
1 - Least Squares + thresholding (default)
2 - Non-negative least Squares (slowest)
Parameter Explanation
-s 'number' : The superresolution factor, i.e. how many additional samples per
observed pixel will be computed. (default 4)
-k 'number' : The support size in the superresolved grid. For very sharp
images 4s+1 should be enough. (default 4s + 1)
-o 'filename' : Save the estimated PSF as an 8-bit image file. Values are
rescaled to max_value be 255. Just for visualization purposes.
-p 'filename' : Input Noise Pattern PGM Image. (default pattern_noise.pgm)
-d 'filename' : Save the input image into a PGM image file 'filename' with
marks
where the PSF pattern has been detected.
-t <0,1,2> : Choose the numerical algorithm for solving Least Squares.
0 - Least Squares
1 - Least Squares + thresholding (default)
2 - Non-negative least Squares (slowest)
<input file> : Input 8/16 bits PGM Image
<output file> : Output PSF written into a TXT file as a k x k matrix of floats
Example
./psf_estim img_example.pgm psf.txt
Documentation
-------------
The following is an implementation of the Point Spread Function Estimation
Algorithm presented in:
[1] M. Delbracio, P. Muse, A. Almansa and J.M. Morel.
The non-parametric sub-pixel local point spread function estimation is a well
posed problem. Submitted to the International Journal of Computer
Vision (IJCV), November 2010.
and in more detail described on the portal IPOL www.ipol.im where there
is much more information, including this code and an online demo version:
http://www.ipol.im/pub/algo/admm_non_blind_psf_estimation/
Please report bugs in psf_estim to <[email protected]>.
BUGS / HISTORY
--------------
Changes in Version 1.3
--> indentation fixed. TABs replaced by four spaces
Changes in Version 1.2
--> indentation fixed to four spaces
--> style code was changed according to reviewers from the IPOL journal
Changes in Version 1.1
--> bicubic parameter 'a' was wrongly set to 0.5 instead of -0.5.
--> thin-plate regularization parameter is from [0,Inf) instead of [0,1]
--> thin-plate regularization parameter is set to 10 (instead of 0.1)
--> order of parameters nx and ny in 'fftwf_plan_r2r_2d' where in reverse
order. First should be ny then nx (as we work in Raw major)
Copyright and License
---------------------
"Point Spread Function Estimation from a Random Target"
Copyright 2010-2011 mauricio delbracio ([email protected])
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/>.