Contrast stretching and histogram equalization

Contrast stretching: do min max contrast stretching of the image. Find the minimum and maximum values of the pixels in an image, and then convert pixels from the source to destination like ((pixel – min) / (max – min))*255.

Contrast stretching source

Histogram equalization, as described here: http://en.wikipedia.org/wiki/Histogram_equalization

Histrogram equalization source