Understanding histogram equalizer