Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

Effects of interpolation on image resolution


Recommended Posts

I've found rather interesting way to asses effects of interpolation on image resolution.

Whenever we take bunch of subs and stack them to produce an image, we use interpolation as a part of process of stacking - frame alignment. Interpolation is also used in debayering process in OSC frames if one wants to "preserve full resolution" of the sensor.

Each of these interpolation algorithms affects our data, but it would be good to understand just how much and in which way.

I touched upon this subject in a recent thread while discussing debayering / OSC resolution with @Xiga so I figured to start a new topic dealing with it and share some insights.

Let's start by noticing interesting property of Fourier Transform of image - when we translate image, FT amplitude is not affected, only phase information. We can check this very simply by taking an image, shifting it by one (or few) pixels, and looking at respective FFT amplitude images (we can subtract or divide them to see if there are really any differences).

image.png.5f9b074a32cfb543b6d39c5f03a56dbf.png

We start by simple image and it's translated version (above version is translated by 1, 1 pixels in X and Y directions).

image.png.ec1b32565371a1c01a69dc784db2f99b.png

These are FT amplitudes of both images - and already they are looking very much alike. We can now divide the two frames and see what we'll get.

image.png.d5ad3ab250d40adb2b453733713c3dc1.png

And indeed - we get constant image with value of 1 (dividing two same numbers gives 1).

How can we use this? We can generate random noise and see what happens when we shift it by some non integer value. Will we get the same resulting flat image or will there be some change to it?

image.png.15063abcf34a1d94d77014f7e0846ab3.png

Here I did just that - created patch of gaussian noise with mean 0 and sigma of 1 and then I translated that image using linear interpolation algorithm by 0.5px, 0.5px.

We can instantly see that there is some change - noise appears to be somewhat smoothed out and it is not fine grained any more like in starting image. If you've ever wondered why is DSS producing images that have this coarse grained background noise - well, this is the reason - linear interpolation used by DSS produces this. Let's use above method to asses what exactly happened.

Well, look at that:

image.png.ee20d0d3abba1808c824c7cf3924e2f4.png

Two images are no longer equal - this can be easily seen. How much different are they? Let's divide one with another.

image.png.790b55ae7ed0be66e30a90b0bc8d4d32.png

This looks like some sort of filter and indeed - it is low pass filter. Maybe it will be easier to see if I plot profile rather than surface plot - so I'll take linear cross section and plot it as graph:

image.png.a99fd3a8225df393c2a6be9c85c1ad38.png

Ok, so we can now see that as frequencies increase - so does attenuation. Linear interpolation is blurring out detail when applied!

Will other interpolation algorithms do that as well? Let's try with next by complexity cubic interpolation.

Cubic interpolation gives following filter:

image.png.0b044de2bf3cb18aff02b19c9b05c363.png

It looks nicer than linear interpolation, so what is the profile like?

image.png.bc4ffbe96a2c3812e7f7e9e55374f6cf.png

Here is graph showing linear (black line) and cubic (red line) interpolation. Cubic interpolation clearly impacts data less than linear interpolation.

Let's check few more algorithms.

image.png.227a2ff6f7c4b38626744cbc26bbaa84.png

Here I added cubic spline (green) and quintic spline (blue) - as interpolation algorithms get more advanced - impact on data lessens.

Another interesting thing that we can take a look at is impact of interpolation depending on how much image is shifted from original in fractions of pixel. Since full pixels show no blurring, and half pixel shows it - how does it change in between?

image.png.ca2fa2f4f1a480e98a82bbe2d618e855.png

Here we have comparison of 0.1px (black), 0.2px (red), 0.3px (orange), 0.4px (yellow) and 0.5px (green) shifts - each done with cubic spline.

It is clear that amount of shift from original position dictates amount of blur in the image. It is therefore best to have subs that are integer pixel shifts between each other. Sadly, as amateurs we don't really have this option with popular guiding software - to force dithers to be at specific location with respect to imaging camera.

However, we can clearly see that use of advanced interpolation algorithms is beneficial.

In the end, let's look at one more graph:

image.png.901067e48f562e069219386d94189c1e.png

This graph shows - response of single shift of 0.5px with use of linear interpolation (black) compared to two consecutive shifts of 0.5px using linear interpolation.

Each time you shift image, you introduce another "round" of blurring and things compound! For this reason, it is best to have registration software enable you to frame your target properly when registering frames so you don't have to do additional rotation and shift when cropping finished stack!

  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...
4 minutes ago, jetstream said:

And I hope you write some, so us amateurs can use the, excellent info Vlaiv

Well, there is actually large number of them readily available that will satisfy the need of amateurs - it is just the matter if they have been implemented in software.

