Author Topic: New Script: LocalFuzzyHistogramHyperbolization  (Read 10514 times)

FrankW

• PTeam Member
• Newcomer
• Posts: 24
New Script: LocalFuzzyHistogramHyperbolization
« on: 2017 October 03 12:39:09 »
This is my first PI script and at the beginning the implementation was strongly affected by the fact that I am not very familiar with Java. By writing the script I learned a lot about PJSR and PCL but I cannot warrant that there are still some bugs or that the coding fulfills all expectations of a professional programmer. So I would by happy about any feedback on that. However, at the end I am quite happy with the result and want to share it with the community.

The idea to write this script arose after I read an article about image processing using fuzzy logical techniques. The article examined contrast enhancement of medical images but I thought that it is possible to use the same techniques for astronomical images as well. After poking around, I found an algorithm called “Local Fuzzy Histogram Hyperbolization” (LFHH) which becomes the theoretical basis for the script.

Compared to other contrast enhancement methods like Local Histogram Equalization a fuzzy algorithm offers the opportunity to define the profile of the contrast enhancement with the aid of a mathematical function (called fuzzy membership function). By changing the shape of the function the contrast enhancement can be adapted to the individual characteristics of the target image.

To apply the LFHH algorithm to astronomical images effectively, several adjustments were necessary. One main topic was to prevent the stars expanding too much during the process. In the script this can be achieved by using a star mask and it is strongly recommended to use this option. Moreover, the primary algorithm leads to a very strong contrast enhancement. Therefor it was essential to find possibilities to regulate the effect, particularly the impact of the local applying of the algorithm. Special parameters like a clustering of the image segmentation, the definition of lower and upper bounds for the sample values in the segments or the automatic calculation of a segmental intensifier are available to handle this matter. I described the functionality of these parameters in the corresponding mouse-over help of the script.

Like always in the field of image processing, no universal parameters exist. For each image you must find the best parameters fulfilling your individual requirements by trial and error. To give an impression how the script works I attach some examples. The target is a Ha-image of M16. For each of the four membership functions which are implemented in the script I enclose a typical result.

If you have any remarks or questions do not hesitate to contact me.

Cheers,
Frank

Target Image

Gauss/15x15/Clustering 0.05/FHH glb 0.45/FHH lub 0.55/Local FHH beta 1.20/sigma 0.60/HT median 0.23

NormalizedGauss/15x15/Clustering 0.05/FHH glb 0.45/FHH lub 0.55/Local FHH beta 1.10/sigma 0.75/HT median 0.23

Sigmoid/15x15/Clustering 0.05/FHH glb 0.4/FHH lub 0.6/Local FHH beta 1.05/gamma 5.0/x0 0.50/HT median 0.23

Linear/15x15/Clustering 0.05/FHH glb 0.45/FHH lub 0.55/Local FHH beta 1.10/HT median 0.23

... and a combination of the four images
« Last Edit: 2017 October 09 11:27:06 by FrankW »

oldwexi

• PixInsight Guru
• Posts: 625
Re: LocalFuzzyHistogramHyperbolization Script
« Reply #1 on: 2017 October 03 14:26:34 »
Frank!

Excellent!
This works nice with very weak and nearly invisible(on the image)
Molecular clouds also!
The contrast increase is unbelievable.

Thanks a lot!

Gerald

aworonow

• Posts: 254
Re: LocalFuzzyHistogramHyperbolization Script
« Reply #2 on: 2017 October 03 14:38:38 »
Frank,
Looks very interesting and useful. Thanks much. However, although I see a paper clip (meaning an attachment I guess) clicking it does nothing. How do I download the script?

Thanks, AlexW

aworonow

• Posts: 254
Re: LocalFuzzyHistogramHyperbolization Script
« Reply #3 on: 2017 October 03 14:40:22 »
Frank, I found it...at the bottom. Sorry to bother you.
Thanks again, Alex

FrankW

• PTeam Member
• Newcomer
• Posts: 24
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #4 on: 2017 October 04 07:42:45 »
Gerald and Alex,

Frank

dgruber

