Change the procedure of histogram equalization