Wavelet Toolbox Previous page   Next Page

Image Conversion

The Image Processing Toolbox provides a comprehensive set of functions that let you easily convert between image types. Should you not have the Image Processing Toolbox, the examples below demonstrate how this conversion may be performed using basic MATLAB commands.

Example 1 - Converting Color Indexed Images

The color bar to the right of the image is not smooth and does not monotonically progress from dark to light. This type of indexed image is not suitable for direct wavelet decomposition with the toolbox and needs to be preprocessed.

First we separate the color indexed image into its RGB components,

Next we convert the RGB matrices into a gray-scale intensity image, using the standard perceptual weightings for the three-color components,

Then, we convert the gray-scale intensity image back to a gray-scale indexed image with 64 distinct levels, and create a new colormap with 64 levels of gray.

The color bar of the converted image is now linear and has a smooth transition from dark to light. The image is now suitable for wavelet decomposition.

Finally, we save the converted image in a form compatible with the Wavelet Toolbox graphical user interface,

Example 2 - Converting an RGB tif-Image.

Suppose the file myImage.tif contains an RGB image (noncompressed) of size S1xS2, you can use the following basic MATLAB commands to convert this image.

The same program can be used to convert bmp or jpeg files.


Previous page  Other Images One-Dimensional Discrete Stationary Wavelet Analysis Next page

© 1994-2005 The MathWorks, Inc.