Professional Documents
Culture Documents
TD 1 Computer Vision
TD 1 Computer Vision
TD 1 Computer Vision
Travaux Diriges #1
Objectives:
Procedure:
1) Load into memory the image coins.png by executing the following statement:
I = imread (‘coins.png’);
3) Convert the indexed image X with color map “map” to an RGB image, X_rgb by executing the
following statement:
How many dimensions does the variable X_rgb have and what are their sizes?
4) Convert the indexed image X with color map “map” to an intensity image by running the
following command:
X_gray = ind2gray(X,map’);
5) Find the value of pixel with the lowest intensity in X_gray using the statement:
min_val = min(X_gray(:));
What is the value of the pixel with the highest intensity in X_gray?
X_gray_dbl = im2double(X_gray);
Or X_gray_dbl = im2uint16(X_gray);
7) Display coins.png image that was loaded in variable I using the command:
imshow(I); then
imshow(I), impixelinfo
Move the cursor on the image, what is the highest value (intensity level) that you read?
8) To display indexed images, we must specify the color map along with the image data. Display the
color mapmed image trees.tif as follow:
Hover your pixel on the image? What is the information provided by impixelinfo?
subplot(1,2,2), imshow(X,map)
subplot(1,2,1), imshow(X_gray)
10) Let save the RGB image X_rgb as ‘rgb_trees.jpg’ using the following command:
imwrite(X_rgb, ‘rgb_trees.jpg’);