Our cameras automatically take a
dark frame after an exposure, with matching shutter speed, and subtract it from the raw data before processing it, when exposure is longer than about one second.
This is a crucial operation to calibrate any CCD sensor.
However, it may sometimes be impractical or undesired to "waste" a long time doing exposures on nothing, especially when taking multiple exposure with the intent of later blending them together.
Additionally, keeping the CCD sensor on for a longer time results in higher temperature increases, with paradoxically increases the image noise (I say "paradoxically" because you're doing this to
reduce noise).
Taking one dark frame at the beginning or end of the photographing session is also often not an acceptable solution, both because the dark frame taken must match the total exposure time (or you risk exacerbating noise, by adding in a source with more randomness than the blend of your images) and the temperature (which definitely won't be the same before, during and after a session).
I'll present a method that should result in a decent compromise among the needs.
The data (the noise) contained in a dark frame results mainly from two sources: the CCD and the amplifier.
CCD noise increases with exposure time and temperature.
Amplifier noise is independent of exposure time, and only marginally or not dependent on temperature (
article in Italian).
We can isolate CCD noise from amplifier noise by taking a
bias frame. To achieve this, one can take a dark frame at an extremely fast shutter speed (the shortest exposure time allowed by the camera).
This will ideally only contain amplifier noise.
Now subtract the bias frame from the dark frame, and you have a representation of CCD noise (thermal noise).
Calculate the average value of all the pixels in the frame, and write it down. If you now take another dark frame,
at the same temperature (let the camera cool down), with twice the exposure time, you should find that the average value has doubled. If you take one with half the exposure time, it should halve.
The relationship between temperature and CCD noise is less obvious, but
should generally be linear.
So, take a dark frame at a significantly different temperature from the previous (but the same exposure time), and again calculate the average.
If the temperature change was N degrees, then the ratio of the second average to the first approximates the factor you have to multiply each pixel in a thermal frame for to obtain the equivalent frame when the temperature increases by N degrees.
It is possible on most cameras to obtain a temperature reading for the CCD sensor.Eventually, you will have to add the bias frame back to the rescaled thermal frame to reproduce an
artificial dark frame for any given exposure time and temperature.
You can then subtract this from your images, although to avoid introducing random noise, enough dark frames and bias frames must still have been taken to match or exceed the total exposure time.
The advantage of this process, however, is that the dark and bias frames may have been taken an arbitrarily long time before (or after) the actual exposures.
Note, however, that
a bias frame is only valid for a given ISO setting, as it represents amplifier noise. It should be easy, however, to determine a linear relationship between ISO settings and bias frame values, if taking a bias frame for each different ISO setting is not desirable.
To summarize briefly; when preparing for calibration:
- take
N dark frames (shutter closed or lens capped, medium exposure time) at temperature
T1- take N bias frames (shutter closed or lens capped, minimum exposure time
S)
- average all dark frames together
- average all bias frames together
- subtract the resulting bias from the resulting dark
- take some (ideally N) dark frames at temperature
T2, average them
- take the average pixel value of the dark at T1 (call it
v1) and the dark at T2 (call it
v2)
- write down the value of
f=(v2/v1)*(T1/T2); this is the factor for a positive 1-degree temperature change
When processing an image (composed of at most N averaged exposures):
- call the shutter speed of each exposure
Si- write down the average CCD temperature at which the exposures were taken, call it
Ti- Multiply the dark frame taken at T1 for f*(Ti-T1)*(Si-S), clip overflowing values
- Add the bias frame to the resulting frame
- Subtract the resulting frame from your image