| PixInsight LE Tutorial Flat-Fielding in Film Astrophotography (2/2) By Carlos Milovic (PTeam) |
|
:: PixInsight Home Page <Previous 0. Open Images and Set Identifiers 2. Divide by the Background Model |
||||||||||||||
|
|
||||||||||||||
|
In the previous section we explained the basis of this method. Now we'll show a step-by-step procedure to implement it in the Pleiades Pixinsight LE (version 1.0.1 or later) image processing application. The same JPEG images used in the preceding section will be employed here, so you can download them to experiment by yourself through the following links: Obviously, better results would be obtained by using the original 12-bit TIFF images at full size, but they are too big as to include them here.
We start by opening both images —original and synthetic background model—, and set their identifiers in PixInsight to recognize them more easily. The identifiers will be: "RAW" for the original image and "FLAT" for the background model. To change the identifier for an image, activate the corresponding image window and selecty les cambiamos sus identificadores para reconocerlas más fácilmente. La imagen original será "RAW" y el pseudo-flat from the main menu. Identifiers will help us to work without the risk of confusion between both images. This is our first processing step, consisting in applying a midtones adjustment function. This can be done in PixInsight with the HistogramsTransform process. Basically, the midtones adjustment procedure implemented in this process is similar to a simple gamma curve. The output histogram seems virtually empty, but don't worry about that. PixInsight works with 32-bit floating point pixel values so no significant information is actually being lost.
The exact value used must be found by some trial-error work for each image. In our example we used a midtones balance value of 0.995. Values close to one protect better from saturation of stars. On Figure 1 we can see the histogram functions for the RAW image, and the parameters applied to both images. This histograms adjustment must be applied to both RAW and FLAT images. After this initial midtones adjustment, both images look nearly black; only most saturated areas are visible. This can be seen on Figure 2.
As we said above, despite both images seem uniformly black, most data are still there. To verify this, the histogram functions can be explored with enough magnification and resolution (Como se dijo más arriba, pese a que la imagen parezca uniformemente negra, la información todavía está ahí. Para comprobarlo basta con mirar el histograma de alguna de ellas con la suficiente precisión y aumento (Figure 3).
To perform this division we'll use the PixelMath process. However, just dividing both images doesn't suffice. The resulting image after division must be normalized to adapt pixel values to the sky background model used. Normalization values can be taken as the median pixel values of the background model for each color channel. To find these values, we activate the background model image, identified as FLAT in our example, and select the main menu option, or right-click on the FLAT image and select the same option from the context menu. This opens the Statistics window. The median values for each color channel must be used as result factors in PixelMath. The procedure is clearly shown on Figure 4.
It mask be pointed out that the Rescale result option of Pixel Math must be disabled for this method to work properly. The PixelMath instance so defined must be applied to the RAW image. It's quite probable that no evident changes be observed after applying it. This is because we are working in a linear tonal space, very different from the original, nonlinear response space. An inverse midtones transform must be applied to restore the original aspect of the image in terms of average brightness.
From now on, the background model is no longer needed, so we can close the FLAT image if we wish. Our last processing step consists in applying an inverse transform with respect to the initial midtones balance transform defined in Step 1. As can be seen by comparing Figures 5 and 1, the output histograms will be quite similar to the histograms of the original image, although they will show somewhat less dispersion of pixel values. This is because we have fixed vignetting or uneven illumination in the image. The midtones balance value to be used here must be such that added to the previous value used in Step 1, the unity must be obtained. In other words, if X is the previously used midtones balance value and Y is the new value, it is given by: Y = 1 – X We recall here that the midtones transformation implemented in HistogramsTransform is not a gamma function strictly, but another quite similar function (rational interpolation).
Figure 6 shows the final result. The obtained image must be further rescaled with additional processing in order to maximize dynamic range usage. We have described a new procedure to apply background sky models to astrophotographs obtained on conventional photographic film. By applying these models, a uniform illumination profile is achieved over the whole image in cases where uneven illumination appears as a result of limitations of the optical systems used, or variations due to light pollution, differential atmospheric extinction, and other diverse and concurrent causes. The method exposed removes the uneven illumination in the image dividing it by a background model after having applied a correction to both images to restore a linear proportion between illumination and exposure time. Compared to applying background models by simple subtraction, the results of our method show illumination profiles that are more uniform, not just for the sky background, but also for the rest of stellar and nonstellar objects present on the whole images. To simplify the task somewhat, we have included the process set module file containing the process icons used in this procedure, which have been organized as two ProcessContainer icons, one for each image: A possible improvement to this method is a previous subtraction of the film base, emulating the bias calibration procedure used for CCD images. However, since flat-field division is made with a highly compressed dynamic range, it is quite probable that this additional correction gives a very marginal improvement. Future improvements must lead to linearizing functions better adapted to the characteristic response curves of the films used for astrophotography. |