[ITK] [ITK-users] HistogramEqualization in ITK

Francois Budin francois.budin at kitware.com
Thu Apr 13 09:12:23 EDT 2017


Correction on the last line of what I sent:
    itk.ImageFileWriter.New(myFilter,FileName=filename).Update()

On Thu, Apr 13, 2017 at 9:06 AM, Francois Budin <francois.budin at kitware.com>
wrote:

> 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
>
> On Thu, Apr 13, 2017 at 8:25 AM, wangtaoiz <wangtao_ at sjtu.edu.cn> wrote:
>
>> Dear all
>>   I want to use itk::AdaptiveHistogramEqualizationImageFilter to do a
>> HistogramEqualization filter on a image as follow:
>> <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
>> follow:
>> <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
>> opencv cvEqualizeHist() function):
>> <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
>>
>> 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
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20170413/b192c165/attachment.html>
-------------- next part --------------
_____________________________________
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


More information about the Community mailing list