Experiment 1: RAW Image to YCbCr

advertisement
EMM3136 Digital Image and Video Processing.
Lab experiment 1
EMM3136 Digital Image and Video Processing
Lab experiment 1
Image Processing and Analysis using MATLAB
Objectives
1) To learn MATLAB software and its basic commands for image processing.
2) To learn the some fundamental concepts of image processing using MATLAB.
Equipment
MATLAB software version 5.3.
Introduction
The purpose of this lab experiment is for you to understand some fundamental
concepts of image processing using MATLAB. This lab experiment consists of four
parts. In part 1, you will learn some basic MATLAB commands for image processing.
After getting yourself familiar with MATLAB commands, you may proceed to the part
2 of this lab. In part 2, you are required to enhance a corrupted image using filtering.
Peak signal to noise ratio (PSNR) will be used to measure the quality of the
enhanced image.
In part 3 of the lab, you are required to write a simple MATLAB program to segment
the characters from plate number image. Segmentation is one of the important
processes in automatic plate number recognition. The final part (part 4) of this lab is
to calculate mean square error (MSE) of images and to relate the MSE value with
subjective quality.
Procedures:
Part 1: Introduction to MATLAB for image processing
a)
b)
c)
d)
e)
Start up MATLAB software by clicking the MATLAB icon.
Type demos and go to the digital image processing (DIP) toolboxes.
Go through the titles in the DIP toolbox.
Choose one title from the toolbox and perform one short experiment.
Discuss about this experiment in your lab report.
Part 2: Image Enhancement
a) Download a gray type image file of your choice from the following site:
http://sipi.usc.edu/database/database.cgi?volume=misc
b) Write a MATLAB program to corrupt the image with impulse noise.
c) Calculate PSNR between the original image and the corrupted image.
d) Enhance the image using a median filter.
e) Calculate PSNR between the original image and the enhanced image
f) Evaluate the quality of the enhanced image and its relation to PSNR.
g) Include the printouts of the original, corrupted and enhanced images in your lab
report.
Revised: January 2009 (Hezerul Karim), February 2011 (Sarina Mansor)
1
EMM3136 Digital Image and Video Processing.
Lab experiment 1
Tips:
i. You may need to use the following MATLAB commands to open the for example
the "truck.tiff" file in MATLAB.
>> tr = imread(‘truck.tiff’);
ii. You may also need to use the following MATLAB commands in this lab:
round
uint8
imshow
for loop
iii. You may use the PSNR as defined below:
PSNR  10 log 10
255 2
Nx 1 Ny 1
1
2
  I (i, j )  I ' (i, j )
Nx  Ny i 0 j 0
MSE
Nx and Ny are respectively the width and height of the image. I(i,j) and I’(i,j) are
respectively the original and the processed pixel luminance at position (i,j). Note
that the bottom part of the above equation is the Mean Square Error (MSE).
Part 3: Image Segmentation
a) Download a simple plate number image such as below from website:
b) Convert the image into gray image.
c) Segment the image using one of the methods in image segmentation. You may
use the MATLAB command edge.
d) Discuss several ways to automatically recognise the plate number.
Revised: January 2009 (Hezerul Karim), February 2011 (Sarina Mansor)
2
EMM3136 Digital Image and Video Processing.
Lab experiment 1
Part 4: MSE Calculation
a) Download a gray type image file of your choice from the following site:
http://sipi.usc.edu/database/database.cgi?volume=misc
b) Blur the original image using Gaussian error with average 0 and variance 0.002.
You may use MATLAB command imnoise.
c) Calculate the MSE between the original image and the blurred image.
d) Corrupt the original image by setting 6 of its consecutive pixels to 0. The resulting
corrupted image may look like the picture below.
e) Calculate the MSE between the original image and the corrupted image. You
should see that the MSE of the blurred image is lower than the corrupted image.
f) Increase the amount of blur and find out when the MSE of the blurred image is
higher than the corrupted image.
g) Compare the quality of the blurred and corrupted images and discuss their
relation to MSE.
h) Include the printouts of the original, blurred and corrupted images in your lab
report.
Marking Scheme
You are required to submit a lab report for this lab experiment. The lab report should
follow the standard report format as follows:
i) Lab experiment overview (2 marks)
 Summary of the lab experiment
 Maximum: 1 page
ii) Results and Discussion (20 marks)
 Present and discuss the results obtained from the experiment
 Answer all questions listed in the experiment
iii) Conclusion (3 marks)
 Conclusive remarks on the experiment
Revised: January 2009 (Hezerul Karim), February 2011 (Sarina Mansor)
3
Download