Guide To Basic Astrophotography 8

in #steemstem6 years ago (edited)

Image Processing



In this series ("Basic Astrophotography") I've spoken more about the mechanics of obtaining photographs of the night sky. However, the image processing steps that follow are essential in obtaining a good or even scientifically valuable image. Here I will begin discussing image processing. Some of these tips may also be useful for ordinary daytime photography.

Introduction - Workflow

A typical workflow for processing astronomical images goes like this:

diagrams.png

Those steps, run in the order shown, can be summarised as follows:

  • Calibration - removal of imaging defects caused by camera and optics.
  • Debayering - the process of turning a raw image from color camera into color.
  • Registration - alignment of images
  • Stacking - combining multiple images together to improve Signal to Noise ratio (i.e image quality)
  • Sharpening and Filtering - Enhancement of image
  • Visualisation - Presenting the image in a form useful or pleasing for the viewer

In this post I will look at Calibration, Debayering and Registration.

A quick word about Image formats

Before we start most people will have worked in jpeg as this is the most common output from digital cameras. Although the steps described in this article will work to some degree, it usually best to record in a raw format. Raw format is generally more usable by astronomical processing packages.

When working with astronomical images the most common format is FITS. Raw formats from cameras can be readily imported as FITS into many astronomical packages.

Calibration

A raw image will not only contain the object of interest but also unwanted defects such as noise, vignetting and dust shadows. Many of these defects can actually be removed using the calibration processes I am about to describe.

Not everyone performs calibration, and in some cases, it may not be necessary. However, if the images are to be used for scientific purposes it is highly recommended to perform calibration. This is particularly important in the field of photometry.

Bias and Dark Frame Subtraction

Even in complete darkness, the individual pixels in a sensor will register a small signal due to the accumulation of Dark current. As each pixel registers slightly different levels of dark current (due to manufacturing tolerances) an unwanted pattern will emerge in the image as exposure increases. This variation in dark current will manifest as hot pixels as the exposure time increases.

Astronomical cameras often incorporate a cooling system design to reduce the sensor temperature to -20 Celcius or lower. The advantage of cooling the sensor is to reduce dark current since it is a function of temperature. However, even at low temperatures, each pixel will register slightly different values for zero illumination. These values for zero illumination are called bias levels.

To obtain a dark calibration frame it is a simple matter of taking an image with the same settings but with the optical system capped off. Here is a practical example of the improvement from dark frame subtraction.

horsehead-dark-comparision.jpg
*The LEFT hand image is an image that hasn't been dark frame calibrated, note the presence of "hotpixels" which have been circled. After dark frame calibration the RIGHT hand image is the result. Note the hotpixels are gone.

Flat Fielding

Most optical systems exhibit vignetting which is the darkening effect away from the center of an image. Vignetting can be corrected using a flat field image, which is an image taken of a blank uniform screen. The following image shows the effect of flat fielding. Note how it corrects the strong vignetting and dust mote shadows.

horsehead-flat-comparision2.jpg
The LEFT hand image is an image that hasn't been flat field calibrated, note the image is highly vignetted and the shadows of 2 dust motes can be seen. The right hand image has been flat field calibrated and as a result the previous defects have been removed. Image Credit: Author

Cosmetic correction

Image sensors typically have at least several million pixels/image wells and even with best manufacturing processes, there will be some that are faulty. Many software packages have a function built in that allow these to be removed, typically replaced with an interpolated value from adjacent pixels.

Debayering

bayerfilter.png
Most color sensors use a bayer filter, which is an overlay of color filters, to record color information. Because each pixel is only sensitive to either Red, Green or Blue, interpolation from neighboring pixels must be used to fill the missing color values

Debayering is the actual process of converting a greyscale raw image from a color camera into a color image. As odd as it may seem, most color cameras have monochrome sensors overlayed with a Bayer filter. The Bayer filter is a layer of alternating red, green and blue filters that sit over the sensors pixel array.

In order to sample color, the filters are arranged over the sensor's pixels in a repeating pattern of red, green and blue (as shown in the diagram above). This means there are gaps in color sensitivity, for instance at a blue pixel there will be no green or red data. To fill in the gaps interpolation must be done to estimate color data from neighboring pixels. This process is called debayering. Without this interpolation the image quality would be quite bad.

Luckily, astronomical image processing packages do the debayering for you. However it is important that this is done prior to the registration step that will discussed next. Failure to do this will erase the color data.

Registration

Registration is the process of aligning images. Quite, often errors in the telescope drive will cause objects to drift around over time. So if the images are combined or stacked without registration they will blur out detail. The following animated gif's of Jupiter demonstrate registration.

.

jupiter-noreg.gif



Jupiter-reg.gif

Without Registration : The video footage on the right is exactly how Jupiter is recorded through a telescope. As can be seen the planet moves around considerably which is because of slight movements of the telescope and small errors in the tracking mount. At this resolution even stamping on the nearby ground will cause visible movement.


With Registration : After registration the images are aligned so that object of interest remains stationary as can be observed here. There are many different software options for registration, the one performed here is similiar to the Centroiding method described below.


