WebHDR Camera Calibration

While hdrgen does quite a good job in trying to make the luminance information as accurate as possible, it is reliant entirely on the EXIF information in the JPEG files. The results, however, depend on many variables which the software can't evaluate. To add to the complication, even cameras of the same make and model exhibit differences in the response curves of their photo-sensitive chips. After all, consumer digital cameras were never meant to measure luminance values accurately.

Response Curve

Once the camera's response curve is known, it may be re-used for successive runs of WebHDR. In general, cameras that allow a great deal of manual adjustment are best suited for this. Here is how:

  1. Although using the Automatic Exposure Bracketing that is available with many cameras seems tempting, use it only when in Aperture Priority mode. If this doesn't work, you might have to be in Manual mode.
  2. Turn off Automatic White Balancing and set the White Balance to the predominant light source in the scene.
  3. Disable all colour and contrast enhancing features.
  4. Use a tripod.
  5. I have found that switching off the Autofocus Mode allows the camera to operate a bit faster, since it doesn't need to spend any time for shifting the lens back and forth trying to focus the scene. This is not necessary, though.
  6. If possible, control the exposure settings through a computer connected to the camera, so it is not touched between exposures. At the very least, use a remote shutter control. Those are available in cable-free infrared versions or cabled to the USB bus or dedicated trigger interfaces.
  7. Choose a scene with large grey or white surfaces. Those will provide nicely continuous gradients for the software to sample. The closer the scene to a neutral grey (non-coloured), the better.
  8. calibration

  9. The scene should have very bright and very dark areas.
  10. Take a sequence of exposure bracketed images separated by 1 EV. This is equivalent to halving or doubling the exposure.
  11. The darkest exposure should have no RGB values above 200, while the lightest exposure should not contain values below 20. When uploading the sequence, do not include images that are outside of this.
  12. Sample histogram

  13. To aid you with the point above, a histogram will be created for each uploaded shot. The grey borders on either side of the black background indicate the bands below 20 and above 200. Black pixels are to the left, white ones on the right. Pixels that are completely black or white (i.e. that have values of 0 or 256) are excluded from the histograms. This makes them easier to read for extreme exposures.
  14. The response curve is a polynomial. It's coefficients are stored in a text file with the extension .rsp that might look like this:
    3 1.57501 -1.01875  0.462603 -0.0188579
    3 1.54919 -1.01298  0.480414 -0.0166318
    3 1.49544 -0.897716 0.414424 -0.0121498
    The three lines are for the Red, Green, and Blue pixel. The first number of each line indicates the order of the polynon, e.g. the Red channel from this example hast the following response curve (x is the pixel value):
    luminance = 1.57501x3 - 1.01875x2 + 0.462603x - 0.0188579

    When plotted, this might look like so:


Absolute Calibration

Minolta luminance meter With a little extra effort and a luminance meter as depicted on the right, it is possible to also carry out an absolute photometric calibration (image of luminance meter courtesy of Minolta):

  1. Produce a HDR image of a scene following the instructions above. Experiment until you get no error messages or warnings back from WebHDR.
  2. With a luminance meter, measure the luminance in your scene at a few points. You might want to place some uniformly lit objects in the scene, such as sheets of paper of various reflectance. The actual reflectance doesn't need to be know. Note down the measured luminances, and save the RSP file for your camera.
  3. Determine the luminance in the HDR image. We suggest you use the RADIANCE ximage viewer, since only relying on the false colour information of WebHDR is not very accurate. Within ximage, click the cursor anywhere, then hit 'L'. Better, even, draw a rectangle over the area of interest before hitting 'L'. This averages the luminance reading over the rectangle. Please refer to the man page of ximage for more details.
  4. You now have two readings: one from the real scene, the other from the HDR image. Ideally, the two should be the same, and if indeed they are (within a few percent), then you are lucky and done. Time to go to the pub and bring in the first round for those who will have to also go through the remaining steps.
  5. Compute the calibration factor, which is simply the ratio of HDR luminance over real luminance:

    CF = LuminanceReal / LuminanceHDR

    This factor will be around 1.0. If it is way off then something went terribly wrong, and you should start over with step 1.
  6. There is a field on the WebHDR upload page that allows you to submit the CF. You should also upload the RSP file which you produced under step 1.
  7. For example, the CF is 1.11 for my Nikon CoolPix 990, and 1.32 for a CoolPix 995, both under overcast daylight.

Proceed to the Roll-your-own-calibrated-HDR page