Stargazers Lounge Uses Cookies

Like most websites, SGL uses cookies in order to deliver a secure, personalised service, to provide social media functions and to analyse our traffic. Continued use of SGL indicates your acceptance of our cookie policy.

Welcome to Stargazers Lounge

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customise your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • Announcements

    sgl_imaging_challenge_banner_30_second_exp.jpg

Hellstorm

Algorithm to stack astronomical images

4 posts in this topic

I'm looking for a simple algorithm to compare astronomical images (of the same sky region) against each other, compute their movement and rotation, to finally stack them.

At the moment I'm already having a more or less working algorithm. First I extract all the stars out of an image (including information like brightness and FWHM), and then I walk trough all the resulting "points" and create triangles out of the current point and those two other stars that have the shortest distance to this star.

This list of triangles is created for every image. After this I take one image as reference and then I walk through the list of triangles in the reference image to find a triangle in the other image with the same length of each side of the triangle (I also "allow" some tolerance due minimal relative differences of the star positions in each image). For this matches I calculate movement and rotation relative to the reference image. Last step is to find the matched triangles that have to same relative movement and rotation like the other matches. This is done by calculating the standard deviation, sorting out triangles that are not within 1 or 2 sigma and repeat this process until I have a very small standard deviation.

The last part, finding "valid" triangles with the same movement/rotation, is working fine. The problem is that sometimes I have only like 2 or 3 "valid" triangles out of 300 initial triangles. All other triangles have side lengths different to those of the reference image.

So I assume it's the way I generate my initial triangles which causes the problem. Sortings stars by their brightness and using this data to generate the triangles also doesn't work. So is there a better way to create the initial triangles in all the images?

Clear Skies,

David

Share this post


Link to post
Share on other sites

Aren't you reinventing the wheel?

This is what stacking/alignment algorithms already do.

Have you tried searching for scientific articles on the matter? (Not necessarily astro related). Juan Conejero if Pleiades Astrophoto wrote about this. His article is burried somewhere in the PixInsight web site / forum. Most likely the latter, in the section about new updates and features.

Due to minor geometrical defects (field curvature) of the optical system, stacking involves geometrical stretching of the images, to get the triangles to fit.

This is one reason why dss users sometimes complain of 'weird behaviour' in the corners of an image.

Good luck.

Edited by wimvb

Share this post


Link to post
Share on other sites

Yeah I know that there are already programs. I just want to write my own one as some "small" free time project. I know that there is some distortion on the edge of the images. That's the reason why a create triangles out of nearby stars and allow some tolerance in the side length of those triangles.

Pixinsight uses the RANSAC algorithm, however I use a different approach. In general my version also achieves good results - see the attached image - but it has some flaws building the initial "lookup structure". And I guess that's only a questions of how to select the stars per triangle. There are a lot of papers out there, but most of them are not within my free time schedule. :D - Like it said, I guess I just need some hint on which stars I should create my triangle. I have the following data of each star: position, FWHM on x and y axis and maximum brightness (but I could also calculate average brightness over occluded pixels). The question is how to use this wisely.

2017-03-25 22_22_42-.jpg

Edited by Hellstorm

Share this post


Link to post
Share on other sites

Sorry, can't help you any further. (Other than this:)

PixInsight has a tool to calculate the point spread function of stars. When using this tool it is recommended to exclude too bright (obviously) and too dim stars. Do you do something similar in your process? Probably FWHM and brightness is a way to achieve the same.

