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

Offline FrankW

  • Newcomer
  • Posts: 4
    • View Profile
New Script: LocalFuzzyHistogramHyperbolization
« on: 2017 October 03 19: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 18:27:06 by FrankW »

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 530
    • View Profile
    • Astronomy Pages G.W.
Re: LocalFuzzyHistogramHyperbolization Script
« Reply #1 on: 2017 October 03 21: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

Offline aworonow

  • PixInsight Addict
  • ***
  • Posts: 153
    • View Profile
Re: LocalFuzzyHistogramHyperbolization Script
« Reply #2 on: 2017 October 03 21: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

Offline aworonow

  • PixInsight Addict
  • ***
  • Posts: 153
    • View Profile
Re: LocalFuzzyHistogramHyperbolization Script
« Reply #3 on: 2017 October 03 21:40:22 »
Frank, I found it...at the bottom. Sorry to bother you.
Thanks again, Alex

Offline FrankW

  • Newcomer
  • Posts: 4
    • View Profile
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #4 on: 2017 October 04 14:42:45 »
Gerald and Alex,

Thanks for your feedback!

Frank

Offline dgruber

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

https://www.facebook.com/groups/565816306913779/

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2105
    • View Profile
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #6 on: 2017 October 09 09: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)

Offline FrankW

  • Newcomer
  • Posts: 4
    • View Profile
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #7 on: 2017 October 09 14:58:33 »
Georg,

here one Link to a pdf-file:

https://www.researchgate.net/profile/Hamid_Tizhoosh/publication/285413959_Fuzzy_Histogram_Hyperbolization_for_Image_Enhancement/links/565e0f6d08aefe619b26ed1a/Fuzzy-Histogram-Hyperbolization-for-Image-Enhancement.pdf

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

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6008
    • View Profile
    • http://pixinsight.com/
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #8 on: 2017 October 09 20: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/

Offline FrankW

  • Newcomer
  • Posts: 4
    • View Profile
Re: New Script: LocalFuzzyHistogramHyperbolization
« Reply #9 on: 2017 October 10 12: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 14:33:29 by FrankW »