# CLAHE implementation on ITK

**URL:** https://discourse.itk.org/t/clahe-implementation-on-itk/4486
**Category:** Uncategorized
**Created:** [October 8, 2021, 4:35pm UTC](https://discourse.itk.org/t/clahe-implementation-on-itk/4486 "2021-10-08T16:35:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![diaferiaroberta](https://discourse.itk.org/user_avatar/discourse.itk.org/diaferiaroberta/32/2320_2.png) [@diaferiaroberta](https://discourse.itk.org/u/diaferiaroberta)
#### Post date: [October 8, 2021, 4:35pm UTC](https://discourse.itk.org/t/clahe-implementation-on-itk/4486/1 "2021-10-08T16:35:47Z")

</div>

There is a way to use the Karel Zuiderveld CLAHE algorithm on ITK? The only available function is itk::AdaptiveHistogramEqualizationImageFilter, but for my image has poor results. I’m working with an image that has double precision pixels.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [October 8, 2021, 6:53pm UTC](https://discourse.itk.org/t/clahe-implementation-on-itk/4486/2 "2021-10-08T18:53:45Z")

</div>

Welcome Roberta! There is a higher chance of getting an answer here. However, please refrain from [double-posting](https://stackoverflow.com/questions/69498861/clahe-for-floating-point-pixels-in-c-opencv-or-itk/). I saw the SO question first.

---

<div class="post-metadata">

### Author: ![diaferiaroberta](https://discourse.itk.org/user_avatar/discourse.itk.org/diaferiaroberta/32/2320_2.png) [@diaferiaroberta](https://discourse.itk.org/u/diaferiaroberta)
#### Post date: [October 9, 2021, 12:40am UTC](https://discourse.itk.org/t/clahe-implementation-on-itk/4486/3 "2021-10-09T00:40:22Z")

</div>

Unfortunately adaptive histogram equalization in itk produces a poor result. I need a function similar to matlab or opencv in which i can set clip limit and grid size

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [October 27, 2021, 3:16pm UTC](https://discourse.itk.org/t/clahe-implementation-on-itk/4486/4 "2021-10-27T15:16:54Z")

</div>

Hi,

There is a preliminary ITK CLAHE implementation here:

> <https://github.com/yzxyzh/itk-clahe/blob/master/ClaheImageFilter.h>

It is also worth looking at improvements in the implementation in Fiji.

These could be refactored into an [ITK remote module](https://github.com/InsightSoftwareConsortium/ITKModuleTemplate) for CI testing infrastructure, wrapped Python binary generation, etc.
