1. A method of calibrating a brightness value measured by a camera with an amount of light received by the camera, the method comprising: creating a series of measurements, wherein for each measurement the amount of light received at an image plane in the camera is controlled to be a known ratio of two opposed irradiance values: a high irradiance value and a low irradiance value, taking a series of exposures with the camera, each exposure being divided in time into a plurality of frames, each frame representing a fraction of exposure time, wherein the amount of light received at a region of an image plane in the camera is constrained to one of the two opposed irradiance values: the high irradiance value and the low irradiance value, for each exposure, determining a ratio of the number of frames in which the region exhibits the high irradiance value to the number of frames in which the region exhibits the low irradiance value, the ratio being set in different exposures to sample a range between the two opposed irradiance values; correlating each ratio with the brightness value measured by the camera; and obtaining a function describing the correlation.