Author Topic: StarAlignment degrades low-intensity channel  (Read 5685 times)

Offline ghilios

  • Newcomer
  • Posts: 3
StarAlignment degrades low-intensity channel
« on: 2020 February 22 17:54:59 »
If you do a StarAlignment with a file both as the reference and target image (so there should be no transformation) *or* if the reference is a cropped version of the target, and where one of the channels has very low intensity, the resulting image has many zeroed pixels in that channel. None of the other images seem to be affected. I suspect this is an issue with interpolation when pixels are completely aligned and the channel values are near zero.

To reproduce this, use this image (https://1drv.ms/u/s!AjipQEra3aDLhLxU8RhaEPfHZ6RfIQ?e=P5FfQK) and use "Auto" for interpolation. Open the resulting image and do an unlinked stretch - the blue will look very off. ImageStatistics reveals the blue channel has many more zero pixels after alignment.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: StarAlignment degrades low-intensity channel
« Reply #1 on: 2020 February 23 00:29:34 »
The blue channel is not being degraded at all. What you are observing is just a visualization artifact generated by STF's automatic stretch algorithm, which has not been designed to work with marginal data specifically. This apparently big difference is being caused by insignificant numeric roundoff errors. The median of the original blue channel is zero, while the median of the registered blue channel (with the default Lanczos-3 algorithm) is 1.2e-07, which is close to the machine epsilon for IEEE 32-bit binary floating point. This tiny difference changes the way STF works 'dramatically' in this particular case.

This happens because the blue channel of this image is marginal data everywhere except on the brightest stars, with a 61% of its pixels equal to zero. To demonstrate that there is no degradation (besides numerical roundoff, which is unavoidable), extract the blue channels of the original and registered images, set identifiers to 'B' and 'B_r' respectively, and apply the following PixelMath expression:

B -- B_r

This will compute the absolute value of the difference between both blue channels. As you can see from the (unclipped) statistics of the result:

mean        3.734424e-07
median      2.317241e-11
MAD         3.435542e-11


the difference between both blue channel images (before and after registration) is just a residual at the limit of numeric resolution. You can verify this also by inspecting the PixelMath result visually and watching pixel readouts. So just ignore this apparent issue. It cannot affect the final integrated image in any way.

Quote
ImageStatistics reveals the blue channel has many more zero pixels after alignment.

Actually, it's just the opposite: there is a 38.83% of nonzero pixels in the original blue channel, while the registered blue channel has a 99.96%. However, as noted above, this is irrelevant.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline ghilios

  • Newcomer
  • Posts: 3
Re: StarAlignment degrades low-intensity channel
« Reply #2 on: 2020 February 29 10:32:19 »
Thanks for the explanation Juan!