• Newcomer
• Posts: 11
• Dr. Franz Gruber
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #5 on: 2017 October 06 04:36:44 »
Thank you for your new -  most interesting and useful script -   I postet your News  to  the Austrian PixInsight Facebook-Group.

Fiii

georg.viehoever

• PTeam Member
• PixInsight Jedi Master
• Posts: 2132
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #6 on: 2017 October 09 02:07:35 »
Frank,
do you have a source/citation/paper for the method?
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

FrankW

• PTeam Member
• Newcomer
• Posts: 24
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #7 on: 2017 October 09 07:58:33 »
Georg,

here one Link to a pdf-file:

From the same author you can find several publications about this topic in the internet. He also published a book (in German) about fuzzy image processing.

Frank

Juan Conejero

• PTeam Member
• PixInsight Jedi Grand Master
• Posts: 7027
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #8 on: 2017 October 09 13:42:12 »
Hi Frank,

Congratulations on an excellent implementation of a very interesting and useful algorithm. If you agree, I'd like to include this script in the official distribution. Can you submit it to our open-source GitHub repository?

Do you plan on implementing this tool in C++/PCL?

Thank you so much for this nice contribution to PixInsight.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

FrankW

• PTeam Member
• Newcomer
• Posts: 24
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #9 on: 2017 October 10 05:04:18 »
Hi Juan,

Thank you very much. I’m really delighted that you want to include the script in the official distribution. Of course, I agree to that. The script is submitted to the GitHub repository.

To be honest, I think that currently an implementation of this tool in C++/PCL is beyond my skills and not accordable with my available time. Instead, I would like to write a documentation of the algorithm and the tool. That would complete the whole thing for an integration of the script in PI!

Cheers,
Frank
« Last Edit: 2017 October 10 07:33:29 by FrankW »

FrankW

• PTeam Member
• Newcomer
• Posts: 24
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #10 on: 2017 November 04 05:53:55 »
I have now finished the documentation of the script! Enclosed find a new version of the script which now includes a link to the documentation. The documentation can be downloaded as a pdf here:

https://dl.dropbox.com/s/ixvf7zmlnpu1iz4/LFHH_doc.pdf?dl=1

All relevant files for the use in PixInsight can be downloaded here:

https://dl.dropbox.com/s/pvwzhomnh95hpst/LFHH_doc.zip?dl=1

I tried to submit the files to the GitHub repository but I fear I didn’t get it.  So I would be glad to get some advice how to do this.

Cheers,
Frank

FrankW

• PTeam Member
• Newcomer
• Posts: 24
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #11 on: 2017 November 06 11:23:08 »
I just managed it! Now all files are also available on the GitHub repository:

https://github.com/fweidenbusch/PJSR/tree/LFHH

Cheers,
Frank

Juan Conejero

• PTeam Member
• PixInsight Jedi Grand Master
• Posts: 7027
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #12 on: 2017 November 09 00:56:21 »
Hi Frank,

The script is fantastic and the documentation you have authored in PIDoc is just perfect, great work!

I want to release this script and its documentation as official updates as soon as possible. I'm going to invite you to our official GitHub development team. Your script should be on a PJSR/src/scripts/LocalFuzzyHistogramHyperbolization directory, and the documentation in PIDoc format on Reference-Documentation/scripts/LocalFuzzyHistogramHyperbolization. Please make these changes and submit a pull request to our official open-source repository.

Thank you again for this great contribution.

Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Richard Christy - DarkSky|AP

• Newcomer
• Posts: 25
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #13 on: 2017 November 10 08:19:57 »
Love this script! Excellent works and fantastic documentation to go with it!! Thank you....
Rich Christy

Telescope:
Celestron EdgeHD 8''
Stellarvue SV70T

Camera:
ZWO ASI1600MM-Cool

Filters:
Astrodon Tru-Balance LRGB E-Series Gen2
Astrodon HA, OIII, SII 3nm Narrowband

FrankW

• PTeam Member
• Newcomer
• Posts: 24
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #14 on: 2017 November 12 11:18:48 »
Thanks again for this great feedback!

Thank you, Juan, for your help to tackle my problems with GitHub. I hope that everything is going well now. And a big compliment for the PIDoc Compiler: It is a fantastic tool!