Venus cloud tracking -- July 31, 2006


<- Previous page

3. Aligning images

Although a circle was automatically fitted to the bright limb of each image, these coordinates proved insufficient to accurately align 2 or more images for stacking. Although the circle calculation program was accurate to subpixel values, 3 issues concerning the quality and the geometry of the images themselves made the resulting coordinates off by just one or a few pixels in many cases, requiring final alignment to be performed by hand:

1. Because of detector saturation and readout noise, the edge of the bright limb could not be determined unambiguously.

2. The center of the bright limb circle was not coincident with the center of the dark limb circle. This may be due partly to detector error, but it may also be an intrinsic property of light scattering from the planet (e.g. the bright limb was observed by reflected light, while the dark limb was observed by transmitted light, from cloud layers at different altitudes).

3. Anisotropic distortion of the image by Earth's atmosphere caused the planet outline to be significantly non-circular, in ways that varied from image to image. This issue will be discussed further below.

Using FITSRegister

The program FITSRegister was used to manually align images for stacking. FITSRegister is a Macintosh GUI program that offers at least 3 advantages for this task:

1. It allows images to be loaded and viewed at any zoom factor, and scrolled to any subset. Display parameters can be individually set for each image.

2. Images can be shifted in realtime by sub-pixel values in both X and Y, and can be registered with respect to a circle of any center and radius.

3. Two images can be automatically animated (swapped) in order to quickly and clearly see registration errors between them. Once registered, they can be written to disk in shifted form.


(Click for full-size)

Intra-sequence and inter-sequence procedure

The procedure for aligning 70 512x512 pixel images into 7 sets was the following:

1. Align the first image (i.e. 1230, also the sharpest) to be centered in the frame at (255, 255). This was done by loading image 1230 into the file 2 position, and then shifting it by typing into the text fields or pressing the buttons until it was centered in a circle located at (255, 255). Used a zoom factor of 2, and a file 2 shift increment of 0.5. Image features used to perform the alignment were the top and bottom cusp of the bright crescent, and the edge of the dark limb.

This, and subsequent alignments, was very much a trial and error subjective process. Attempts to automatically align the dark limb have so far failed, again by just one or two pixels, because they cannot unambiguously distinguish the gray, fuzzy, noisy limb from the gray, fuzzy, noisy background. Neither the limb nor the background maintain a constant brightness along the circumference.

Once this image has been aligned, it was saved to disk. This first step is not critical, but it does provide the reference to which all subsequent images will be aligned.

2. Load the aligned first image into the file 1 position, and load the second image of the same time interval into the file 2 position. It should be noted here that images to be aligned are done so with their Y axis flipped, while already aligned images are viewed unflipped.

Using the automatic coordinates in columns 4 and 5 of the image_data.txt file, perform a rough shift of the second image. Then, using the buttons set to 0.5 pixel increment values, iteratively move the second image until it aligns with the first. You can press the 'Swap' button to see the difference between images, or check the 'Auto swap' box to continuously animate between images as you continue to align.

As with the first image, features used to register the two images include the top and bottom cusps of the bright crescent, and the edge of the dark limb. However, since these two images were acquired at about the same observing time, there should be no perceptible cloud motion between them. Therefore, you can also use any variation in the cloud motion (left-right or up-down), to adjust the registration. Make sure that you are looking at the cloud features themselves, rather than the background noise of the image (e.g. bad pixels, non-flat-field variations in brightness), all of which will also appear to move. When the images are properly aligned, the clouds will not move, although the background noise may continue to do so.

It may not be possible to align the images based on all the aformentioned criteria, due to issues which will be discussed below. Proper alignment of one part of the image may not entail proper alignment of another part of the image. Nevertheless, it should be possible to adequately align overall images to within 0.5 pixel or less. If you use a smaller shift increment, it is suggested that you keep to powers of 2 (e.g. 0.5, 0.25, 0.125, etc..).

When this image is aligned, it is saved to disk.

3. Repeat step 2 for all other images in the current time interval. That is, subsequently align all other images to the first image of the interval, not to the previous image of the interval.

4. Repeat step 2 for the first image of the next time interval. That is, align the first image of the next interval to the aligned first image of the previous interval.

5. Load the aligned first image of the new time interval into the file 1 position and then repeat step 2 for each additional image of the new time interval.

6. Repeat steps 4 and 5 for the first and remaining images of each additional time interval.

Editing image data file entries

As each file 2 image is shifted, its offsets are displayed in the DX and DY text fields. Once the image is properly aligned, these values should be entered into the image_data.txt file for the image number loaded. They are used to replace the 999 values in columns 6 and 7. Although these values can be entered by hand, a utility program was created to facilitate editing this file. Subsequent versions of FITSRegister may perform this entry automatically.

