Repairing Elongated Stars

DO NOT ADVERTISE COMPETING PRODUCTS. PLEASE FOLLOW THE FORUM RULES: https://pixinsight.com/forum/index.php?threads/forum-rules-and-guidelines.9037/
although it costs $$$, blurXterminator does a really good job of correcting these kinds of aberrations. there's a free trial available on rc-astro.com

rob
Thanks Rob,

I'll take a look at it, but I already have StarTools that does a pretty decent job with this as well as a couple of Photoshop plug-ins. My objection is in having to switch to a different tool to solve this rather than being able to use PI for my entire process. No offense to Juan, as the team has done an impressive job with PixInsight, but beyond stacking (by a script rather than built in functionality) and perhaps noise reduction, there's not much that PI does that isn't altering the original photographed content into something unrealistic. Thus, it seems kind of arbitrary to draw the line at fixing stars, which arguably would be making them more accurate to the original, where all the stretching and sharpening we do on everything else is moving further and further away from what is really visible in the sky. If you're going to say, "You need to fix your optics" rather than offer a solution to do it in post processing, then you might as well say, "You need to have a noiseless camera." rather than offering noise reduction and "You need to integrate one single shot for hours." rather than stacking.

Ok, off soapbox. I want to delve into Steve's pixel math and see just how flexible the pixel math functions are (i.e. can I do operations based on X and Y values of the pixel as well as trig operations?) as that should make it possible to using what Steve's doing to create a radial correction from the center of an image. You'd add an additional scaling parameter or two to control the strength of the correction based on a non-linear radial function.

Thanks,

Beo
 
  • Like
Reactions: dld
(i.e. can I do operations based on X and Y values of the pixel as well as trig operations?)

yes x() and y() or xpos() and ypos() will return the current pixel location in the x or y dimension. w() gives you the width of the image so with x()/w() you get the fraction of the width of the image at pixel location x.

abs(x()-(w()/2))/w()*2

for instance, will sort of tell you how far you are from the center of the image in the X direction as a percentage of the width of the image.

blurX is expensive but it's pretty amazing what it can do. there's a thread on CN with before/after images and even pictures with stars defocused from extreme tilt can be repaired.

rob
 
Elongated stars can be caused by:
a) Lens/Mirror aberrations which usually cause larger elongations for stars near the edges and corners of the FOV. Elongation direction is radially outward.
b) Camera tilted relative to optical axis. Stars become more elongated as stars are further away from the tilt axis. Elongation is away from tilt axis.
c) Tracking/Guiding errors. All stars in image are elongated the same amount and in the same direction with this type of error.

This technique will apply the same correction to all stars in the image. So, it is best suited to correct Tracking/Guiding errors. However, a mask is used in this technique, so, the mask could be tailored to correct only a portion of an image if desired.

The image below is the one that will be repaired in this tutorial. There is a minor elongation of all stars in an approximately horizontal direction. The green box shows the Preview area that will be used to show an expanded view of the stars.

View attachment 14626

CORRECTION PROCEEDURE:
  • Create a star mask of the original image. Use HistogramTransformation to stretch the star-mask to brighten all the stars.
  • Create two clones of the original image. Name one Repaired and the other Shifted.
  • Use Resample to expand all three images by 3x in both X and Y directions (star_mask, Repaired and Shifted).
  • The corrections to the elongated stars are defined by two parameters; n and Angle.
    • n is the number of pixels that the long dimension of the elongated stars will be contracted. The image below shows a typical star expanded so that individual pixels can be seen. The brighter star is the typical star.
      • View attachment 14627
      • I estimated that contracting the long dimension by 3 pixels would make the star look round, so, n=3. This is just a guess, and, this value will be changed later if necessary.
    • Angle is the second parameter required to define the correction. It is the angle at which the stars are elongated. The picture below shows the coordinate system used to measure angle. 0 degrees is horizontal right on the image and 90 degrees is straight up.
      • View attachment 14628
        • I estimated that Angle = 5 degrees for the typical star two pictures above.
        • Open PixelMath and select the Symbols tab. Enter the values for n and Angle as shown in the picture below (of course you would use your values for n and Angle).
        • View attachment 14629
        • Select the RGB/K tab and enter the expression shown below.
        • View attachment 14630
    • Once all the information is entered into PixelMath drag and drop the blue triangle in the lower left corner onto the opened Shifted image. This will shift the entire image.
    • With Repaired open apply star-mask as a mask.
    • Open PixelMath again and clear all information with the reset button (lower right corner). Enter the expression as shown in the picture below.
    • View attachment 14631
    • Drag and drop the blue triangle onto Repaired. This will make a correction to all the stars in the image.
      • If the corrections to the stars are acceptable, then, use Resample to reduce the image size by 3X (returning it to the original size) and you are done. star_mask and Shifted can be deleted.
      • If the corrections to the stars are not acceptable (stars still elongated or stars overcorrected) then use Undo to remove corrections from Repaired and use Undo to remove any shifting from Shifted. If stars were undercorrected increase n and try process again. If stars were overcorrected then reduce n and try process again. Repeat until satisfactory result is achieved.
  • The two images below show the original image (Preview window) first and the repaired image (Preview window) second. Notice how all the stars look nice and round in the repaired image.
  • View attachment 14632
  • View attachment 14633

Another Example:
The correction is not limited to only slightly elongated stars. Below are the original and corrected versions of a target with stars that were significantly more elongated. The image on the left is the original and the image on the right is the corrected version.


View attachment 14634 View attachment 14635


The link below is to a set of process icons to perform these tasks.

https://www.dropbox.com/s/zp3hw8j0hbbmkdt/Repair Elongated Stars.xpsm?dl=0

FINAL NOTE: The corrections can be limited to a chosen area by tailoring the star_mask. For example, if it was desired to only correct the stars in the upper right corner of the image, then, the star_mask could be adjusted to look like the image below. Then only the stars in the upper right corner of the image would be corrected.

View attachment 14636

Hope this is useful for you.

Steve
Tested on my really poor image data with mirror and tracking errors - absolute Gold standard solution. I'd looked at numerous recopies for fixing stars before trialing yours. Thank you and thank you.
 
Back
Top