Corrects the histogram calculation so it doesn't sweep only the same area.