PixInsight LE Tutorial
Flat-Fielding in Film Astrophotography (1/2)

By Carlos Milovic (PTeam)

:: PixInsight Home Page  >Next

Introduction

Flat-Fielding by Linearized Division



Introduction

Flat-fielding techniques are very common in digital imaging. Flat-field calibration images are used to correct the effects of uneven illumination due to limitations of optical systems and spurious items such as dust over CCD sensors. These calibration images are obtained by short exposures taken on uniformly illuminated surfaces, with the same exact instrumental configuration and fields of view used to shot the actual data images. Since CCD response is linear, the fact that calibration and data images are taken with different exposure times doesn't matter, because calibration values can be easily rescaled to match data ranges. What is important to calibration images is the achievement of high signal-to-noise ratios.

When trying to develop a similar procedure for conventional film images, the situation becomes much more complicated. Uneven illumination correction techniques, such as antivignetting masks, are very well known today. These techniques are based on correction images reproducing the illumination profile of the original images. Such illumination profiles are generated from sampled values on sky background areas over the image, and strictly speaking they are just synthetic background models, or pseudo flat-field images.

[mouseover: original image vs. synthetic background model]


An example of synthetic sky background model, or pseudo flat-field, generated for a deep-sky astrophoto by interpolating a two-dimensional function from a set of background sky samples. This model was generated with the DynamicBackgroundExtraction process in PixInsight Standard.

To see the original image, move the mouse cursor over the [mouseover] link corresponding to this figure.

However, usually these synthetic background models are not applied to film images in the same way they are used with digital originals. There are two main reasons for that. On one hand, software applications commonly used for film astrophotography usually cannot divide images. More importantly, film response is not linear, so in general we have no guarantee that dividing by a flat-field image will give correct results.

Synthetic background models are frequently subtracted from digitized film images. This operation is equivalent to subtracting the sky from the image. This way a sort of uniform base level is established, to which pixel data for all objects in the image (nebulae, stars, etc.) refer.

[mouseover: original image vs. the image after subtraction of a synthetic background model]


Correction of uneven illumination. A synthetic background model has been subtracted from the original image of the preceding figure, and the resulting pixel values have been rescaled.

To see the original image, move the mouse cursor over the [mouseover] link corresponding to this figure.

When this method (subtraction of background) is well implemented and applied, all existing gradients or uneven illumination distributions are completely fixed. However, the images of stellar and nonstellar objects present in the image are not properly corrected.

In digital astrophotography, dividing by a flat-field image gives excellent results because linear light sensors are used: the amount of data gathered by a given portion of the surface of a CCD sensor is a linear function of the exposure time, so a flat-field image can reproduce accurately the profile of uneven illumination over the entire surface of the CCD sensor, for the whole set of acquired data. Usually flat-field images are normalized in order to introduce a signal amplification effect on border areas of the image (less exposed areas) and an atenuation effect on central areas (more exposed areas), keeping unaltered global average pixel values.

In film astrophotography, however, dividing by a flat-field image usually yields quite incorrect results. This is due to the fact that, although the amount of light reaching a film frame is proportional to exposure time, film response is not linear.


The result of dividing the original image by a synthetic background model. The same images shown on previous figures were used here.

The image obtained after dividing by a pseudo flat-field image is clearly incorrect due to nonlinear film response.

When applying any kind of flat-field image to a film image this nonlinear behavior should be taken into account, knowing as accurately as possible the particular response functions for the film used. In practice this is very difficult to achieve, because actual film response depends on development conditions, temperature, humidity and many other factors, including the analog-to-digital conversion performed to digitize the originals. Even our own measurements may be inconsistent for the entire set of images obtained from a single film roll.


Flat-Fielding by Linearized Division

Despite all those drawbacks and difficulties, we can make some first approximations to the solution of the film flat-fielding problem, trying to improve the results obtained by subtraction of background models. Of course our results may not be correct for photometric purposes —but definitely subtracting a background model isn't a photometrically correct procedure, either.

We can devise two general methods to approximate a solution to film flat-fielding:

  • Nonlinear division procedures.
  • Linearizing film response prior dividing by a flat-field image.

Since the first method can be quite complex to be implemented by most of us, and there is no easy, user-friendly system to apply it, we'll only consider the second way.

First we must face the problem of how to linearize a particular film's response without knowing that film's characteristic response curve. Let's figure out how a typical CCD image can be transformed to look like a typical digitized film image. Almost all of the existing data in a CCD image is hold by quite low pixel values on a small segment of the available dynamic range. Typically, very aggressive gamma functions are applied to raw CCD images to bring out them with reasonable levels.

A good approximation can be using such a gamma function to characterize nonlinear film response. The procedure can be outlined as follows:

  1. Linearize film response by applying an initial gamma function to both the original image and the background model.
  2. Divide the (linearized) original image by the (linearized) background model.
  3. Recover the original aspect of the image by delinearization with a gamma function symmetric to the initial function applied in step 1.


Original image divided by the background model image, after linearizing film's response by applying a gamma function to both images.

As a final example, we'll show a comparison between the results of the linearized division method and a simple subtraction, using in both cases the same synthetic background model generated from the original image. Both resulting images were rescaled by adjusting their black and white histogram points. Finally, both resulting images were equally enhanced by applying the same exponential function.

Although these images aren't fully worked final results, but just quick examples, they can be used to evaluate and compare both techniques.

[mouseover: synthetic background model applied by subtraction vs. linearized division]


Passing the mouse cursor over the [mouseover] link, you can see the result after subtracting the background model.

Both methods achieve a uniform sky background. However, the linearized division technique explained in the text fixes the uneven illumination of objects and reveals many nebular structures near the edges of the image, that remain hidden after subtraction. The results of linearized division are clearly superior, in our opinion.

Most software applications typically used for processing astrophotographical images don't include the division operation between images. However, this is not the case with PixInsight. In the next section of this tutorial we'll explain how the linearized division procedure can be easily implemented in PixInsight LE version 1.0.1 and later.



:: PixInsight Home Page  >Next