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