Professional Documents
Culture Documents
I. OBJECTIVES
II. DISCUSSIONS
IMAGES IN MATLAB
REPRESENTATION OF IMAGES
• Intensity of each pixel is represented by the pixel element’s value in the red, green and blue
matrices
25
DE LA SALLE LIPA
COLLEGE OF INFORMATION TECHNOLOGY AND ENGINEERING
COMPUTER ENGINEERING DEPARTMENT
CONSYST – CONTROL SYSTEMS
ans(:,:,1) =
135
ans(:,:,2) =
97
ans(:,:,3) =
33
INDEXES IMAGES
• An indexed image is where the pixel values are indices to elements in a colour map or colour
lookup table.
• The colour map will contain entries corresponding to red, green and blue intensities for each
index in the image.
26
DE LA SALLE LIPA
COLLEGE OF INFORMATION TECHNOLOGY AND ENGINEERING
COMPUTER ENGINEERING DEPARTMENT
CONSYST – CONTROL SYSTEMS
Index
Associated
Color
Color
Lookup
Table
>> axes(h);
>> imagesc(I2)
27
DE LA SALLE LIPA
COLLEGE OF INFORMATION TECHNOLOGY AND ENGINEERING
COMPUTER ENGINEERING DEPARTMENT
CONSYST – CONTROL SYSTEMS
HISTOGRAMS
Instructions
1. Type the code in this handout in Matlab and investigate the results.
2. Do the exercises in the notes.
3. Create a grating2d.m function that generates a 2D steerable spatial frequency. Compute spatial
frequencies with an amplitude =1 and the following parameters
The value for pi is returned by the in-built MatLab function pi. Display your gratings using the in-
built gray color map. (figure 1)
4. Create a superposition of two or more gratings with different frequencies and thetas and display
the result. You can do this by simply adding the images you generated with grating2d (figure 2)
Make sure you examine combinations of different frequencies and theta values. (figure 4) Visualise
the intensity surface of the outputs that you have generated. (figure 4)
5. Write a MatLab function that segments a greyscale image based on a given threshold (i.e. display
pixels values greater than the threshold value, zero otherwise). The function should accept two
inputs, the image matrix, and the threshold value, and output the thresholded image matrix.
28
DE LA SALLE LIPA
COLLEGE OF INFORMATION TECHNOLOGY AND ENGINEERING
COMPUTER ENGINEERING DEPARTMENT
CONSYST – CONTROL SYSTEMS
Figure 6.0
29