Alignment issues

As was mentioned previously, and is quickly apparent when aligning images by hand, there are several issues which confound the alignment process. For example, it has proven to be extremely difficult to create automated software which can accurately align images without human intervention. Several different algorithms have been tried, and each is reasonably accurate to a limit of about a pixel or so. However, all automated techinques so far have required manual tweaking of final alignment in order to stack images.

Although noise in the images certainly contributes to the poor performance of an automated approach, there are two additional factors, intrinsic to the images themselves, which appear to be at work:

1. The overall quality of images changes from file to file, even over a time period of only a few seconds. The trend in image quality as time progresses is generally downward, but it is not monotonic, and there can be a great variation in the computed and perceived sharpness of images within the same time interval. This variation in sharpness makes it difficult for both human and machine to find and recognize features between images, as their location and geometry can change by a pixel or more. This variation is presumed to be due to changes in the Earth's atmosphere and in the optical system. These changes appear to have timescales ranging from only a few seconds to those lasting the duration of the observing night or morning. It may not be possible to alleviate these non-systematic effects, although an attempt at some kind of semi-blind deconvolution to reverse the effects of unknown but obviously active distortion PSFs may be worthy.

2. The magnification of images changes from file to file, in a non-isotropic fashion with independent X and Y values. This has the effect of distorting the planet disk from a circle of the correct eccentricity, with the consequence that all parts of the image cannot be aligned at the same time. Often a choice must be made whether to align on the top or the bottom cusp --but not both--, or on the limb or the clouds --but not both--, or on the edge or the center of the planet --but not both. It might be possible to restore the symmetry of the disk by performing separate X and Y magnification transformations, using the Fourier transform. Procedurally, this might entail first aligning some part of the cusp, limb, or clouds, and fixing that point between images. Then, by minutely adjusting both the X and Y magnifications while maintaining the aligned point, independently bring other points of the planet first into X alignment, and then into Y alignment. Future versions of FITSRegister may add this feature, so that the alignment process would involve adjusting 4 parameters for DX, DY, MX, and MY between pairs of images.


4. Making a flat and mask

Failure of the flat

Several people have attempted to make a sky-based flat field image for 7/13/04, with either no or limited success. Ideally a flat would be made from several featureless images taken with different exposure times, so that a gain slope and intercept could be calculated for each pixel. There are obviously many bad pixels in each planet image, and considerable variations in pixel gain across the image which appear as a characteristic pattern. Although it has not proven possible to remove these effects with a flat, it is possible to extract a bad-pixel mask from a set of similar sky images.

Making the flat and mask

In the latest attempt, 20 sky images (1021-1040) were combined into a single average image. Since these images were created with a different number of coadds --but not different exposure times--, they represent averaged samples of the detector response which must be multiplied by a constant factor to give them the same weight. These images were created with 4, 40, and 80 coadds each, so they are premultiplied respectively by 20, 2, and 1 before averaging.

The steps used to make the flat and mask were:

1. Read in FITS files and clip all negative values to 0.

2. Multiply each image by weighting factor and add together.

3. Compute average value of all non-zero pixels.

4. Compute standard deviation of all non-zero pixels.

5. Set all pixels outside of Z = 0.75 standard deviations of the mean to 0. This limit can be varied as desired, with the effect that more or fewer pixels are rejected. A value of 0.75 was chosen by visual inspection of the resulting mask and its effect on subsequent image processing.

6. Compute new average value of all non-zero pixels.

7. Divide all non-zero pixel values by new average, so that average of image is now = 1.

8. Save logical binary values of flat {0, >0} as mask.

Although the resulting flat looks reasonable, it does not perform well, as will be demonstrated below.


(Click for full-size)

In the process above, the word 'average' can be replaced with 'median' with little effect on the resulting images.


5. Processing the bracket-gamma composite

A composite aligned image was made during a previous analysis from about 100 images of the planet taken through a bracket-gamma filter. This composite shows only the reflected light, and is expected to help remove the brightness gradient in the dark side of the planet.

I felt that this composite image needed a bit of tweaking, specifically:

1. It was not properly aligned to a center at (255, 255).

2. It contained some spatially correlated noise which I thought might detract from the overall quality of the processed images.

I therefore aligned the image manualy:


(Click for full-size)

and blurred it slightly with a Gaussian filter of sigma = 2.5 to remove some of the noise:


(Click for full-size)


(Click for full-size)


Next page ->

İSky Coyote 2006