Discussion:
[ITK-users] HistogramEqualization in ITK
wangtaoiz
2017-04-13 12:25:37 UTC
Permalink
Dear all
I want to use itk::AdaptiveHistogramEqualizationImageFilter to do a
HistogramEqualization filter on a image as follow:
<Loading Image...>
So I set the parameters SetAlpha(0.5), SetBeta(0.5), the result is as
follow:
<Loading Image...>
but actually the result I want is showed as follow (which is generated by
opencv cvEqualizeHist() function):
<Loading Image...>
So I want to ask you if I can get that HistogramEqualization result by ITK?

Thanks a lot
Wang



--
View this message in context: http://itk-users.7.n7.nabble.com/HistogramEqualization-in-ITK-tp38108.html
Sent from the ITK - Users mailing list archive at Nabble.com.
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
Lowekamp, Bradley (NIH/NLM/LHC) [C]
2017-04-13 13:00:28 UTC
Permalink
Hello,

You need to read and study the two algorithms closer. There is a referenced paper in the ITK documentation[1].

You should also look into the HistogramMatchingImageFilter [2].

HTH,
Brad

[1] https://itk.org/Doxygen/html/classitk_1_1AdaptiveHistogramEqualizationImageFilter.html
[2] https://itk.org/Doxygen/html/classitk_1_1HistogramMatchingImageFilter.html
Post by wangtaoiz
Dear all
I want to use itk::AdaptiveHistogramEqualizationImageFilter to do a
<http://itk-users.7.n7.nabble.com/file/n38108/snipaste20170413_200959.png>
So I set the parameters SetAlpha(0.5), SetBeta(0.5), the result is as
<http://itk-users.7.n7.nabble.com/file/n38108/snipaste20170413_201446.png>
but actually the result I want is showed as follow (which is generated by
<http://itk-users.7.n7.nabble.com/file/n38108/snipaste20170413_201132.png>
So I want to ask you if I can get that HistogramEqualization result by ITK?
Thanks a lot
Wang
--
View this message in context: http://itk-users.7.n7.nabble.com/HistogramEqualization-in-ITK-tp38108.html
Sent from the ITK - Users mailing list archive at Nabble.com.
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.kitware.com/products/protraining.php
http://www.itk.org/Wiki/ITK_FAQ
http://public.kitware.com/mailman/listinfo/insight-users
_______________________________________________
Community mailing list
http://public.kitware.com/mailman/listinfo/community
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
Francois Budin
2017-04-13 13:06:39 UTC
Permalink
Hello Wang,

One good way to explore the parameters to figure out which set gives you
the result you want would be to write a short Python script:
reader=itk.ImageFileReader[itk.Image[itk.UC,2]].New(FileName="/home/fbudin/Downloads/chest.png")
myFilter=itk.AdaptiveHistogramEqualizationImageFilter.New(reader)
for alpha in range(0,11):
for beta in range(0,11):
myFilter.SetAlpha(alpha*.1)
myFilter.SetBeta(beta*.1)
filename="/tmp/myFilter"+str(alpha)+"_"+str(beta)+".png"
itk.ImageFileWriter.New(hm,FileName=filename).Update()

I was not able to generate an image that looked exactly like the "opencv"
image you sent, but that may be due to:
-The implementation of this algorithm in OpenCV is different
-The difference of the output is only due to different visualization
parameters (Window/Level settings that are different for the different
images).

Hope this helps,
Francois
Post by wangtaoiz
Dear all
I want to use itk::AdaptiveHistogramEqualizationImageFilter to do a
<http://itk-users.7.n7.nabble.com/file/n38108/snipaste20170413_200959.png>
So I set the parameters SetAlpha(0.5), SetBeta(0.5), the result is as
<http://itk-users.7.n7.nabble.com/file/n38108/snipaste20170413_201446.png>
but actually the result I want is showed as follow (which is generated by
<http://itk-users.7.n7.nabble.com/file/n38108/snipaste20170413_201132.png>
So I want to ask you if I can get that HistogramEqualization result by ITK?
Thanks a lot
Wang
--
View this message in context: http://itk-users.7.n7.nabble.
com/HistogramEqualization-in-ITK-tp38108.html
Sent from the ITK - Users mailing list archive at Nabble.com.
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.kitware.com/products/protraining.php
http://www.itk.org/Wiki/ITK_FAQ
http://public.kitware.com/mailman/listinfo/insight-users
Francois Budin
2017-04-13 13:12:23 UTC
Permalink
Correction on the last line of what I sent:
itk.ImageFileWriter.New(myFilter,FileName=filename).Update()
Post by Francois Budin
Hello Wang,
One good way to explore the parameters to figure out which set gives you
reader=itk.ImageFileReader[itk.Image[itk.UC,2]].New(
FileName="/home/fbudin/Downloads/chest.png")
myFilter=itk.AdaptiveHistogramEqualizationImageFilter.New(reader)
myFilter.SetAlpha(alpha*.1)
myFilter.SetBeta(beta*.1)
filename="/tmp/myFilter"+str(alpha)+"_"+str(beta)+".png"
itk.ImageFileWriter.New(hm,FileName=filename).Update()
I was not able to generate an image that looked exactly like the "opencv"
-The implementation of this algorithm in OpenCV is different
-The difference of the output is only due to different visualization
parameters (Window/Level settings that are different for the different
images).
Hope this helps,
Francois
Post by wangtaoiz
Dear all
I want to use itk::AdaptiveHistogramEqualizationImageFilter to do a
<http://itk-users.7.n7.nabble.com/file/n38108/snipaste20170413_200959.png
So I set the parameters SetAlpha(0.5), SetBeta(0.5), the result is as
<http://itk-users.7.n7.nabble.com/file/n38108/snipaste20170413_201446.png
but actually the result I want is showed as follow (which is generated by
<http://itk-users.7.n7.nabble.com/file/n38108/snipaste20170413_201132.png
So I want to ask you if I can get that HistogramEqualization result by ITK?
Thanks a lot
Wang
--
View this message in context: http://itk-users.7.n7.nabble.c
om/HistogramEqualization-in-ITK-tp38108.html
Sent from the ITK - Users mailing list archive at Nabble.com.
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.kitware.com/products/protraining.php
http://www.itk.org/Wiki/ITK_FAQ
http://public.kitware.com/mailman/listinfo/insight-users
Loading...