Stretching a histogram to improve the image contrast