pfshdrcalibrate(1)

πŸ“¦
version 2.2.0 Β· 2 versions
, in fedora 43, fedora 44, opensuse-leap 16.0

πŸ’… pfshdrcalibrate β€” like, the whole manual, bestie

okay so real talk, this is pfshdrcalibrate from the General Commands Manual, section 1. she's an icon, she makes HDR images out of a stack of differently exposed pics, and she'll also straight up calibrate your camera's response curve for you. buckle up πŸŽ€


✨ NAME ✨

pfshdrcalibrate β€” create an HDR image, or calibrate a response curve, from a set of differently exposed images that get handed to her in PFS stream. that's the whole vibe πŸ¦‹

🌸 SYNOPSIS 🌸

pfshdrcalibrate [--response <type>] [--calibration <type>] [--gauss
<val>] [--response-file <filename.m>] [--save-response <filename.m>]
[--multiplier <val>] [--bpp <val>] [--luminance] [--samples <val>]
[--saturation-offset <val>] [--deghosting <val>] [--noise-parameters
<val>] [--help] [--verbose]

πŸ’– DESCRIPTION πŸ’–

okay so literally what she does: create an HDR image, or calibrate a response curve, from a set of differently exposed images supplied in PFS stream. no cap 🫢

when you use her with 8bit images, the luminance in the output HDR image corresponds to real world values in [cd/m^2] β€” but only provided that the hdrgen script contained correct info on exposure time, aperture and iso speed. and ngl, sometimes the ISO speed your camera claims is not the standard one (like, ISO-100 is in fact ISO-125, which is giving lying-on-your-resume energy πŸ’€). πŸ™ˆ

the accuracy of absolute calibration has not been thoroughly tested with different camera models, but you can expect the relative measurement error below 8%. if you've got a systematic error, use pfsabsolute. ✨

