This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: RUTGERS UNIVERSITY School of Electrical and Computer Engineering ECE 447 Fall Course Laboratory No. 2 Solutions Image Processing in MATLAB – Intensity Transforms for Gray Scale Images 1 Preliminaries You can access MATLAB toolkits from either the departmental computers in CoRE Room 548 or from any computer with both Matlab and the Image Processing Toolbox. The image files referenced in this lab can be accessed from the course website at: cronos.rutgers.edu/~lrr/ If you are a new Matlab user, try running the builtin demos. Just type demos at the Matlab prompt. 2 Exercise 1 – Intensity Transforms – Gray Scale Im ages As we learned in class, the simplest form of pointtopoint transformation is when the neigh borhood of each point is of size 1 x 1 (a single pixel). We call such transforms intensity or graylevel transforms. In this first exercise we investigate the use of an intensity transform on a grayscale image. (a) Read in the gray scale image lena.tif and display the image using the Matlab command imshow . The first transformation is to convert the image to its negative image using the imadjust command. (b) We will see later in this laboratory exercise that (on a normalized scale) intensity levels in the lower quarter of the range and intensity levels on the higher quarter of the range (i.e., normalized range from [0 0.25] and from [0.75 1]) are not prominent in this grayscale image, and hence we want to use an intensity transform to sharpen the image. Initially set the value of γ (the free variable in the intensity mapping function) to 1.0. Use imadjust to convert the range from [0.25 0.75] to the full range [0 1] and plot the resulting gray level image. What differences do you notice in the image, resulting from this intensity level transformation? (c) Set the value of γ to 2.0 and repeat the exercise of part (b). Plot the resulting gray level image. Is the image quality improved or deteriorated? In what sense is the change noted? 1 (d) Set the value of γ to 0.5 and repeat the exercise of part (b). Plot the resulting gray level image. Is the image quality improved or deteriorated? In what sense is the change noted? *************************************************************************** SOLUTION (a) The Matlab code for reading in lena.tif and displaying the original image is: lena=imread(’lena.tif’); figure(1);imshow(lena); The Matlab code for creating and displaying the negative of the lena image is: % Invert image to show negative gamma=1; lenaneg=imadjust(lena,[0 1],[1 0],gamma); figure(2);imshow(lenaneg); The negative image could also have been obtained using the imcomplement command from Matlab . Figure 1 shows the original grayscale image at the left and the negative at the right....
View
Full
Document
This note was uploaded on 12/29/2011 for the course ECE 259 taught by Professor Rabiner,l during the Fall '08 term at UCSB.
 Fall '08
 Rabiner,L
 Image processing

Click to edit the document details