NBColorMapper Stretching Images

I'm having an issue with NBColorMapper outputting a stretched image. Not sure why this is happening. This is what I'm doing:

1. My input images are linear S, H, and O (linear fitted).
2. I map each channel to the desired color. 
3. I Select a small region for background neut. 
4. Tweak as needed 
5. Punch that little checkmark to output.

I expect a linear image, but I get a stretched one.

Anyone else seen this? What am I doing wrong?

Comments

  • You images are too bright. However, Mike is coming out with a new version that will help.
    Just remember, the images are being screened together. The linear fit images should still have *small* values... but it sounds like they do not. I assume you are *not* applying the STF to the images.(unchecked)

    Some screenshots would help.

    -the Blockhead

  • Screenshots would help, wouldn't they?

    Here is the Ha screen stretched. I linear fit SII and OIII to this.
    image

    Here's the stats for Ha (linear fit OIII and SII being similar):

    image

    After color mapping (no stf output checked -- just straight color map and output), I get this (pardon the colors...). This is NOT screen stretched.



    image

    Here are the stats for the color mapped image:

    image
    HA.jpg
    2373 x 1566 - 91K
    HA_Stats.jpg
    588 x 541 - 53K
    nbcmImage3.jpg
    2373 x 1566 - 107K
    nbcm_stats.jpg
    591 x 537 - 69K
  • A further test. I used the Colourise process to independently color my channels (again, not being careful...just a test), and then screened two of these together using ImageBlend. 

    This is the ImageBlend result screen stretched.
    image

    And here are the stats:

    image

    Obviously, this resulted in the linear image I expected. A bit baffled by this. 
    ImageBlend2.jpg
    1383 x 922 - 98K
    imageblend2_stats.jpg
    593 x 540 - 73K
  • edited September 2024
    Alright...more experimentation. I think I've figured this out. 

    If I turn off Background Neut in NBColorMapper it outputs the expected linear image like this:

    image

    Stats are good -- consistent with linear:

    image

    If I then apply background neut separately with default settings, does exactly what NBColorMapper does:



    image

    Stats similar to NBColorMapper with Bg Neut too:



    image

    But if I tweak the Background Neut upper limit to be 0.02, it's fine. Stays linear.


    image

    Returning to NBColorMapper, I tried to tweak the Background Neut upper limit, but nothing works. The range is 0-10, and I tried 0, 10, and points in between. They all result in a stretched image. So bottom line is I can't really use NBColorMapper with this data due to the weird Background Neut thing. Without Background Neut I can't see what I'm working with in the preview (color is wacky), and with it I get a stretched image that doesn't represent my linear data. 
    nbcmImage4.jpg
    1382 x 922 - 77K
    nbcImage4_stats.jpg
    590 x 539 - 75K
    nbcmImage4_BN.jpg
    1385 x 920 - 88K
    nbcmImage4_BN_stats.jpg
    588 x 541 - 75K
    nbcmImage4_BN_ULTweaked_stats.jpg
    589 x 537 - 73K
  • I actually think @Mike Cranfield's comments might be useful here...
    Good work on laying all of this out.
    -the Blockhead
  • edited September 2024

  • edited September 2024
    Hi Jeff

    This is an issue I have been aware of - you have done an excellent analysis here so I will give you a thorough response - sorry if it is too much information!

    Let's start by analysing how Background Neutralisation (BGN) works. At a high level, the median level of each channel is computed for your chosen Region of Interest (ROI). Then each pixel in the image is adjusted by subtracting the relevant median - ie, if the pixel channel values are (r, g, b), these pixel values are adjusted to (r - medianR, g - medianG, b - medianB).

    Subtracting medians from channel values will generally lead to negative pixel values in the resulting image. BGN offers a number of ways to compensate for this defined by the Working Mode. The default approach is "Rescale as needed". This calculates the minimum and maximum sample values in the resulting image and then uses a linear transformation to rescale the minimum value to zero and the maximum value to 1.

    This approach works well for images with stars but in NBCM we generally are using starless images. The maximum sample value in these can be very small and so the rescale process will brighten the image significantly. This is the effect you are seeing.

    So why can you adjust parameters when you apply BGN separately to avoid this happening? Well, there is another step when calculating the medians in the ROI that I missed out above. If any of the sample values for a certain pixel are above the upper limit or below the lower limit, this pixel is ignored in calculating the medians. When you set the upper limit to 0.02, every single pixel in your ROI has a sample value (ie one of the channel values) which is above this value. So every pixel is ignored and no background normalisation takes place. Compare the statistics of the image after applying BGN with upper limit 0.02 with the statistics of the NBCM image before applying that BGN and you will se they are identical.

    So why could you not find a setting in the NBCM Background Neutralisation that did the same thing? That is because the upper and lower limits in NBCM are differently defined. They are calibrated in standard deviations and are specified relative to the median. So the upper limit will always be greater than or equal to the median. By contrast in the BGN process these limits are simply absolute values so you are able to specify a value for the upper limit which is less than the median and, indeed, less than the minimum sample value.

    Incidentally, as currently implemented, your image data is still linear. It has been rescaled but only using linear transformations. Your data still has a linear relationship to the captured photons (subject, of course, to any non-linearity in your capture system), just a different offset and scale. You can rescale the image linearly to reduce the brightness introduced by BGN with HistogramTransformation using the "High range" parameter.

    In the next version of NBCM I am planning to change the way the rescale is applied so it maps the minimum value to 0 (as now) but at the top end it maps (1 - min(medianR, medianG, medianB)) to 1. This is effectively equivalent to assuming the image has a a saturated star before BGN is applied. This will mean you will no longer see this issue.

    I hope this helps.

    CS, Mike
  • Hi Mike — thanks for this explanation. That clarifies things immensely. Will rescale per your suggestion, and look forward to the next version. Thanks much!
Sign In or Register to comment.