Author Topic: MultiscaleMedianTransform - Sharpening Example 2  (Read 9833 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
MultiscaleMedianTransform - Sharpening Example 2
« on: 2011 October 31 04:55:16 »
Let's put a more sophisticated example of sharpening and noise reduction working together in the new MultiscaleMedianTransform tool. This requires a more difficult and challenging target, such as this image of the Flatiron building in New York city.


This is a digitized film image. My wife took it on February 2000. She used Kodak E200 slide film developed at 320 ISO (pushed +2) and a Nikon FM2 camera with a 35-85 zoom Nikkor ED lens. I digitized the original slide with a Polaroid SprintScan 35 Plus film scanner in 2001. These were the last years of the good old film days ... many of you probably don't know what I am talking about :)

This image is a difficult target for noise reduction, for several reasons. One of them is that what we have here is film grain. Those of you who have worked extensively with chemical photography know that film grain is in general more difficult to deal with than CCD and DSLR noise, even in cases like this image, where the grain is quite moderate. Another reason is that this image has lots of small-scale structures, some of them high-contrast structures and many others very subtle, which makes detail preservation a difficult task.

Let's begin working on a preview centered at the top of the Flatiron. This is the original image zoomed 2:1:


This is the result of ATrousWaveletTransform with bias set to +0.4 for the second wavelet layer:


+0.4 is a quite hard sharpening. Note that the image is plagued by ringing artifacts. We have mainly bright ringing on the edges of the building and all tree branches projected over the sky. Ringing has also led to total loss of data on many bright regions. This is the typical result of a sharpening algorithm based on linear filtering.

This is the result of MultiscaleMedianTransform with bias applied to the second and third layers:


The bias values have been set to match the overall sharpening effect obtained with ATWT. As expected, there is no ringing and much more data have been preserved on areas where linear high-pass filtering yielded saturated results. Noise amplification is approximately the same with both tools. Can we implement noise reduction and sharpening at the same time with MMT? Sure, this is an attempt working on the lightness component:


Simultaneous noise reduction and local contrast enhancement can be applied with the ATWT and MMT tools in PixInsight. This is precisely one of the strongest points of these tools, since both tasks can be mutually adapted to achieve the required equilibrium. This is not easy at all if sharpening and noise reduction are implemented as separate tasks. Note that our Deconvolution tool successfully implements a similar strategy: regularized deconvolution, where noise is evaluated and removed automatically at each deconvolution iteration to prevent amplification of non-significant structures.

Let's take more perspective. This is the original image shown at its actual resolution:


and here is the same crop after noise reduction + sharpening with MMT:


When it comes to analyze and compare results of several algorithms and tools, it is always a good idea looking closely at different image regions to evaluate their performance for difficult image features. This is a preview zoomed 5:1, original image:


After sharpening with AtrousWaveletTransform:


and after sharpening with MultiscaleMedianTransform:


Now the question is: is MMT the panacea of image processing? Is it the ultimate solution to all noise reduction and sharpening problems? Not at all, since such thing doesn't exist (fortunately, or everything would be sooo boring :) ).

On one hand, MMT's noise reduction performance is excellent and its current implementation is versatile and easy to use, but it is not applicable to all images, and it definitely isn't the best solution for all noise reduction problems. There are images for which other more sophisticated noise reduction algorithms, such as GREYCstoration, are better adapted. This includes images with strong anisotropic features that must be preserved. There are deep-sky images for which you can achieve better results with wavelets and adaptive algorithms such as those implemented in our ACDNR tool, especially for low SNR cases.

As for sharpening, MMT certainly opens new possibilities, chiefly due to the absence of ringing. But MMT has several drawbacks that must be taken into account. While it has no ringing, it can generate artifacts around some image structures. This depends on the shapes of the structuring elements used to apply median filters of growing sizes at successive scales. These filters are applied to compute the coefficients in each transform layer.

In the current version of the MMT tool we have implemented multiway structuring elements (structures consisting of several substructures acting through different spatial orientations) that try to approximate circular shapes accurately. This works very well to preserve isotropy, which is an important property of most astronomical images. However, circular structuring elements have the drawback that they are not very good to preserve some scale invariant image structures, especially sharp corners. In other words, the MMT algorithm, as it has been implemented in PixInsight in this first version of the tool, tends to erode and dilate corners, and this generates some artifacts when a transform layer is biased, especially to achieve strong sharpening effects.

The following screenshot shows a small region of the original image zoomed 8:1. On this area we have tree branches projected over the blue sky. These image structures form intersections, which in turn give raise to corners, where MMT artifacts can be clearly seen in this example.


This is the same area after sharpening with ATWT:


Note the strong bright ringing artifacts. Here is the result of sharpening with MMT:


Can you see the bright blobs close to branch intersections? They are way much better than ringing (IMHO), but the result is not artifact-free ...

No solution can be perfect. However, bear in mind that this is just the first version of the MultiscaleMedianTransform tool. We are working to reduce these problems and to adapt the tool to more working scenarios.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline RBA

  • PixInsight Guru
  • ****
  • Posts: 511
    • DeepSkyColors
Re: MultiscaleMedianTransform - Sharpening Example 2
« Reply #1 on: 2012 January 12 02:01:57 »
Simultaneous noise reduction and local contrast enhancement can be applied with the ATWT and MMT tools in PixInsight. This is precisely one of the strongest points of these tools, since both tasks can be mutually adapted to achieve the required equilibrium. This is not easy at all if sharpening and noise reduction are implemented as separate tasks.

I was looking at this for the first time...

You "apply" NR and bias simultaneously, but in reality, is that how it happens, or is bias applied before NR, internally?