Lab 1
Lab 1
THEORY:
Image Reading/Writing:
Read and display image information
imfinfo('Fig0221(a)(ctskull-256).tif')
or
imfinfo('rice.png')
Image = imread('Fig0221(a)(ctskull-256).tif');
or
Image = imread('rice.png');
1
Fig.1.1 Numerical image representation
Fig.1.2 Displaying images using gray, jet and hot color maps from left to right
Exercise 2: Use MATLAB help function to find the number of available color-maps.
Why should we use one over the other?
2
Color converted to grayscale image:
Read color image file
RGB = imread('saturn.png');
Convert to grayscale.
GrayImage = rgb2gray(RGB);
Display part of the image as a numerical array.
GrayImage(80:90, 80:90)
Display image
figure, imagesc(GrayImage), axis image, colormap gray, colorbar
The color image and the converted to grayscale are displayed in Figure 1.3
Fig.1.3 Displaying a color image and the converted to grayscale image from left to right
Exercise 3: Use MATLAB surf and mesh functions to display the grayscale image as
a surface.
Exercise 4: Use MATLAB figure functionalities to read the RGB values of specific
pixels
Conclusion: