Flat Fielding for Film Images

In a previous note, I discussed about correcting vignetting pattern. I will still discuss this issue but with a slightly different approach. My goal is to develop a method that everyone can easily apply in PhotoShop.

(a) (b)

Let's look at the images above. (a) is a film image directly acquired from a scanner. (b) is the contrast-stretched image. In the processed image (b), we can see some faint nebulas. However, except for the very bright horsehead nebula, the most prominent brightness feature in the image is the vignetting pattern (bright in the center, faint in the corners). You may not feel so but you will believe after you see the vignetting pattern removed image.

To accurately remove the vignettign pattern, we need to know the exact distribution of the background brightness. Previously, I derive the background brightness distribution from the actual astronomical images (such as the image above). This is not easy because the images are usually full of nebulas and stars. I have to very carefully identify many background regions that do not contain any stars or nebulas. This is a very time consuming process. In order to speed up the process, sometimes I assume a background shape, such as axial symmetry. The results look OK but not too satisfactory. One problem of this technique is that the assumed profile is not necessarily accurate. The other is that my method requires some special software and programing. This prevents the amateur community benefiting from my technique.

This time, I use a method similar to the flat field technique used in CCD image processing. The idea is to use a flat to constrain the shape of the illumination, then use the actual astronomical images to constrain the brightness of the background. With the correct shape and brightness, we can hope for accurately removing the vignetting pattern. I also hope all the processes can be done in just PhotoShop, not any other special software.

(c) (d)

(c) is a flat field obtained from day time sky. It is an average of several exposures at different directions on the sky. This helps to average out the possible gradient on the sky. The RGB channels are merged to further enhance S/N. Color is not really important here, but the overall shape of the illumination is important. For CCD images, we can directly divide (a) by (c). This is called flat fielding. For film images, we cannot do this because film is a highly non-linear device and has the stupid reciprocity failure, unlike CCDs. Because of these, the density variation accross the fields of (c) and (a) could be very different but not just offset by a constant.

To solve this, I matched (c) with the background in (a) and got (d). I don't want to discuss how I did this match. I am still doing this in a difficult way that most people don't want to know. However, I do want to point out that such a match could be done in PhotoShop. PhotoShop CS provides a function called "match color." After removing the brightest objects in (a), we can match the colors of (a) and (c) quite well in PhotoShop CS. The matched result will look just like (d).

Now we can divide (a) by (d). Unfortunately, PhotoShop only provides a subtraction function but not division(*). Below shows the processing results of subtraction and division. The subtraction was done in PhotoShop. The division was done somewhere else. There does exist some difference between these two images but it is really minor. Perhaps I can say, subtraction in PhotoShop is good enough for most people. By comparing these vignetting pattern removed images with image (b), we learn that vignetting is the limiting factor for deep processing. It's not that the nebula doesn't exist. It's the vignetting pattern eats all the faint nebulas.

(a) - (d) (a) / (d)

 

* PhotoShop does provide a multiplication function. However, we cannot easily use it to do division. Why? Because there is not a inversion function that does Y=1/X. The function "invert" in PhotoShop does Y=1-X, but not Y=1/X.