Aim: To study reading, displaying and visualization of images.
Problem Statement: (a) Read and display different types of images.
(b) Convert the image types and image classes.
Software: MATLAB (R2008a).
MATLAB provides various tools for image processing. For reading, displaying and visualization
of images, we can use following commands:
Read image from graphics file.
Syntax A = imread(filename, fmt)
A = imread(filename, fmt) reads a grayscale or color image from the file
specified by the string filename. If the file is not in the current directory, or in a directory
on the MATLAB path, specify the full pathname. The text string fmt specifies the format
of the file by its standard file extension. For example, specify 'gif' for Graphics
Interchange Format files. To see a list of supported formats, with their file extensions, use
the imformats function. If imread cannot find a file named filename, it looks for a file
Display the image.
imshow(I) displays the grayscale image I.
imshow(I,[low high]) displays the grayscale image I, specifying the display range for I in
[low high]. The value low (and any value less than low) displays as black; the value high
(and any value greater than high) displays as white. Values in between are displayed as
intermediate shades of gray, using the default number of gray levels. If you use an empty
matrix () for [low high], imshow uses [min(I(:)) max(I(:))]; that is, the minimum value
in I is displayed as black, and the maximum value is displayed as white.
imshow(RGB) displays the truecolor image RGB.
imshow(BW) displays the binary image BW. imshow displays pixels with the value 0
(zero) as black and pixels with the value 1 as white.