Author Topic: New Tool: MultiscaleMedianTransform  (Read 16490 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
New Tool: MultiscaleMedianTransform
« on: 2011 October 30 16:58:05 »
Hi all,

Since the first versions of PixInsight, which we published back in 2004, we have pioneered the application of multiscale analysis algorithms and processing techniques to astrophotography. First we released the ATrousWaveletTransform tool (ATWT), which has seen two major releases so far (the first version is still available as ATrousWaveletTransformV1 under the Compatibility category). Later we released the HDRWaveletTransform tool (HDRWT), implementing a dynamic range compression algorithm designed by PTeam member Vicent Peris. As all of you know well, ATWT and HDRWT are extremely powerful and versatile PixInsight tools. Along with these tools, multiscale techniques pervade almost everything in PixInsight: from noise evaluation routines to mask generation, dark frame optimization and object detection.

Today I am glad to announce that we have implemented another multiscale processing algorithm in PixInsight: the Multiscale Median Transform (MMT) algorithm. The new MultiscaleMedianTransform tool, which you'll receive tomorrow as an update for all supported platforms, is the result of an intense research and development work that we have been undergoing during the last months.

MMT has properties and features that create new and exciting possibilities. We'll try to show you some of these properties and their practical application to image processing in several examples that we'll publish on this forum. We hope you'll like and enjoy the new tools that we are about to release.

References:

Jean-Luc Starck, Fionn Murtagh and Jalal M. Fadili, Sparse Image and Signal Processing: Wavelets, Curvelets, Morphological Diversity, Cambridge University Press, 2010.

Jean-Luc Starck, Fionn Murtagh and Albert Bijaoui, Image Processing and Data Analysis: The Multiscale Approach, Cambridge University Press, 1998.



« Last Edit: 2011 October 30 18:05:10 by Juan Conejero »
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Enzo De Bernardini

  • PTeam Member
  • PixInsight Addict
  • ***
  • Posts: 274
  • Resistance is futile.
    • Astronomí­a Sur
Re: New Tool: MultiscaleMedianTransform
« Reply #1 on: 2011 October 30 21:06:43 »
Always growing and innovating. Sounds great!. Thanks for your hard work! :D

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: New Tool: MultiscaleMedianTransform
« Reply #2 on: 2011 October 31 00:15:38 »
Quote
Always growing and innovating.

That's PixInsight :) Thanks Enzo!
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Daniel_Guetl

  • Newcomer
  • Posts: 11
  • Amateur Astrophotographer and CCD Enthusiast
    • Astrostyria
Re: New Tool: MultiscaleMedianTransform
« Reply #3 on: 2011 October 31 01:38:06 »
Very Nice. Will buy the full version soon :) After just a few days of use, PixInsight has displaced photoshop...

Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: New Tool: MultiscaleMedianTransform
« Reply #4 on: 2011 October 31 12:44:36 »
Hi

More excellent stuff , that I will have to learn  :-*

Harry
Harry Page

Offline RBA

  • PixInsight Guru
  • ****
  • Posts: 511
    • DeepSkyColors
Re: New Tool: MultiscaleMedianTransform
« Reply #5 on: 2011 November 01 09:50:23 »
Jean-Luc Starck, Fionn Murtagh and Jalal M. Fadili, Sparse Image and Signal Processing: Wavelets, Curvelets, Morphological Diversity, Cambridge University Press, 2010.

Jean-Luc Starck, Fionn Murtagh and Albert Bijaoui, Image Processing and Data Analysis: The Multiscale Approach, Cambridge University Press, 1998.

Good taste in your sources/references!  ;)


Offline Ginge

  • PixInsight Addict
  • ***
  • Posts: 215
Re: New Tool: MultiscaleMedianTransform
« Reply #6 on: 2011 November 01 16:08:20 »
Really looking forward to trying this module out, looks exciting. Thanks for inventing!