There are a number of different type of image registration, I will descibe some common ones here:

Registration Methods

registration-all.png
Some Common registration methods, described in more detail below

Centroiding : A registration technique that computes the xy centroid of an image, usually above a certain threshold brightness. This is repeated for each image in a set, and the images are shifted so that the xy centroid value is the same. This is very effective for centering bright planets.

Brightest star : Almost identical to Centroiding, except the brightest star is selected in the image and a measuring circle is placed around the star to compute the centroid. Selection of the star can be done either automatically or manually.

Multi-star : This is a further development of the previous 2 methods in that a star detection method needs to be used to first identify stars within an image.

Once stars are found in the image, the centroids are calculated using a radius around those stars. A pattern matching algorithm is then used to match the stars across a set of multiple images.

Unlike the other methods there a more options than simply computing an offset shift for each image. It is possible to also compute rotation and distortion transformations for each image relative to the reference image.

This method gives the best results for star fields, but is slow because of computational work required.

Multi-Anchor : A number of applications including Autostakkert and Registax implement more complex registration methods that allow the distortions caused by atmospheric turbulence (called "seeing") to be partly compensated for.

These methods use anchor or alignment points to lock on to small detail within the planetary surface and create distortion maps that can be used to better align detail and result in sharper detail in the final image.

Multi-Anchor Example : The best way to see how this method works, look at this comparision of images of the moon. There were 40 individual image frames of the moon used for this example.

Example 1 has been setup to use only one alignment point, the crater in the centre. The alignment point appears as the blue square.

AUTOstakkert-moon-1p.jpg

Example 2 has been setup with 38 alignment points distributed around the image frame.

AUTOstakkert-moon-38p.jpg

After the registration was completed and the images were combined and presented in the followed animated gif. Note the detail is significantly sharper in the 38 point image (it might take a few moments to see this clearly, look around the top of the prominent cliff in the upper right)

moon-comparision.gif

Conclusion

Here we discussed calibration, registration and debayering of images. I hope people found this interesting and informative. In the next part, I will talk more about stacking and filters. Also a quick note to @lordneroo, I haven't forgotten about mapping projection of planets, that is coming soon!

NOTE: All images are the Authors, please credit @terrylovejoy if you plan to use them.

steemstem.png

mentor-anim.gif

Sort:  

Another wonderful blog, @terrylovejoy, thank you so much for your efforts!

I appreciate the fact that you gave away the primary steps to basic image processing and provided information regarding calibration.

I take those words of yours in the last paragraph as a promise and look forward to reading about the mapping projections you came up with to depict stars and solar systems!

Please keep up the great work as I know you will!

Thank you @lordneroo ! Yes there is some cool stuff you can do with a program called Winjupos that allows you to reproject images of planets into different projections. I am trying to fit it in somewhere in this series, but, it may be worth doing a separate article.

I will wait for stacking part. This is awesome content @terrylovejoy. I am very much interested in knowing how the SNR is going to get increased with the stacking process. :)

Hi @dexterdev, I currently adding a little bit more depth as to how SNR is improved with stacking in the article. Stay tuned!

I like that Jupiter on steroids though 😊

That was on a still night, you should see the ones I have during windy conditions!

Back in the day wehen I dabbled in this I had a Peltier module that I used to cool down the CCD chip and decrease the noise.

I found that without it the images were just too noisy to be any good at all.

This is still the case, astronomical cameras typically still have peltier modules too cool the sensors, although it is less critical these days. I generally run my camera sensors around the -15 C mark to get nice clean images.

Man this is awesome. Amazing content :). Working with those bias and dark frame, flat fields, it's so much harder and takes so much time than to do a normal photo editing. It amazing to see your passion for it. Just awesome.

Thank you @rifkan!

There is often a bit of preparation getting good quality calibration frames, but it is usually worth it. Once you have done it a couple of times it becomes easy :)

I had a 3 night practical in the observatory, in the evening we used to collect the data, then to work with those data until 6, drink two-three beers eat and go to sleep, wake up and repeat the same thing. It was a bit tiring but wonderful experience, 9-10 serious people working and having fun together :) challenging but the final product is amazing

Very informative and useful post...
This must be very important for amateur photographers like me... ❤

Thanks for sharing, dear @terrylovejoy ....
Waiting for your next posts... 🤗😍

Superb Post!

There are several solid photographers in my lexical community and I'll use this post as the example to show them how to write a good post.

Thank you @alexs1320 I really appreciate that!

Wooow your post is really amazing.

This content is very interesting for any photographer

your post was wonderful,i like astronomy. it is always like a secret for me.pleas see my page u'll be like it.

Congratulations @terrylovejoy! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of posts published

Click on any badge to view your own Board of Honor on SteemitBoard.

To support your work, I also upvoted your post!
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Upvote this notification to help all Steemit users. Learn why here!

Coin Marketplace

STEEM 0.20
TRX 0.15
JST 0.030
BTC 65353.52
ETH 2654.64
USDT 1.00
SBD 2.84