IMAGE_CONTRAST
Enhance Contrast in an Image


IMAGE_CONTRAST is a MATLAB function which carries out a simple contrast enhancement operation on an image.

Note that MATLAB's image processing toolbox includes a functions such as nlfilter which can do a more sophisticated treatment of images. But the purpose of this example is to demonstrate the process of image enhancement in a way that is clear enough to understand quickly.

For a gray-scale image, the function has the form:

function gray_enhanced = contrast_gray ( gray, s )
where

The corresponding function contrast_rgb() operates on RGB images.

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Related Data and Programs:

CONTRAST_SPMD, a MATLAB program which demonstrates the SPMD parallel programming feature for a image operations; the client reads an image, the workers process portions of it to enhance the contrast, and the client assembles and displays the results.

CONTRAST2_SPMD, a MATLAB program which demonstrates the SPMD parallel programming feature for image operations; this improves the contrast_spmd program by allowing the workers to share some data; this makes it possible to eliminate artificial "seams" in the processed image.

IMAGE_COMPONENTS, a MATLAB library which seeks the connected "nonzero" or "nonblack" components of an image or integer vector, array or 3D block.

IMAGE_DENOISE, a MATLAB program which demonstrates a simple technique for removing noise from an image.

IMAGE_EDGE a MATLAB library which demonstrates a simple procedure for edge detection in images.

IMAGE_NOISE, MATLAB programs which add noise to an image.

IMAGE_QUANTIZATION, a MATLAB library which demonstrates how the KMEANS algorithm can be used to reduce the number of colors or shades of gray in an image.

IMAGE_RGB_TO_GRAY, MATLAB programs which makes a grayscale version of an RGB image.

IMAGE_THRESHOLD, MATLAB programs which make a black and white version of a grayscale image by setting all pixels below or above a threshold value to black or white.

Reference:

MathWorks documentation for the Image Processing Toolbox is available at http://www.mathworks.com/access/helpdesk/help/pdf_doc/images/images_tb.pdf.

Source Code:

Examples and Tests:

SURFSUP is a grayscale image.

UNDERWATER_BMX is an RGB image. Note that attempts to increase the blurriness of this image using a value of S less than 1 didn't seem to have much effect.

You can go up one level to the MATLAB source codes.


Last revised on 25 December 2010.