1pfshdrcalibrate(1) General Commands Manual pfshdrcalibrate(1)
2
3
4
6 pfshdrcalibrate - Create an HDR image or calibrate a response curve
7 from a set of differently exposed images supplied in PFS stream.
8
9
11 pfshdrcalibrate [--response <type>] [--calibration <type>] [--gauss
12 <val>] [--response-file <filename.m>] [--save-response <filename.m>]
13 [--multiplier <val>] [--bpp <val>] [--luminance] [--samples <val>]
14 [--saturation-offset <val>] [--deghosting <val>] [--noise-parameters
15 <val>] [--help] [--verbose]
16
17
19 Create an HDR image or calibrate a response curve from a set of differ‐
20 ently exposed images supplied in PFS stream.
21
22 When used with 8bit images, luminance in the output HDR image corre‐
23 sponds to real world values in [cd/m^2] provided that hdrgen script
24 contained correct information on exposure time, aperture and iso speed.
25 Note that sometimes ISO speed indicated by camera does not correspond
26 to standard (ISO-100 is in fact ISO-125).
27
28 The accuracy of absolute calibration has not been thoroughly tested
29 with different camera models, however one can expect the relative mea‐
30 surement error below 8%. Use pfsabsolute in case of systematic error.
31
32 The merging of multiple exposures is done in a noise-optimal manner, as
33 explained in the paper:
34
35 Hanji, Param, Fangcheng Zhong, and Rafal K. Mantiuk.
36 “Noise-Aware Merging of High Dynamic Range Image Stacks without
37 Camera Calibration.”
38 In Advances in Image Manipulation (ECCV Workshop), 2020.
39 http://arxiv.org/abs/2009.07975.
40
42 --response <type>, -r <type>
43
44 Allows one to choose from predefined response curves. This can
45 be used either to apply this response or use it as an initial‐
46 ization for automatic self-calibration. Predefined response
47 curves are: "linear", "gamma", "log". Default is "linear". This
48 option can be used only with Robertson method.
49
50 --calibration <type>, -c <type>
51
52 Type of automatic self-calibration method used for recovery of
53 the response curve and/or type of method used for HDR merging.
54 Accepted types include: "robertson", "mitsunaga". "robertson" is
55 the default and recommended algorithm (see commends in the Bugs
56 section below). More infomation on the algorithms can be found
57 in:
58 M.A. Robertson, S. Borman and R.L. Stevenson
59 Dynamic range improvement through multiple exposures
60 In: Proc. of International Conference on Image Processing 1999
61 (ICIP 99), pp 159-163 vol.3
62
63 and
64
65 T. Mitsunaga and S. K. Nayar
66 Radiometric Self Calibration
67 In: Proc on IEEE Conf. on Computer Vision and Pattern Recogni‐
68 tion (CVPR'99). Volume 1, p. 1374
69 --gauss <val>, -g <val>
70
71 Sigma value for the Gaussian used as a weighting function (in
72 the range 0-1). Applies to Robertson02 algorithm. Default value:
73 0.2
74
75 --response-file <filename.m>, -f <filename.m>
76
77 Use response curve saved in the matlab format file. Turns off
78 automatic self-calibration. Uses Robertson02 or Mitsunaga99
79 model to apply the response curve (see -c option).
80
81 --save-response <filename.m>, -s <filename.m>
82
83 Saves the response curve calculated during automatic self-cali‐
84 bration stage in a matlab format file. Can be later reused for
85 set of images captured with given camera. Also works fine for
86 plotting with gnuplot.
87
88 --multiplier <val>, -m <val>
89
90 Input multiplier value. Can be used to manipulate the range of
91 source exposures. Default value for Robertson method is 256
92 since LDR images are by default scaled to 0..1. This value is
93 set to 1.0 for Mitsunaga method.
94
95 --bpp <val>, -b <val>
96
97 Number of bits per pixel in input data from the camera. Default
98 value is 8.
99
100 --samples <val>, -p <val>
101
102 Number of samples used during the self-calibration in Mitsunaga
103 algorithm. Default is 50000.
104
105 --saturation-offset <val>, -o <val>
106
107 Pixels are considered saturated if their value exceeds max_val *
108 (1-sat_offset), where max_val is the maximum pixel value (e.g.
109 255 or 65535) and sat_offset is the percentage of the maximum
110 value. The default value is 0.01. Use this if you can see band‐
111 ing or wrong colors in the regions in which one of the exposures
112 is saturated.
113
114 --noise-parameters <val>, -n <val>
115
116 Measured noise parameters for the specific camera used. This can
117 be specified in 2 ways. The first is using a comma separated
118 list of 5 values (3 color coefficients, std_readout and
119 std_adc). Alternatively, some presets have been defined and can
120 be used by specifying the camera name. Cameras currently sup‐
121 ported: SonyA7r1, CanonT1, SonyA7r3
122
123 --deghosting, -d [<val>]
124
125 EXPERIMENTAL. Try to use a simple rejection criterion to reduce
126 ghosting artifacts due to movement. If the option is specified,
127 the pixel values that <val> standard deviations of the noise
128 away from the reference exposure are rejected. When the option
129 is missing from the argument list, the deghosting is disabled.
130 When the option is specified without any value, 2 standard devi‐
131 ations are used.
132
133 --luminance, -Y
134
135 Recovery of response curve will be performed for luminance chan‐
136 nel only.
137
138 --verbose
139
140 Print additional information during program execution.
141 --help
142
143 Print list of command line options.
144
146 pfsinme *.JPG | pfshdrcalibrate -v -s response.m | pfsview
147 Recover the response curve from set of all JPEG files in the
148 current directory and save it to response.m file. To view the
149 response curve, use pfsplotresponse command.
150 pfsinme *.CR2 | pfssize --maxx 1200 | pfshdrcalibrate -r linear -v
151 --bpp 16 | pfsout result.exr
152 Read Camera RAW images (from Canon), resize them so that the im‐
153 age width is equal or less 1200 pixels, merge them into an HDR
154 image using all 16 bits and save as an Open EXR image.
155 pfsinhdrgen sample.hdrgen | pfshdrcalibrate -x -f response.m | pfsview
156 Create an HDR image from exposures defined in sample.hdrgen us‐
157 ing the response curve "response.m" and view it. Fix the problem
158 with black values given to overexposed pixels.
159 pfsinhdrgen sample.hdrgen | pfshdrcalibrate | pfsview
160 Create an HDR image from exposures defined in sample.hdrgen us‐
161 ing the default self-calibration method and view it.
162 pfsinhdrgen sample_dcraw.hdrgen | pfshdrcalibrate -b 16 -r linear -c
163 none | pfsview
164 Given that the script sample_dcraw.hdrgen refers to camera RAW
165 files (see pfsindcraw), this example will generate an HDR image
166 assuming a linear response.
167 pfsinhdrgen sample.hdrgen | pfshdrcalibrate | pfsview
168 Create an HDR image from exposures defined in sample.hdrgen us‐
169 ing the default self-calibration method and view it.
170 pfsinhdrgen sample.hdrgen | pfshdrcalibrate -c mitsunaga -samples
171 100000 -s resp_mitsunaga.m >/dev/null
172 Create an HDR image from exposures defined in sample.hdrgen us‐
173 ing the mitsunaga self-calibration method with 100000 samples
174 and save it to "resp_mitsunaga.m".
176 pfsplotresponse(1) pfsinhdrgen(1) jpeg2hdrgen(1) pfsview(1) pfsind‐
177 craw(1) pfsabsolute(1) pfsglview(1)
179 Currently Mitsunaga and Nayar's method does not produce reliable camera
180 response curves. Robertson's method should be used instead.
181 Pink pixels may appear in saturated areas of outdated version of DCRAW
182 is used. It is recommended to install libraw instead of DCRAW (which is
183 discontinued).
184 Robertson's method may produce banding or wrong colors in saturated ar‐
185 eas. For best results, there should be a sufficient numbers of expo‐
186 sures in which no pixels is over- or under-saturated in all the expo‐
187 sures. It is possible to fix these issues with some heuristics (as most
188 HDR merging software does), but it is currently not done in this re‐
189 lease. pfscalibration was meant to be used for research purposes and
190 getting accurate result is more important than generating good looking
191 images. The heuristics could hide the well visible artifacts, but would
192 also introduce error to the measurements.
193 For any other issues please report bugs and comments on implementation
194 to the discussion group http://groups.google.com/group/pfstools
195
196
197
198
199 pfshdrcalibrate(1)