ee 341 lab 2 repo - Lab 2: Introduction to Image Processing...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab 2: Introduction to Image Processing David Rochier 0632577 July 22, 2009 EE 341 Summer 2009
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Introduction: This report will show how different approaches to image processing and alteration are established using the MATLAB program. Convolution is extremely beneficial to both image and sound alteration. Since MATLAB has a built in two-dimensional convolution function this makes it an ideal program to be working with. We shall go about using horizontal and vertical edge detection, as well as scaling images to smaller and larger ratios. Assignment 1: Converting the Daily Show image to gray scale was a simple task by use of the rgb2gray() function in MATLAB. Converting the image to 8‐bit gray scale allowed us to work with the image and MATLAB together easier due to the smaller bits used for the image. This altered image is shown in figure 1, with a size of 400 rows and 468 columns. Vertical and horizontal edge detection was implemented on MATLAB using convolution. The built in function conv2() was used. We were provided with the following 3X3 matrices used to implement the edge detection: The vertical and horizontal edge detection kernels are represented by H1 and H2 respectively, and the resulting images from convolving these kernels with the Daily Show image can be seen in figures 2 and 3. The convolution for the vertical edge detection is performed as follows: y = imread( 'DailyShow' , 'jpeg' ); y = rgb2gray(y); h1 = [-1 0 1; -2 0 2; -1 0 1]; M1 = conv2(y, h1); H1 = [ -1 0 1 -2 0 2 -1 0 1] H2 = [ 1 2 1 0 0 0 -1 -2 -1]
Background image of page 2
Figure 2: Vertical Edge Detection Figure 3: Horizontal Edge Detection The column and row gradient magnitudes we found by taking the absolute value of the resulting matrix of the image convolved with the edge detection matrices. The image that represents the column gradient magnitude is shown in figure 4, and the row gradient magnitude is seen in figure 5. We have inverted each of these images to save ink. To display these magnitudes we needed to slightly alter our imshow() function as follows: imshow(abs(M1),[]); We must use the [] or the image will not be displayed properly. Figure 4: Row Gradient
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

ee 341 lab 2 repo - Lab 2: Introduction to Image Processing...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online