For example - free software like Deep Sky Stacker uses linear interpolation, but PixInsight has large number of supported algorithms - here is page from its reference documentation on interpolation algorithms:

https://pixinsight.com/doc/docs/InterpolationAlgorithms/InterpolationAlgorithms.html

As far as I know APP also has advanced interpolation algorithms.

Not sure how planetary stacking fares in this respect - I don't know what AS!3 is using for example.

 

Edited by vlaiv
  • Like 1
Link to comment
Share on other sites

2 minutes ago, vlaiv said:

Not sure how planetary stacking fares in this respect - I don't know what AS!3 is using for example.

I have some semi specific questions regarding the MTF sag in some telescopes caused by various aberrations. This is more of a programming/algorithm question than the actual MTF deal.

Question:

1 what optical aberrations cause issues that common planetary frequency restoration algorithms use for processing ie the non symmetric ones discussed?

2 in my current situation the plan is to use exceptional optics to hopefully mostly avoid some of the mentioned issues in (1) above. However I'm looking at an 8" Edge SCT in the near future which will have a fairly big sag caused by CO but also who knows what.

I hope I asked a question that makes sense!

Link to comment
Share on other sites

59 minutes ago, jetstream said:

1 what optical aberrations cause issues that common planetary frequency restoration algorithms use for processing ie the non symmetric ones discussed?

I think if PSF is asymmetric then so is MTF.

This means - coma, astigmatism, pinched optics, tube currents and so on. You can see more details here:

https://www.telescope-optics.net/mtf.htm

(scroll down the page to the bottom - you'll see large table with graphics - showing aberration types / wavefront, PSF and MTF - if MTF has multiple graphs it is in different orientations).

1 hour ago, jetstream said:

2 in my current situation the plan is to use exceptional optics to hopefully mostly avoid some of the mentioned issues in (1) above. However I'm looking at an 8" Edge SCT in the near future which will have a fairly big sag caused by CO but also who knows what.

CO makes symmetrical MTF, but if your plan is to do planetary - maybe look into Classical Cassegrain instead?

CCF telescopes make ccs with very long focal length - like F/20 and F/24 - but are extremely expensive. Maybe something could be found on second hand market instead?

  • Like 1
Link to comment
Share on other sites

Thanks @vlaiv will check this out tonight, right now getting ready for the -45c to -50c (wind chill) that the polar vortex is bringing. Gotta do some wind blocking, insulating on the propane lines, water lines etc. I'd rather be learning about optics...

Edited by jetstream
Link to comment
Share on other sites

This is interesting https://www.telescope-optics.net/mtf3.htm

"None of these effects that can significantly lower image quality and detection level is indicated by the MTF. exception being, of course, low contrast level in the case of spherical aberration (spherical aberration also causes contrast reversal at the roughly doubled error magnitude)."

                                                                                              ^^^

"     Defocus causes contrast reversal, changing the appearance of both images. Coma causes obvious asymmetry. Astigmatism causes an interesting effect that appears as contrast reversal in the star pattern, but only as intensity shift in the frequency continuum pattern (the difference in appearance for the lower and upper left portion of the image is caused by the diffraction pattern, rotated 22.5 counterclockwise, being nearly aligned with its "best" axis with the former, and with its "worst" axis with the latter). Primary spherical has lower contrast transfer in low and lower-mid frequencies, compensated by higher transfer in the high-mid frequencies, but the only change in image appearance is due to the insufficient contrast at some frequencies. Balanced secondary spherical, even if generally similar to the primary spherical, and at a roughly similar magnitude level, causes noticeably different effects. And the effect of seeing is in some ways similar to coma having, due to the extent of PSF energy spread, lower an early contrast drop and, due to its asymmetry, detail deformations. However, unlike coma it causes quite pronounced contrast reversals."

as is this:

"ROUGHNESS: ~1/14 and ~1/7 wave RMS of roughness producing asymmetric PSF pattern, thus having contrast transfer vary with its orientation relative to MTF bars. Due to the random nature of the aberration, the P-V wavefront error can vary significantly for any given RMS/Strehl level. IHere, the P-V error ranges from -0.169 (blue speck on the wavefront map) to 0.374, and -345 to 0.745, respectively. RMS error also may not be as reliably related to the Strehl as with most other aberrations."

Edited by jetstream
Link to comment
Share on other sites

With regards to roughness- one of my main requirements in a set of newtonian mirrors is smoothness as is the optician I deal with, Terry Ostahowski. Very interesting that roughness shows as an asymmetric PSF.

Also interesting that there are things that can degrade the image and not show on the MTF.

Edited by jetstream
Link to comment
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.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.