the merging of multiple exposures is done in a noise-optimal manner, as explained in this paper (she's iconic, read her):

Hanji, Param, Fangcheng Zhong, and Rafal K. Mantiuk. β€œNoise-Aware Merging of High Dynamic Range Image Stacks without Camera Calibration.” In Advances in Image Manipulation (ECCV Workshop), 2020. http://arxiv.org/abs/2009.07975.

πŸ‘‘ OPTIONS πŸ‘‘

  • --response <type>, -r <type> β€” lets you pick from the predefined response curves. use it either to actually apply that response, or as an initialization for automatic self-calibration. the predefined ones are: "linear", "gamma", "log". default is "linear". heads up tho: this option can be used only with Robertson method. πŸ’…
  • --calibration <type>, -c <type> β€” the type of automatic self-calibration method used to recover the response curve, and/or the type of method used for HDR merging. accepted types include: "robertson", "mitsunaga". "robertson" is the default and the recommended algorithm (peep the comments in the Bugs section below, iykyk). more infomation on the algorithms can be found in:
M.A. Robertson, S. Borman and R.L. Stevenson Dynamic range improvement through multiple exposures In: Proc. of International Conference on Image Processing 1999 (ICIP 99), pp 159-163 vol.3

and

T. Mitsunaga and S. K. Nayar Radiometric Self Calibration In: Proc on IEEE Conf. on Computer Vision and Pattern Recognition (CVPR'99). Volume 1, p. 1374
  • --gauss <val>, -g <val> β€” sigma value for the Gaussian used as a weighting function (in the range 0-1). applies to Robertson02 algorithm. default value: 0.2 ⭐
  • --response-file <filename.m>, -f <filename.m> β€” use a response curve saved in the matlab format file. this turns off automatic self-calibration. uses Robertson02 or Mitsunaga99 model to apply the response curve (see the -c option). πŸŽ€
  • --save-response <filename.m>, -s <filename.m> β€” saves the response curve calculated during the automatic self-calibration stage into a matlab format file. you can reuse it later for a set of images captured with that given camera. also works fine for plotting with gnuplot. obsessed. 🌸
  • --multiplier <val>, -m <val> β€” input multiplier value. can be used to manipulate the range of source exposures. default value for Robertson method is 256, since LDR images are by default scaled to 0..1. this value is set to 1.0 for Mitsunaga method. πŸ”₯
  • --bpp <val>, -b <val> β€” number of bits per pixel in input data from the camera. default value is 8. πŸ¦‹
  • --samples <val>, -p <val> β€” number of samples used during the self-calibration in Mitsunaga algorithm. default is 50000. πŸ’œ
  • --saturation-offset <val>, -o <val> β€” pixels are considered saturated if their value exceeds max_val * (1-sat_offset), where max_val is the maximum pixel value (e.g. 255 or 65535) and sat_offset is the percentage of the maximum value. the default value is 0.01. use this if you can see banding or wrong colors in the regions in which one of the exposures is saturated. πŸ™ˆ
  • --noise-parameters <val>, -n <val> β€” measured noise parameters for the specific camera used. you can specify this in 2 ways. the first is using a comma separated list of 5 values (3 color coefficients, std_readout and std_adc). alternatively, some presets have been defined and can be used by specifying the camera name. cameras currently supported: SonyA7r1, CanonT1, SonyA7r3. ✨
  • --deghosting, -d [<val>] β€” EXPERIMENTAL. tries to use a simple rejection criterion to reduce ghosting artifacts due to movement. if the option is specified, the pixel values that <val> standard deviations of the noise away from the reference exposure are rejected. when the option is missing from the argument list, deghosting is disabled. when the option is specified without any value, 2 standard deviations are used. ⚠️ she's experimental, treat her gently.
  • --luminance, -Y β€” recovery of the response curve will be performed for the luminance channel only. 🌈
  • --verbose β€” print additional information during program execution. she'll tell you everything bestie 🫢
  • --help β€” print the list of command line options. πŸŽ€

πŸ¦‹ EXAMPLES πŸ¦‹

okay these are the moment, fr fr:

pfsinme *.JPG | pfshdrcalibrate -v -s response.m | pfsview

recover the response curve from a set of all the JPEG files in the current directory and save it to the response.m file. to view the response curve, use the pfsplotresponse command. πŸ‘‘

pfsinme *.CR2 | pfssize  --maxx 1200 | pfshdrcalibrate -r linear -v --bpp 16 | pfsout result.exr

read Camera RAW images (from Canon), resize them so the image width is equal or less 1200 pixels, merge them into an HDR image using all 16 bits, and save as an Open EXR image. ate. πŸ’…

pfsinhdrgen sample.hdrgen | pfshdrcalibrate -x -f response.m | pfsview

create an HDR image from the exposures defined in sample.hdrgen using the response curve "response.m" and view it. fixes the problem with black values given to overexposed pixels. 🩹

pfsinhdrgen sample.hdrgen | pfshdrcalibrate | pfsview

create an HDR image from the exposures defined in sample.hdrgen using the default self-calibration method and view it. simple, clean, iconic ✨

pfsinhdrgen sample_dcraw.hdrgen | pfshdrcalibrate -b 16 -r linear -c none | pfsview

given that the script sample_dcraw.hdrgen refers to camera RAW files (see pfsindcraw), this example will generate an HDR image assuming a linear response. πŸŽ€

pfsinhdrgen sample.hdrgen | pfshdrcalibrate | pfsview

create an HDR image from the exposures defined in sample.hdrgen using the default self-calibration method and view it. (yes she's listed twice in the original, she's just that girl πŸ’–)

pfsinhdrgen sample.hdrgen | pfshdrcalibrate -c mitsunaga -samples 100000 -s resp_mitsunaga.m >/dev/null

create an HDR image from the exposures defined in sample.hdrgen using the mitsunaga self-calibration method with 100000 samples and save it to "resp_mitsunaga.m". πŸ“


🌟 SEE ALSO 🌟

pfsplotresponse(1) pfsinhdrgen(1) jpeg2hdrgen(1) pfsview(1) pfsindcraw(1) pfsabsolute(1) pfsglview(1)

go read your siblings' manuals bestie, they're all linked 🫢


πŸ’€ BUGS πŸ’€

  • currently Mitsunaga and Nayar's method does not produce reliable camera response curves. Robertson's method should be used instead. not me warning you twice 😭
  • pink pixels may appear in saturated areas if an outdated version of DCRAW is used. it is recommended to install libraw instead of DCRAW (which is discontinued). πŸ’€
  • Robertson's method may produce banding or wrong colors in saturated areas. for best results there should be a sufficient numbers of exposures in which no pixel is over- or under-saturated in all the exposures. it is possible to fix these issues with some heuristics (as most HDR merging software does), but it is currently not done in this release. pfscalibration was meant to be used for research purposes, and getting an accurate result is more important than generating good looking images. the heuristics could hide the well visible artifacts, but would also introduce error to the measurements. πŸ™ˆ so yeah, accuracy > aesthetics, that's the whole thesis.
  • for any other issues please report bugs and comments on implementation to the discussion group http://groups.google.com/group/pfstools

okay that's the whole page, no details skipped, periodt. πŸ’…βœ¨ she lives in the General Commands Manual as pfshdrcalibrate(1) β€” that's the name, that's the section, that's the whole flex. mwah, go calibrate something πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from