Author Topic: masking and histogram functions?  (Read 4372 times)

Offline h0ughy

  • PixInsight Addict
  • ***
  • Posts: 226
masking and histogram functions?
« on: 2010 May 10 19:03:32 »
This is a question to do with processing, can you stretch an image with the histogram function, and then apply a mask to the feature you want to keep, and then invert the mask protecting the feature you brought out and “deintensify” the background?
Doghouse Observatory

Offline dhalliday

  • PixInsight Old Hand
  • ****
  • Posts: 307
    • on Flickr
Re: masking and histogram functions?
« Reply #1 on: 2010 May 10 22:13:55 »
Boy...I hope so...because I do it ALL the time... >:D

Its not really accurate,because the mask favors the stronger signal,but if done in steps,I love it.
I suspect that technically its not up to "PI snuff"....will wait to hear from others...
Isn't this a bit of what the masked stretch utility is doing...??

Dave
Dave Halliday
8" Newtonian/Vixen VC200L/ TV 101,etc etc
SSAG/EQ6
CGE Pro
SBIG ST2K,ST10XME

Offline h0ughy

  • PixInsight Addict
  • ***
  • Posts: 226
Re: masking and histogram functions?
« Reply #2 on: 2010 May 10 22:59:59 »
Boy...I hope so...because I do it ALL the time... >:D

Its not really accurate,because the mask favors the stronger signal,but if done in steps,I love it.
I suspect that technically its not up to "PI snuff"....will wait to hear from others...
Isn't this a bit of what the masked stretch utility is doing...??

Dave
so you can do it?  Can you spell out in detail what you do?  a few screen shots?
Doghouse Observatory

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: masking and histogram functions?
« Reply #3 on: 2010 May 11 00:00:39 »
Quote
can you stretch an image with the histogram function, and then apply a mask to the feature you want to keep, and then invert the mask protecting the feature you brought out and “deintensify” the background?

Yes, in theory you can, but the difficulty is in finding a Histo stretch that will correctly 'deintensify' the previously stretched image. In other words, you need to find the 'inverse' of your first stretch.

However, if you stretch the image as planned, to get the area you are interested in looking the way you want it to, and then make a duplicate (clone) of this modified image, and then make a mask from this cloned image - revealing only those areas that you want to change.

Now, go back to the first, modified, image and 'undo' the histo transform - don't worry, the Histo process still 'knows' what your setup parameters were. Now you apply the 'mask' to the original image, and then re-apply the Histo stretch 'through' the mask.

Is this what you are after?

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: masking and histogram functions?
« Reply #4 on: 2010 May 11 03:31:06 »
Hi,

Quote
In other words, you need to find the 'inverse' of your first stretch.

This is actually very easy. If you have applied a HistogramTransformation (HT) with a midtones balance m, then the inverse transformation is 1 - m. For example, applying two successive histogram stretches with m=0.1 and m=0.9 leaves the image —neglecting roundoff errors— in its initial state.

Of course, the above does not apply if the image has been clipped at one or both ends of the histogram. Clipped pixels are unrecoverable. But as long as you only apply midtones transformations, the inverse transformation of m is 1-m.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: masking and histogram functions?
« Reply #5 on: 2010 May 11 08:47:58 »
Quote
the inverse transformation is 1 - m

I had never given that any consideration Juan - I have learned something new again (which, of course, now means I have to 'unlearn' something 'old', as my neural net has reached full capacity - and if I don't watch out, I will exceed my full-well capacity and leave horrible streaks all over my mind :'()

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline jmtanous

  • PixInsight Addict
  • ***
  • Posts: 155
Re: masking and histogram functions?
« Reply #6 on: 2010 May 21 16:07:09 »
Juan,

Thanks for the tip!

Another technique to abuse my images!

Cheers,

José