Image Processing Toolbox User's Guide Previous page   Next Page

Example 1 -- Some Basic Concepts

This example introduces some basic image processing concepts, including reading and writing images, performing histogram equalization on an image, and getting information about an image. The example breaks this process into the following steps:

Step 1:
Read and display an image
Step 2:
Check how the image appears in the workspace
Step 3:
Improve image contrast
Step 4:
Write the image to a disk file
Step 5:
Get information about a graphics file

Before beginning with this example, you should already have installed the Image Processing Toolbox and have started MATLAB. If you are new to MATLAB, read the MATLAB Getting Started documentation to learn about basic MATLAB concepts.

1. Read and Display an Image

Clear the MATLAB workspace of any variables and close open figure windows.

To read an image, use the imread command. The example reads one of the sample images included with the Image Processing Toolbox, pout.tif, and stores it in an array named I.

imread infers from the file that the graphics file format is Tagged Image File Format (TIFF). For the list of supported graphics file formats, see the imread function reference documentation.

Now display the image. The toolbox includes two image display functions: imshow and imtool. imshow is the toolbox's fundamental image display function. imtool starts the Image Tool which presents an integrated environment for displaying images and performing some common image processing tasks. The Image Tool provides all the image display capabilities of imshow but also provides access to several other tools for navigating and exploring images, such as scroll bars, the Pixel Region tool, Image Information tool, and the Contrast Adjustment tool. For more information, see Displaying and Exploring Images..

You can use either function to display an image. This example uses imshow.

Grayscale Image pout.tif

Previous page  What Is the Image Processing Toolbox? 2. Check How the Image Appears in the Workspace Next page

© 1994-2005 The MathWorks, Inc.