Author Topic: Histogram Transform: graph from top does not move down after applying  (Read 8106 times)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Hi,

when you're fiddling with the HT process the top graph shows what the histogram will be like after you apply the current transform, right? If that's true then why does the top histogram graph not move to the bottom graph after I apply?

Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Because your first statement, namely:

Quote
the top graph shows what the histogram will be like after you apply the current transform

is true. So after applying HT the top graph predicts the histogram as it would be if you'd apply the same HT again. The bottom graph always shows the current histogram functions.

That said, always bear in mind that the top graph is a prediction generated from histogram data, obviously not from pixel data. There can be some small differences with the actual histogram after HT, which usually are negligible.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
I think you'll agree there is a *huge* difference between the top graph in the first image and the bottom graph in the second. Why is that so? Is the estimate in the first that far off?

To be clear, the difference between the two screen shots is: apply HT and reset HT parameters even though the reset of course does not affect the bottom graph at all. When I apply the HT I would expect the top graph to move to the bottom.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Sorry, I didn't look carefully at the screen shots in your first post. Now I understand what you mean.

The prediction in your example is correct. It just happens that RGB histograms are always shown normalized. Normalization means that the R, G and B peaks are drawn with heights proportional to their relative amplitudes. The highest peak occupies the whole graph (vertically), while the other two peaks are scaled proportionally. In this way you get visual information on relative peak intensities. However, sometimes the final scaling ratios cannot be predicted accurately by HT's top graph, and hence you can see differences as in your example. This is quite unusual though. Note that the positions of the red, green and blue peaks after HT match the predicted positions very accurately. So this is not a bug, but a limitation of the histogram prediction routine.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Ok, thanks Juan for taking another look and explaining it to me. I like to tell people that the HT process alone is worth getting PI for so I like to understand what it's doing :)
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
The whole design and a 90% of the functionality of the HT tool are very old; I think they haven't changed since 2003. Note that this is even older than the first PixInsight LE release (2004) :)

I appreciate your support. For many years I've been unable to understand how and why so many users of other well-known applications can live with so inferior (embarrassingly poor I would say) implementations of a fundamental tool such as the histogram transformation. And even more when we are speaking of a discipline where the histograms are so complex and require so accurate and drastic manipulations. Isn't it curious? :)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
I think the problem is many people don't truly understand what the HT does and thus don't get why you want 64K samples and both pixel and percentage counts to show how many pixels you're dropping.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline RBA

  • PixInsight Guru
  • ****
  • Posts: 511
    • DeepSkyColors
I think the problem is many people don't truly understand what the HT does...
No, the problem is a lot more about human nature than some technical details.

Offline RobF2

  • PixInsight Addict
  • ***
  • Posts: 189
  • Rob
    • Rob's Astropics
Yes, most people seem to get excited about DBE in PI before anything else.  I often get a funny look when I say how fantastic the HT tool is.  It's like "what's the big deal - how hard is it to do some stretches in PS?".  I suspect experienced PS users intuitively get a feel for where to put the stretch points, but it's so much smoother and reproducible in PI.  Interesting to hear that functionality dates back to 2003.  Sounds like Juan - get the fundamentals right and keep add more and more blocks on top as you reach for the sky.... 8)
FSQ106/8" Newt on NEQ6/HEQ5Pro via EQMOD | QHY9 | Guiding:  ZS80II/QHY5IIL | Canon 450D | DBK21 and other "stuff"
Rob's Astropics

Offline martin_magnan

  • Member
  • *
  • Posts: 68
    • Messager Céleste
Hi guys

I have a question about this subject.

If the image we apply the HT is masked, does the calculated histogram take the mask into account or not ? I suspect it does not.

Martin
TEC140 / AP1200GTO / QSI583wsg - Astrodon LRGB 2 filters / Lodestar X2 Guider / Robofocus
http://www.messagerceleste.com

Offline RBA

  • PixInsight Guru
  • ****
  • Posts: 511
    • DeepSkyColors
If the image we apply the HT is masked, does the calculated histogram take the mask into account or not ? I suspect it does not.
No, it doesn't.

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
No, it doesn't.

I think it should :)
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Cleon_Wells

  • PixInsight Addict
  • ***
  • Posts: 225
While we’re kicking the HT tires.
Why does increasing the HT vertical graph gain show me the top of the display,  so I then have to pull the vertical adjustment slider down to see the bottom of the display?   (  I think I’m getting that dreaded Carpal Tunnel Syndrome, 8>)--
Increasing of the horizontal gain show what I want to see, the black point, without moving the horizontal slider.
Cleon
Cleon - GSO 10"RC/Canon T1i-Hap Mod, 100mmF6/2Ucam/MG, EQG/EQmod

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Quote
If the image we apply the HT is masked, does the calculated histogram take the mask into account or not ?

No it doesn't. The top histogram graph tells you how the adjustments you're making to HT parameters would change the current histogram, if applied to the image directly without any mask. For more sophisticated evaluations, you can create a preview on the image and try HT on it, then use the undo/redo preview command to compare the before/after histogram on HT's input histogram graph.

Quote
I think it should

Note that in order to generate a real-time prediction of the output histograms (that is, automatically updated as the user changes HT parameters) after masking the processed image, the whole process, including masking, would have to be applied to a temporary duplicate of the image. The HT tool could generate reduced temporary duplicates on the fly to implement this functionality, but this would be just a rough approximation. This is one of the tasks for which previews have been conceived and implemented in PixInsight.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Quote
Why does increasing the HT vertical graph gain show me the top of the display

Yes, this is something that should be improved. The zoom function should preserve the current position on the graph, and if zooming in from 1:1, the graph should stay anchored at the bottom left corner. I'll try to fix this issue with an update to the HT tool. Thank you for (re)pointing this out.

However, if instead of zooming in/out with the zoom spin boxes you use the mouse wheel, then the graphs try to preserve the position at which the cursor is when you move the wheel. With the graph at 1:1, place the mouse near the bottom left corner and move the wheel towards you. This will zoom in and the graph's position won't change.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/