Author Topic: New Tool: AdaptiveStretch  (Read 4889 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 5811
    • View Profile
    • http://pixinsight.com/
New Tool: AdaptiveStretch
« on: 2012 June 09 12:58:43 »
Hi everybody,

I am pleased to announce that today we have released a new tool: AdaptiveStretch. This new tool is now available to all PixInsight users as an update for all supported platforms.

AdaptiveStretch is a general contrast and brightness manipulation tool in PixInsight. It implements a nonlinear intensity transformation computed from existing pairwise pixel differences in the target image. The process can be controlled through a single noise threshold parameter. Basically, brightness differences below the noise threshold are regarded as due to the noise and other spurious variations, and are thus attenuated or not enhanced. Brightness differences above the noise threshold are interpreted as significant changes in the image, so the process tends to enhance them. The reference documentation for AdaptiveStretch is now available online:

http://pixinsight.com/doc/tools/AdaptiveStretch/AdaptiveStretch.html

and of course we also have released it as an update.

The basic algorithm has been described by Maria and Costas Petrou. [1] This elegant algorithm has been implemented by PTeam member Carlos Milovic, who has made important and clever modifications to make it more efficient and versatile. Carlos has done a very nice work in the core implementation of this tool. I have revised Carlos' original implementation to optimize and parallelize all processes, and have designed and written the tool's user interface. We have introduced important new features in the interface of this tool, such as auxiliary tool windows (slave interfaces) and real-time graph generation, which we'll exploit in future versions of existing and new tools, starting from PI version 1.8.

Despite the fact that this tool seems a very simple one---it is basically a one-parameter process after all---, its simplicity is only apparent. This little tool can teach you more about the dynamics of your images than some popular, ubiquitously used applications. Enjoy!

[1] Maria Petrou and Costas Petrou, Image Processing: The Fundamentals, Second Edition, John Wiley and Sons Ltd., 2010, pp. 377–382.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2092
    • View Profile
Re: New Tool: AdaptiveStretch
« Reply #1 on: 2012 June 09 13:28:32 »
Cool tool. First experiments show nice results.

On my Win7-x64 computer, the noise threshold slider does not follow mouse movements well when the Realtime Preview is opened. Also the Real-Time curve preview does not respond if the realtime preview is not activated.

Georg

PS: Nice to see it is released at the same time as the documentation  :)
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Enzo De Bernardini

  • PTeam Member
  • PixInsight Addict
  • ***
  • Posts: 250
  • Resistance is futile.
    • View Profile
    • Astronomí­a Sur
Re: New Tool: AdaptiveStretch
« Reply #2 on: 2012 June 09 19:27:30 »
Nice...!  :D

I did some tests with daylight images, with interesting results. Thanks!

Enzo.

Offline pfile

  • PTeam Member
  • PixInsight Jedi Council Member
  • *******
  • Posts: 3129
    • View Profile
Re: New Tool: AdaptiveStretch
« Reply #3 on: 2012 June 11 03:45:47 »
this is a great tool! would you consider this as masked stretch on steroids?

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2164
  • Join the dark side... we have cookies
    • View Profile
    • http://www.astrophoto.cl
Re: New Tool: AdaptiveStretch
« Reply #4 on: 2012 June 11 04:30:06 »
No ;) But it is the big brother of histogram equalization :)
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline pfile

  • PTeam Member
  • PixInsight Jedi Council Member
  • *******
  • Posts: 3129
    • View Profile
Re: New Tool: AdaptiveStretch
« Reply #5 on: 2012 June 11 17:14:22 »
i see. i just ask because masked stretch should protect lower SNR areas of the image, which is what this seems to do.

would you suggest this tool to do the initial stretch of linear data or would you use it later in the flow?

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 5811
    • View Profile
    • http://pixinsight.com/
Re: New Tool: AdaptiveStretch
« Reply #6 on: 2012 June 11 18:10:36 »
Quote
would you suggest this tool to do the initial stretch of linear data or would you use it later in the flow?

It's a general contrast manipulation tool, so it can be used anywhere in the workflow. However, this tool only makes sense for images that have brightness/contrast problems, such as linear images, or wrongly exposed images.

Once you get the hang of it, AdaptiveStretch is terrific to perform the initial stretch of most raw images. It is just a different, more objective way to understand and implement this task. Just try it and see if you like the results!
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 5811
    • View Profile
    • http://pixinsight.com/
Re: New Tool: AdaptiveStretch
« Reply #7 on: 2012 June 11 18:17:13 »
Hi Georg,

Thanks! :)

Quote
On my Win7-x64 computer, the noise threshold slider does not follow mouse movements well when the Realtime Preview is opened.

The AdaptiveStretch task is quite intensive, so a beefy machine really helps. However, it's true that slider controls are less than ideal to implement real-time adjustments. This is due to the way sliders generate interface events. I am considering replacing these sliders with custom controls. For example, something similar to ScreenTransferFunction.

Quote
Also the Real-Time curve preview does not respond if the realtime preview is not activated.

This is by design. The curve does not exist unless you apply the algorithm to an image, since the algorithm is an adaptive one. When the real-time preview function is disabled, the curve graph simply displays the latest computed curve.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline pfile

  • PTeam Member
  • PixInsight Jedi Council Member
  • *******
  • Posts: 3129
    • View Profile
Re: New Tool: AdaptiveStretch
« Reply #8 on: 2012 June 11 19:12:20 »
Quote
would you suggest this tool to do the initial stretch of linear data or would you use it later in the flow?

It's a general contrast manipulation tool, so it can be used anywhere in the workflow. However, this tool only makes sense for images that have brightness/contrast problems, such as linear images, or wrongly exposed images.

Once you get the hang of it, AdaptiveStretch is terrific to perform the initial stretch of most raw images. It is just a different, more objective way to understand and implement this task. Just try it and see if you like the results!

thanks. the question came up in my mind because right after the release i used AS to stretch the linear version of an image i had previously processed with MS and HT, and was pleased with the results. but then this morning i tried to use it to stretch a new image (M101) and completely failed. i started wondering if the first time i had been working with data which had already been stretched (long story - could not save a project and ended up saving the individual files.) my computer crashed overnight so now the AS test i was working on is gone, and i can't check.

so, i started wondering if this tool could be used for such a 'radical' stretch. i guess the answer is yes, so i'm not sure what i messed up the 2nd time.