# compute image contrast

I need to get information about contrast of an image, and I compute its value in this way:

contrast=Pmax/Pmin


where Pmax is the pixel of the image with the highest value, an Pmin is the pixel of the image with the lower value.

Is this the correct way, or there is another approach?