4
$\begingroup$

There is an interesting algorithm called contrast enhanced adaptive histogram equalization that does histogram equalization on small segments of an image (and then pastes them back together). I know Mathematica has the HistogramTransform function to do equalization on the whole image. It also has a local method of binarizing, but I don't believe I have seen a local (adaptive) equalization. Has anyone implemented this (or similar) algorithms?

$\endgroup$
  • $\begingroup$ With a 512x512 greyscale image, you could partition and get a binning for all blocks: bins = 256; blocksz = 64; levmap = Map[ N@Accumulate@ImageLevels[#, bins][[All, 2]]/(blocksz^2) &, ImagePartition[img, 64], {2}];. For example levmap[[2,3]] would get a CDF (in list form) of the (2,3) block. Then I presume you interpolate the resulting array and to get CDF's for all pixels. $\endgroup$ – Histograms May 29 '15 at 13:58
  • $\begingroup$ @Histograms This draft of an answer seems promising. Do you think you could complete the process as you described and post it as an answer? $\endgroup$ – MarcoB May 29 '15 at 14:51
  • $\begingroup$ @MarcoB I got something working but I read about it and I don't think it's what bill wants. I was interpolating the cdf histograms themselves, but from reading about it, the interpolation is done on pixel values, not distributions. Best I can offer is ImageAssemble@ Map[HistogramTransform, ImagePartition[img, blocksize], {2}] and then somebody would need to figure out how to interpolate those grey values, I can't work that bit out. $\endgroup$ – Histograms May 29 '15 at 15:30
  • $\begingroup$ @Histograms OK thank you for the update! $\endgroup$ – MarcoB May 29 '15 at 15:31
  • 3
    $\begingroup$ Check the documentation about HistogramTransformInterpolation, section Applications > Locally adaptive histogram equalization. Is this what you're after? $\endgroup$ – shrx May 29 '15 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.