Author Topic: MultiscaleMedianTransform Hangs PixInsight  (Read 1145 times)

Offline SkyExplorer

  • Newcomer
  • Posts: 20
MultiscaleMedianTransform Hangs PixInsight
« on: 2020 January 01 15:30:23 »
Over the past few days, I have been using the newest release of PixInsight (1.8.8.3) on Windows, using a stable system that has worked well over the past several years.  I was able to use MMT, with 8 layers, noise reduction, a linear mask and all worked well.  But then I increased the value of adaptive under Noise Reduction to 4 of the 8 layers.  I set layer 5 adaptive to 2, and for layer 6 and 7 adaptive to 3 and layer 8 to 2.  When I do this, my system seems to hang and I have to kill the process.  I have not let it run over night yet, but it churns at 99.5% for a couple of hours before I finally killed it. 

as a test, I opened a clean project and opened an RGB image.  I set the MMT process like above, but I left all the Noise Reduction Adaptive values at zero.  This worked fine.  Then I set layer 5 adaptive to 2.  It did not hang, but ran 30 seconds or so before coming back and the process console only popped out at the very end.    Then I set layer 6 adaptive to 3 and this time, it took several minutes before it came back.  Again, the process console pops out only at the very end. 

So it appears as I add more layers using adaptive and/or increase the value of adaptive, it takes longer and longer.  And I did not keep going, but at some point, once I set adaptive on layers 7 and 8, it takes hours and I assume it will never come back. 

I have never set a value for adaptive before, so this may not be a new "problem".  But since I just ran into it, I thought I would share to verify this is known to requires a LOT more time as you increase the number of layers with a non-zero value for adaptive or increase the value of adaptive itself. 

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: MultiscaleMedianTransform Hangs PixInsight
« Reply #1 on: 2020 January 02 02:57:24 »
The local adaptive noise reduction (LANR) algorithm implemented in the MultiscaleMedianTransform tool is intended to remove small-scale, isolated structures that survive after threshold-based noise reduction. LANR only makes sense for relatively small transform scales, say from layers 1 to 4, maybe up to layer 5 or 6 in very special cases, in a dyadic scheme.

Unfortunately, LANR's time complexity is dominated by the square of its filter size, so its running times grow quadratically with layer scales in MMT. Above the scale of 32 pixels, it can take a very long time to complete, and for scales of 128 pixels or larger, it can take forever even on fast hardware. I'll disable adaptive noise reduction for scales > 32 pixels in the next version of the MMT tool to prevent these potential performance issues. Anyway, if you don't use the adaptive noise reduction parameter of MMT for larger scales (because it does not make sense), there are no problems.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline SkyExplorer

  • Newcomer
  • Posts: 20
Re: MultiscaleMedianTransform Hangs PixInsight
« Reply #2 on: 2020 January 03 09:43:45 »
Thank you very much for your reply.  It would be fine if you add a sentence to the context help for Adaptive:

"Warning: System will be unresponsive for adaptive noise reduction scales above 32"