Vous êtes sur la page 1sur 5

DIGITAL SIGNAL PROCESSING LABORATORY

LAB 7 : BASICS OF IMAGE


PROCESSING

NAME:

DATE OF EXPERIMENT:

DATE REPORT SUBMITTED:

1
DIGITAL SIGNAL PROCESSING LABORATORY

1 THEORY

This lab is going to introduce you to the image processing capabilities in MatLab. Image
processing is a very important and widely used process in which images are processed to
retrieve information that is not visible to the naked eye, as well as it is used in a large
number of other applications where the standard picture is not enough.

The first step in this lab is to download all the jpg and tif files that are to be used in
this lab. You can locate them as a link on the webpage.

The second step is to set the directory of MatLab to the directory which contains your
image files. Be sure that you create this directory on your U-drive.

1.1 MATLAB IMPLEMENTATION

First, clear the MATLAB workspace of any variables and close open figure windows.

close all

To read an image, use the imread command. The example reads one of the sample images
included with Image Processing Toolbox, circles.gif, and stores it in an array named I.

I = imread('cameraman.tif');

Now display the image. The toolbox includes two image display functions: imshow and imtool.
imshow is the toolbox's fundamental image display function. imtool starts the Image Tool which
presents an integrated environment for displaying images and performing some common image
processing tasks. The Image Tool provides all the image display capabilities of imshow but also
provides access to several other tools for navigating and exploring images, such as scroll bars,
the Pixel Region tool, Image Information tool, and the Contrast Adjustment tool. This example
uses imshow.

imshow(I)

Grayscale Image cameraman.tif

2
DIGITAL SIGNAL PROCESSING LABORATORY

Fspecial is uses various parameters that function : h =fspecial(type,parameters) and it


include average,disk,gaussian,laplacian,lag,motion,prewitt,sobel,unishop etc.
Motion parameter gives to picture where suddenly taken effect.
Sobel parameter makes sharp to picture.
To see how the imread function stores the image data in the workspace, check the
Workspace browser in the MATLAB desktop. The Workspace browser displays
information about all the variables you create during a MATLAB session. The imread
function returned the image data in the variable I, which is a 291-by-240 element array
of uint8 data. MATLAB can store images as uint8, uint16, or double arrays .
To see the distribution of intensities in picture you can create a histogram by calling the
imhist function.
To write the newly adjusted image I2 to a disk file, use the imwrite function. If you
include the filename extension '.png', the imwrite function writes the image to a file in
Portable Network Graphics (PNG) format, but you can specify other formats.
imopen function to perform the morphological opening operation and then calls the
imshow function to view the results.
the surf command to create a surface display of the background approximation
background. The surf command creates colored parametric surfaces that enable you to
view mathematical functions over a rectangular region. The surf function requires data
of class double, however, so you first need to convert background using the double
command.
To create a more uniform background, subtract the background image, background,
from the original image, I, and then view the image.
imadjust to adjust the contrast of the image. imadjust increases the contrast of the
image by saturating 1% of the data at both low and high intensities of I2 and by
stretching the intensity values to fill the uint8 dynamic range.
im2bw function to convert the grayscale image into a binary image by using
thresholding. The function graythresh automatically computes an appropriate threshold
to use to convert the grayscale image to binary.

1.2 ANSWER TO THE QUESTIONS

1.2.1. Select any picture with .tif extended that from image folder and

Step 1. Read and Display an Image.

Step 2. Check How the image Appears in the Workspace.

Step 3. Improve Image Contrast.

Step 4. Write the Image to a Disk file.

3
DIGITAL SIGNAL PROCESSING LABORATORY

1.2.2. Select any picture with .tif extended from image folder and

Step 1. Read and Display an Image.

Step 2. adjust a low contrast grayscale image.

1.2.3. Select any picture with .jpg extended from image folder and

Step 1. Read and Display an Image.

Step 2. Use fspecial command and add Motion blurr effect with imfilter parameter.

Step 2. Againly Use fspecial command and add blurred effect.

1.3 IMAGE ANALYSIS ON MATLAB

In this section we can determine the number of fields bordered by the green line. These parts
that morphological operations can be done by performing simple object counting application.

Bwboundaries determine the boundaries of the regions in binary mode.


graythreshold command automatically determines the threshold of brightness in an
image and as a result, 0 - 1, a number of (level) creates. In the process we do with the
brightness in the image boundaries from graythreshold we have achieved, we use the
number. Primarily for us to make certain operations on the image gray levels need to
work on.

1.4 ANSWER TO THE QUESTIONS

1.4.1. Select any picture rice.png extended that from image folder and

Step 1. Read and Display an Image

Step 2. Determine the boundaries of the regions in binary mode

Step3. Determine text of the regions

Step4. Plot

4
DIGITAL SIGNAL PROCESSING LABORATORY

INSTRUCTOR VERIFICAT ION

1.5 SCRIPT FILES

Check the students script file to see if it is correct

1.6 FUNCTION FILES

Check the students function file to see if it is correct.

2 LAB WRITEUP

Please send me a write-up of your code in pdf format. You can write it as a word file, then save as
pdf.

Each lab grade consists of two sections. 50% of your grade is for coming to the lab. 50% is for
your write-up.

If you do not send the write-up within 2 weeks of the lab, you will not be allowed to submit a lab
writeup.

If your lab writeup is found to be substantially identical to another students using our special
forensics team, you and the other student will receive a substantial reduction in your grade.

At the top of your code you should have your name, student number, lab number, date you
performed the lab.

In the lab writeup you should answer all questions in the body of the lab report.

Please clearly label every question. You will not get credit for sections that are not clearly
labeled.

You must copy figures from Matlab and paste them into your word file, or save them as jpeg and
import them into your word file. All figures must have captions inside which clearly describe
what the figure is.

Vous aimerez peut-être aussi