You are on page 1of 4

Experiment 10 student’s Manual

American International University- Bangladesh


Department of Electrical and Electronic Engineering
EEE3211: Digital Signal Processing Laboratory

Title: Process and Analysis of Image Signal by MATLAB

Introduction:

Digital image processing is the use of computer algorithms to perform image processing as a
subcategory or field of digital signal processing. And a digital image differs from a photo in
that the values are all discrete. Usually they take integer values. A digital image can be
considered as a large two dimensional array of discrete cells, each of which has a brightness
associated with it. These dots are called pixels. The goal of our experiment is to read or import
some images via image acquisition tools, analyze & manipulate them via noise addition &
removing, process the images through an edge detection algorithm to make the images sharper,
clear and detailed to some extent.

Theory and Methodology:

Digital image

A digital image differs from a photo in that the x, y and ( , ) values are all discrete.
Usually they take on only integer values, for example an image can have x and y ranging
from 1 to 256 each, and the brightness values also ranging from 0 (black) to 255 (white). A
digital image can be considered as a large array of discrete dots, each of which has a
brightness associated with it. These dots are called picture elements, or more simply pixels.
The pixels surrounding a given pixel constitute its neighborhood. A neighborhood can be
characterized by its shape in the same way as a matrix.

Types of images

There are four basic types of digital images: binary, grayscale, color or RGB, Indexed.

In binary image, each pixel can have only two possible values:- either black or white. And we
need require only one bit to represent each pixel.

In grayscale, each pixel is a shade of gray from 0 (black) to 255 (white).

In an RGB image, each pixel has a particular color; that color being described by the amount
of red, green and blue in it. If each of these components has a range 0-255 this gives a total of
255 = 16,777,216 different possible colors in the image.

In Indexed, most color images only have a small subset of the more than sixteen million
possible colors. For convenience of storage and a file handling, the image has an associated
color map, or color palette, which is simply a list of all the colors used in that image. Each
pixel has a value which does not give its color (as for an RGB image), but an index to the
color in the map.

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 1


Experiment 10 student’s Manual
Image processing techniques

Enhancing the edges of an image is to make it appear sharper. If we sharp the edge of an
image it looks better on the printed page. Noises are very common for data transmission
through electrical components and some they get unbearable. And removing noise or random
errors on an image is another important technique of image processing. In photographs of fast
moving objects like athletes & vehicles, the problem of motion blur may occur. Removing
the blur makes all the parts of the image more detailed and clear. And finding the edges is
very important to measure the number of objects on an image.

Edge detection techniques

Sobel Operator

The operator consists of a pair of 3×3 convolution kernels as shown in Figure 1. One kernel is
simply the other rotated by 90°.

These kernels are designed to respond maximally to edges running vertically and horizontally
relative to the pixel grid, one kernel for each of the two perpendicular orientations. The
kernels can be applied separately to the input image, to produce separate measurements of the
gradient component in each orientation (call these Gx and Gy). These can then be combined
together to find the absolute magnitude of the gradient at each point and the orientation of
that gradient.

The gradient magnitude is given by:

| |= +
The angle of orientation of the edge (relative to the pixel grid) giving rise to the spatial
gradient is given by:
= ( / )
Robert’s cross Operator

The Roberts Cross operator performs a simple, quick to compute, 2-D spatial gradient
measurement on an image. Pixel values at each point in the output represent the estimated
absolute magnitude of the spatial gradient of the input image at that point. The operator
consists of a pair of 2×2 convolution kernels as shown in Figure 2. One kernel is simply the
other rotated by 90°. This is very similar to the Sobel operator.

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 2


Experiment 10 student’s Manual

These kernels are designed to respond maximally to edges running at 45° to the pixel grid,
one kernel for each of the two perpendicular orientations. The kernels can be applied
separately to the input image, to produce separate measurements of the gradient component in
each orientation (call these Gx and Gy). These can then be combined together to find the
absolute magnitude of the gradient at each point and the orientation of that gradient. The
gradient magnitude is given by:

| |= +

The angle of orientation of the edge (relative to the pixel grid) giving rise to the spatial
gradient is given by:
= ( / )

Prewitt’s Operator

Prewitt operator is similar to the Sobel operator and is used for detecting vertical and
horizontal edges in images

Pre-Lab Homework:

1. Study the digital signal processing section in the text/reference book thoroughly.
2. Find out the requirement of the image processing.

Apparatus:

1. A computer (capable of running MATLABTM)


2. MATLABTM (the latest version)

Precautions:

All the computers in the DSP laboratory are running Windows operating system. Unlike
Ubuntu or MacOSX, Windows is very much affected by the virus. So to avoid infecting the
virus, please double check your USB drive before connecting to the computer.

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 3


Experiment 10 student’s Manual
Experimental Procedure:

A1. Read an image from a particular drive, resize the image, transfer the image from
RGB to binary and Gray scale format.

A2. Read an image from a particular drive and find out the RGB components of the
image.

A3. Read an image from a particular drive and add noise elements to the image.

B. We will read an image from a particular drive and apply Sobel, Robert and Prewitt
edge detection algorithms to the image. And analyze the performance of these three
algorithms.

Simulation and Measurement: In this section the corresponding simulation screen-shots


should be added, and codes should be shown in appendices section.

Results and Discussion: Interpret the data/findings and determine the extent to which the
experiment was successful in complying with the goal that was initially set. Discuss any
mistake you might have made while conducting the investigation and describe ways the study
could have been improved.

Questions with answers for report writing:

1. Compare the results to your theoretical understanding and comment on the


findings.
2. Give the clear screen-shots where appropriate and describe what the figures might
mean theoretically.
3. Give the simulation codes at the end of the report.

Reference(s):
John G. Proakis & Dimitris G. Manolakis, “ Digital Signal Processing – Principles,
Algorithms and Applications”, Prentice – Hall India, 3rd Edition.

© Dept. of EEE, Faculty of Engineering, American International University-Bangladesh (AIUB) 4

You might also like