Jump to content

NLCbanner2024.jpg.2478be509670e60c2d6efd04834b8b47.jpg

Multiscale Median Transform to push detail


Recommended Posts

Sometime ago I mentioned that I use Multiscale Median Transform (MMT) in PixInsight to enhance local contrast and lift details. At that time I wrote that I would try to put together a write up of my procedure. A few days ago, I mentioned MMT again, and after a reply by @ollypenrice, I wrote I would put something together this weekend. Now weekend is coming to a close, so I better keep my promise. So, here goes.

When doing image processing in PixInsight, you have the possibility to work with wavelets, or levels of detail. PI has methods to divide an image into layers of detail.  (Note that layers in PI has nothing to do with layers in PS or GIMP.) Any signal variation on a single pixel level goes into layer 1. Any signal variation that is "two pixels wide", goes into layer 2; four pixel wide into layer 3, etc. Since most of the variation that is on a single pixel level, is due to noise, layer 1 will almost allways just consist of noise. Even layer 2 will contain a lot of noise, but also the smallest stars.

PixInsight has three processes that work with wavelet layers: HDRMultiscale Transform, Multiscale Linear Transform, and Multiscale Median Transform. The first process is normally used to control contrast in very bright regions, such as the core of a galaxy. The other two processes are used for noise reduction. Here I will show how Multiscale Median Transform (MMT) can be used to enhance details and local contrast. (MLT can also be used to enhance local contrast, but as a side effect, it can produce dark rings around highlights such as stars. MMT doesn't have this side effect, and that's why I prefer to use it.)

There is another process in PI that also enhances contrast (and which indirectly also works with layers). This process i called Local Histogram Enhancement (LHE). I find that this process most often increases the noise in an image, because it works on all layers up to a set limit. In MMT, you can determine which layers (which level of detail), the process should work on. MMT allows much finer control of the contrast enhancement process.

So, let's start. As an example I take a crop of one of my images, the central region of M94. This is not a particularly good image, but it will do. I have already processed this image to the nonlinear stage, including deconvolution and stretching. For the sake of clarity, I will somewhat overdo the process. The aim here is not to get the best image, but to show the method.

M94_core.jpg.ce5d162095ab9d0b58c38749a2bd0bfb.jpg

At this stage, there is detail in the core, but it is too bright and has lost contrast. I also want to lift contrast in the outer regions of the galaxy to better show the spiral structure. I will do this in two steps.

In step 1 I will enhance the outer regioins. There is a hint of a spiral structure, but overall this region is flat. To protect the very edge of the image, and the core of the galaxy, I create a range mask that protects these regions, as well as the stars. Next I apply MMT. To lift detail, I set the bias value in the layer I wish to enhance.

MMT_outer.jpg.1c10ade60e81e5e57b421449c5294dcc.jpg 

Layers 4 through 6 contain the signal that I want to enhance. This will brighten the image, so I adjust that by giving the residual (the background of the image) a small negative bias. I found the values for the bias and to which layer to apply by testing on a preview.

M94_core_MMT_mid.jpg.7eb46ce3e745ac0272e2f8f639606cda.jpg

For step 2 I create a new mask, which only exposes the core. Again I apply MMT, now with these settings

MMT_core.jpg.40be7783ff9357d9b2e65e2558837d26.jpg

Again, I determine the best settings by experimenting on a preview. This is the result.

M94_core_MMT_final.jpg.7f1eef25b4399fc9fd804ce6a4f955cf.jpg

Some final remarks.

When you use MMT to enhance contrast, you need to at least mask the stars. MMT will brighten stars as well as the main object. The star mask should cover the stars and any halos.

The first time you apply MMT to an image, even a preview, it will calculate the wavelet distribution of the entire image, regardless of the size of any preview. This means that MMT will appear very slow. But it will do this only once. If you re-apply MMT to a preview, it will execute much faster.

In this example I applied MMT to the luminance of the image. The image was already monochrome, so it would be applied to luminance anyway. If you have a colour image and want to enhance detail or contrast, you should set luminance as the target. MMT can also be used to enhance local colour saturation. If you for example wish to enhance the colour of bright young stars in a galaxy, you determine which pixel scales these have, and set the bias of the layers you wish to enhance. You then apply MMT to the Chrominance of the image. Unlike the Colour Saturation process of PI, this allows you to target small regions for colour saturation.

  • Like 7
Link to comment
Share on other sites

That is really helpful.  I use MMT but I've never really understood the logic behind it, which I think is important to use it more effectively!  The negative bias is a neat trick, and I never understood what applying to the Chrominance did vs the Luminance.  Thank you! 

Link to comment
Share on other sites

11 minutes ago, vineyard said:

I never understood what applying to the Chrominance did vs the Luminance.

Just try it. Take a colour image and apply MMT to chrominance in one preview, and color saturation in another. Look at what happens to stars vs the main target. Try with a negative bias on layer 1. In chrominance you can often use a larger bias than in luminance.

  • Thanks 1
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.