Ginge

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: New Tool: MultiscaleMedianTransform
« Reply #7 on: 2011 November 02 06:21:58 »
Hi Juan,
two questions:
  • how is MultiscaleMedianTransform related to Deconvolution. Does it achieve its result by assuming some PSF (point spread function)? Or is it useful for a different kind of blurring only?
  • Short of buying the books: Do you have a reference on the WWW that helps to understand what is going on in this module?
I like to understand things...
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: New Tool: MultiscaleMedianTransform
« Reply #8 on: 2011 November 02 08:57:58 »
Quote
how is MultiscaleMedianTransform related to Deconvolution. Does it achieve its result by assuming some PSF (point spread function)? Or is it useful for a different kind of blurring only?

MMT does not use a PSF or any similar information about the image. It is a mathematical construct similar to a wavelet transform or a Fourier transform. As the wavelet transform, the MMT decomposes the image into a set of detail layers plus a residual layer, following a scaling sequence that, unlike the WT, can be arbitrary or even an irregular sequence (the WT is only defined to use  a dyadic sequence).

MMT is useful for two types of tasks:

- Image sharpening. This is achieved by multiplying all coefficients in one or more transform layers by a constant k > 1. For this task the MMT is well suited for sharpening at small scales. It does not work correctly at medium and large scales due to accumulated changes in the morphology of large-scale structures. Two of MMT's properties make it particularly well suited for this task: it does not generate ringing artifacts, and it is able to isolate small-scale structures within a single layer. Note that the wavelet transform does not have any of these properties.

- Image denoising. This is achieved by thresholding the coefficients in one or more layers and multiplying nonsignificant coefficients by a constant 0 <= k < 1. The MMT is very good at this task due to the second property I mentioned above: its ability to isolate small-scale structures within a single layer. In our implementation we have added a local adaptive noise reduction filter to remove small-scale noise structures that cannot be selected by thresholding (outliers).

Quote
Do you have a reference on the WWW that helps to understand what is going on in this module?

Fortunately the second reference that I gave is fully available online:

http://www.multiresolution.com/cupbook.html

On the page above you can download free PDF versions of the first two books by Starck et al. (they are preprint versions but the differences with the printed books are just cosmetic). Download the first book (Image Processing and Data Analysis: The Multiscale Approach) and jump to section 1.5 (page 45), where you have the multiresolution median transform (which we prefer to call multiscale instead of multiresolution) described. In theory it is a very simple algorithm, but a useful implementation is not.

In our implementation we have introduced several changes:

* The median filter cannot be implemented with a square structuring element. Such a naive implementation has very little applicability in practice. The reason is simple: with a square structure we generate artifacts around every image structure that does not look like a perfect square. The ideal structure for any kind of images, but especially for most astronomical images, is a perfect circle. However we have two problems:

1. We cannot represent a circle accurately with small kernels of 3, 5 and 7 pixels. Not below 11 or 13 pixels we can start achieving reasonable renditions of circular structures. Our solution has been using multiway structuring elements. A multiway structure consists of two or more substructures that apply a morphological operator with specific spatial orientations and shapes. The result is the same operator applied to the partial results from each substructure. After some experimentation work we have been able to approximate circles quite well with just two ways, even for 3x3 filters. We still have to explore this in more depth, though, and I hope future versions of this tool will be much better in this regard.

2. Arbitrarily shaped, multiway structuring elements cannot be applied, to our knowledge, using accelerated median filtering algorithms. We are restricted to naive O(n^2*N) nonseparable implementations to apply median filters with accurate control over the shapes of the structures.

* Note that problem #2 above leads to an impractical implementation even for moderate filter sizes of about 15x15 elements. For 25x25 and larger filters the exponential growth of calculation times makes this task unmanageable. For this reason we have modified the algorithm to include decimation: the image is downsampled successively at growing scales to keep the size of the median filter constant. However, again this is a naive approach that does not work for a practical implementation: if we reduce the image to compute small scales (say scales below 8 pixels), then interpolation errors and ringing induced by interpolation kill us completely. In our implementation, we don't reduce the image until the required median filter has more than 11 elements. For structures up to 11x11 we use accurate multiway median filters, and starting from 13 elements and above we downsample the image proportionally to use a 9x9 structure, apply the median filter, and upsample the filtered image to its original dimensions, so the transform is still redundant at a high level. To reduce interpolation errors we use Mitchell-Netravali cubic filter interpolation for size reduction and cubic spline interpolation for upsampling. Interpolation contaminates the algorithm with a small amount of convolution (=ringing), but this only happens at relatively large scales and its effect is negligible in general. Again, we'll improve this part of our implementation in future versions.

