Author Topic: Interesting STF Question  (Read 3210 times)

Offline Sean

  • PixInsight Addict
  • ***
  • Posts: 144
    • My Personal Website
Interesting STF Question
« on: 2016 February 03 16:50:32 »
I've noticed that sometimes the automatic STF results in a strange looking linear image, after noise reduction. I decided to investigate this in more detail, and found the following:

1) Opened a linear RGB image, fairly low SNR, with no processes applied after RGB combination
2) Applied an auto STF, and everything looked normal, other than some background gradients
3) Applied ABE, then auto STF, and again everything looked normal, other than the usual background noise
4) The STF parameters were roughly .0006, .0007, and 1.000 - seemed reasonable to me
5) Applied MMT noise reduction on the background, which did a good job
6) Applied auto STF to the noise reduced image, and now got a very blocky blotchy image.
7) The STF parameters were now on the order of .0008, .00009, and 1.000

Note that the Midtone value is now less than the Shadow clipping value - this doesn't seem right.

I understand that STF is for visual purposes only, doesn't affect the values, etc, etc, and in fact the noise reduced image combined with L to produce a good result. However, where this can cause a problem is if I drag the STF parameters to Histogram Transformation to convert to a non-linear image.

What I don't understand is why STF is producing these results on the noise reduced image. I tried with both regular and 24bit LUTs. I've seen this with various images in the past.

Ideas? Is it just a result of a low SNR? If so, why would it be evident after MMT noise reduction?

Thanks, Sean
« Last Edit: 2016 February 03 16:57:27 by Sean »

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Interesting STF Question
« Reply #1 on: 2016 February 03 17:46:39 »
no answer but i did notice this after starting to regularly use MureDenoise. i had just assumed that the statistical properties of the image were kind of whacked out after the NR, but maybe it's an actual problem with STF. i never thought to check the midtone/shadow values as you did.

rob

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: Interesting STF Question
« Reply #2 on: 2016 February 03 19:43:34 »
I believe Midtones less than Shadows is OK, its range is 0..1 independently I think. Also, larger Shadows on denoised images as well as on deeper integrations is to be expected given auto STF dispersion based algorithm. At least on my data auto STF contrast tends to be higher with lesser noise. Try command clicking the button and decrease the Shadows clipping value (eg. -2.8 to maybe -4 more or less). This will compensate for the smaller dispersion and reduce resulting contrast, better matching results on noisy frames and less deep integrations.

Thanks,
Mike


« Last Edit: 2016 February 03 19:55:28 by mschuster »

Offline Sean

  • PixInsight Addict
  • ***
  • Posts: 144
    • My Personal Website
Re: Interesting STF Question
« Reply #3 on: 2016 February 04 10:24:01 »
Mike,

Thanks, decreasing the Shadows clipping to -6 or -7 did make a big difference - thanks for the hint.

I think I understand what you're saying about the smaller dispersion with less noise, and hence greater contrast. However, I'm still confused by the Midtones value being less than the Shadows value - maybe I don't really understand what those values represent. When I adjust them by dragging on the STF graph, the Midtones is to the right of the Shadows, as represented by the marker lines in the various channels. When you click on them to drag them, their default values are shown. However, in the case I mentioned above, where Midtones < Shadows, the lines are very close together, with the Midtones line just to the right of the Shadows, but showing a value that is less than the Shadows value.

This just doesn't seem right...

Sean

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: Interesting STF Question
« Reply #4 on: 2016 February 04 10:48:37 »
Sean,

OK. Midtones is normalized in a way so that a value from 0 to 1 can be represented as a position between Shadows and Highlights. The formula for this is documented in the XISF spec.

Regards,
Mike

Offline Sean

  • PixInsight Addict
  • ***
  • Posts: 144
    • My Personal Website
Re: Interesting STF Question
« Reply #5 on: 2016 February 06 09:34:44 »
Thanks Mike. I read the XISF Spec and now have a better understanding of what these values mean. I think I'm OK on everything except the visual representation on the STF graph, where it appears that the Midtones line is always to the right of the Shadows even if the value is less.

Sean

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Interesting STF Question
« Reply #6 on: 2016 February 06 11:41:37 »
Hi Sean!
To my understanding the midtone value is relative to the shadow value.
So, if you do a linear stretch with histogram/STF the midtone will not be at
0.5 when the shadow is not at 0.0.
It will always be in the middle between shadow and HighLight value.

Open the Histogramprocess here the logic is better visible than in STF but
it is the same.

Gerald.
PS.: The midtonbe can never be left of the shadow, only its  relative distance can be smaller.

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: Interesting STF Question
« Reply #7 on: 2016 February 06 19:27:10 »
Sean,

Open STF, drag shadows to about 0.2 and highlight to about 0.9. Now drag midtones left and right. Note that when midtones is positioned at shadows its value is 0, and when at hightlights 1, half way between 0.5. The 0 to 1 range maps between s and h linearly.

Thanks,
Mike

Offline Sean

  • PixInsight Addict
  • ***
  • Posts: 144
    • My Personal Website
Re: Interesting STF Question
« Reply #8 on: 2016 February 07 08:19:33 »
Mike,

Ah, that makes sense, all is clear now. Not sure why my brain couldn't see this before!

Thanks,

Sean