(and THAT's really all I can think of)

Good luck with your project, and keep us informed on your results.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By wimvb
      Well, not really actually. For some reason the stacking process produced this strange image.

      Most likely the image registration process aligned on hot pixels. And since the camera (Liverpool Telescope) is used in two orientations (90 degrees rotation), this was the result.
      Two colliding galaxies. Or is that three colliding galaxies? Or four?
    • By mike005
      NGC 2014 and Dragon's Head nebula in the Magellanic Cloud ( LMC ) not far from the Tarantula Nebula by Mike O'Day ( 500px.com/MikeODay ).
      This image shows multiple bright nebula and star clusters in an area adjacent to the The Tarantula Nebula ( NGC 2070 ) in the nearby irregular galaxy, the Large Magellanic Cloud ( LMC ). The largest of these are the bright pink nebula in the mid-right part of the image ( NGC 2014 ) and the blue nebula in the lower middle ( NGC 2030 ).
      .....
      Updated image - reprocessed to impove colour balance ( April 15th )

      ( please click / tap on image to see it larger and sharper )
      ....
      Original:

       
      ( click on image to see larger and clearer ( grrr... image compression in version above  ))
      ----------
      This is the first image captured as part of a new image capture and processing workflow I am trying out...
      Roger Clark ( http://www.clarkvision.com/articles/index.html ) has a number of articles addressing colour processing and the performance of modern DSLR sensors.  The "take homes" for me have been:
      1. With a modern sensor ( one with on-sensor dark current suppression technology ) one may not need to capture dark frames ( in order to remove the now non-significant pattern noise ).
      2. "Correct" white balance processing should start by using "daylight" RBG channel multipliers ( to get the star colour 'right') and any histogram adjustment to improve white balance of darker parts of the image should involve aligning the left side of histogram curves ( ie. not the peaks )
      So, the workflow to produce the image above involves calibraiton with Superbias & Master Flat but no dark frame subtraction (neither post nor in-camera).  Roger Clark speaks of using a "bad pixel map" as the basis of reducing hot pixels.  I have not figured out how to produce one yet.  However, with a little bit of dithering during guiding ( and the very busy image ) the hot pixels that are in the image below are not too overwhelming.
      With regard to colour balance; I tried using the "daylight" factors reported by the camera but these resulted in an image and stars that were quite blue.  This image was based on the factors reported by DXOMark for the Nikon D5300 ( R x 2.12, G x 1, B x 1.49 ( D50 standard )).  This was better but I still felt the need for a final tweak in Photoshop ( colourBalance Highlights +15 Cyan/Red, -5 Magenta/Green ) to improve the colour in the stars and mid-tones.
      { DXOMark "white balance scales" for D5300 found at: https://www.dxomark.com/Cameras/Nikon/D5300---Measurements on the "color response" tab }
      ---------
      Details:
      Bright Nebulae:
      NGC 2014 ( upper right, pink) size 30 x 20 arcmin Mag +8
      NGC 2020 size 2.0 arcmin ( small blue-green oval nebula )
      NGC 2030 
      NGC 2032 ( Dragon's Head nebula - blue, central bottom of image )
      NGC 2035 size 3.0 x 3.0 arcmin 
      NGC 2040 size 3.0 x 3.0 arcmin 
      Open clusters:
      NGC 2004 size 2.7 arcmin Mag +9.6
      NGC 2011 size 1 arcmin Mag +10.6
      NGC 2021 size 0.9 arcmin Mag +12.1
      Annotated :

      Image centre RA 05h 33m 32.362s, Dec -67° 32' 18.145" (nova.astrometry.net) 
      Orientation: up is west, right is South 
      Field of view (arcmin): 58.8 x 39.2
      Scale (full size image) 0.585 arcsec/pixel
      Telescope: Orion Optics CT12 Newtonian ( mirror 300mm, fl 120mm, f4 ).
      Corrector: ASA 2" Coma Corrector Quattro 1.175x.
      Effective Focal Length / Aperture : 1410mm f4.7
      Mount: Skywatcher AZ Eq6 GT
      Guiding: TSOAG9 Off-Axis-Guider, Starlight Xpress Lodestar X2, PHD2 
      Camera: Nikon D5300 (unmodified) (sensor 23.5 x 15.6mm, 6016x4016 3.9um pixels)
      Format: 14bit NEF
      Noise reduction: off
      Filter: none
      HDR combination of seven sets of exposures (20 & 22 Feb 2017):
      58 x 240 sec ISO 800
      8 x 120 sec ISO 800
      8 x 60 sec ISO 800
      8 x 30 sec ISO 800
      8 x 14 sec ISO 800
      8 x 7 sec ISO 800
      8 x 3 sec ISO 800
      Pixinsight: 26 Feb 2017
      Links:
      500px.com/MikeODay
      photo.net/photos/MikeODay
       
    • By Adaaam75
      Hi guys,

      Okay so I have a few questions regarding my AVX mount that have basically generated from me reading up on setting up my mount. Please don’t think I’m lazy, I have read up a lot regarding my new mount (hence the questions) and learned a lot so far but as I’ve only had the mount a week and due to work and time constraints I have been unable to do any more than literally unpack the mount and put it together. I should mention it took 30 minutes to flatten all the cardboard ready for Mr Recycling Man but the more packaging the better so no complaints there at all!!
      So, my questions are so I can have a one stop shop answer reference rather than trying to remember where all the tips were on this wealth of knowledge forum. Please excuse my ignorance, I’ve had my trusty Sky Watcher 130p AZ2 for 6 years so I’ve not just jumped in blind .....
       
      1)    Why is there a necessity to ensure the mount is facing the correct direction when setting up the scope?
       
      2)    I’ve heard similar comments made with regard to members permanent piers in their observatories, again, what is being referred to here and how would you ensure a circular steel pier IS facing a correct direction?
       
      3)    Does the peg on the tripod Base plate need to be directly over one of the legs or is it fine where it is positioned? (In between two legs)
       
      4)    Is there anything I should do during daylight hours other than align the (finderscope) in preparation for the alignment process?
       
      5)    Do I need to update my mount with the latest firmware (?) Software upgrade or can I assume as I bought it 3 weeks ago it will come up to date?
       
      6)    HOW do I update my firmware software?
       
      7)    How accurate does the declination need to be? Can I work off the (slightly crude) scale on the mong or should I be looking at getting a digital spirit level for accuracy?
       
      8)    With vibration in mind, until I sort out a permanent pier my scope will be on the tripod in the observatory, should I allow the tripod legs to stand on the soft flooring foam tiles or should it be on the wooden floor of the shed?
       
      9)    Do I need to worry about leaving my spanking new scope and mount exposed to the elements, all be it under a waterproof bike cover in the obs and secure? Slightly nervous 😐
       
      I really appreciate your time in both reading and hopefully replying with some useful guidance!
       
      All the best, looking forwards to those clear skies!
       
    • By Astrofriend
      Hi,
      I was asked on a Swedish forum to put an "Astronomical Dictionary" on my homepage. I have made a test page in an easy form. Astronomical related words linked to wikipedia.
      It aims to the beginners in astronomy so it should not be too complicated words.
      http://astrofriend.eu/astronomy/astronomical-dictionary/astronomical-dictionary.html
      Let me know if it's useful and and I shall add more words.
      /Lars
    • By AnEnglishmansCastle
      Evening All!
      I'm starting to take my first steps into the 'post-processing' of my images, and to be honest with you, I have no real clue of what I'm doing. Hence why I'm here tonight, to pick your brains  
      This is just one of a large selection of identical images I took tonight of a randomly selected patch of sky:
      DSC_0532.NEF
      As you can see, I get a fair number of stars in the image, but it's nothing too spectacular. Exposure time is only 1.3 seconds so I wouldn't expect much too begin with!. Now my main issue is how to stack my images properly. I know that I should stack my images, to get those better quality final pictures, but even after reading a few guides I'm not quite sure of how to get to those final results. As you can see after my attempt of stacking everything up (Using 'DeepSkyStacker') all of the limited details I had are lost and the image just looks a complete mess.
      Stacked.TIF
      Being new to the processing side of things, I expect I'm missing the blindingly obvious answer, but in summary, is 'How do I stack my images correctly?!'.
      - Stuart
      ( Also forgot how to attach my pictures as an image, so the file attachments will have to suffice I'm afraid!  )