You said you want to know... :)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline zvrastil

  • PixInsight Addict
  • ***
  • Posts: 179
    • Astrophotography
Re: New Tool: MultiscaleMedianTransform
« Reply #9 on: 2011 December 01 12:14:21 »
Today, I used MMT for noise reduction for the first time to do "real work" on my recent image (before, I just played with it a little). I must say that it left me speechless. Its noise reduction performance is absolutely stunning. Even with default parameter values, it was able to remove noise at both small and large scales without affecting stars or structures a bit. And in contrast to ACDNR, it really felt like removing noise for given layer, instead just moving it to larger dimensional scales.
Excellent job - which is usual in PI, but this time, great power comes together with ease of use. Thank you very much for this tool.

Zbynek

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: New Tool: MultiscaleMedianTransform
« Reply #10 on: 2011 December 01 16:25:48 »
Thank you a lot Zbynek, I'm glad to know that. The next step is a combined wavelet-median transform which Starck describes in his latest book (Sparse Image and Signal Processing). It rocks! :)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline RBA

  • PixInsight Guru
  • ****
  • Posts: 511
    • DeepSkyColors
Re: New Tool: MultiscaleMedianTransform
« Reply #11 on: 2011 December 02 09:58:51 »
Thank you a lot Zbynek, I'm glad to know that. The next step is a combined wavelet-median transform which Starck describes in his latest book (Sparse Image and Signal Processing). It rocks! :)

It's a very sweet tool. Why didn't you think of it earlier?  ;)
Thanks for continuing giving us professional grade image processing tools to process our very humble images.

That Jean-Luc guy is a sharp fellow!


Offline RobF2

  • PixInsight Addict
  • ***
  • Posts: 189
  • Rob
    • Rob's Astropics
Re: New Tool: MultiscaleMedianTransform
« Reply #12 on: 2011 December 02 19:36:59 »
Hmm, I wonder if this is why Juan has been fretting at all the work we've all been demanding on documentation.  When there's exciting new tools like this close to release beckoning for programming and attention, who wants to be writing docs.... :footinmouth:   :)

Can't wait to get into this one - sounds like something I might use on any decent dataset.
FSQ106/8" Newt on NEQ6/HEQ5Pro via EQMOD | QHY9 | Guiding:  ZS80II/QHY5IIL | Canon 450D | DBK21 and other "stuff"
Rob's Astropics

Offline RobF2

  • PixInsight Addict
  • ***
  • Posts: 189
  • Rob
    • Rob's Astropics
Re: New Tool: MultiscaleMedianTransform
« Reply #13 on: 2011 December 02 19:41:12 »
Umm, pardon my current ignorance, but this looks like a cut down version of ATWT in many ways?
FSQ106/8" Newt on NEQ6/HEQ5Pro via EQMOD | QHY9 | Guiding:  ZS80II/QHY5IIL | Canon 450D | DBK21 and other "stuff"
Rob's Astropics

Offline RBA

  • PixInsight Guru
  • ****
  • Posts: 511
    • DeepSkyColors
Re: New Tool: MultiscaleMedianTransform
« Reply #14 on: 2011 December 02 19:58:07 »
Umm, pardon my current ignorance, but this looks like a cut down version of ATWT in many ways?

I'm sure Juan can explain it in much better terms, and maybe even correct what I'm about to say, but just because the interface looks similar doesn't mean it's a toned down version of ATWT, rather a different way to do multiscale decomposition and so on. Instead of using wavelet transforms, it uses a median transform, which offers some advantages (and disadvantages) over WTs, in particular the absence of certain artifacts that are unavoidable when doing WTs, "better" smoothing, etc.