ECE 253
Digital Image Processing
October 16, 2015
Instructions :
Homework 2 is due by 11:59 PM, October 24, 2015.
Submit your homework electronically by email to arangesh@ucsd.edu with the subject line
ECE 253 HW2.
The email should have one PDF file of your writeup attached. Make sure it includes your full
name, PID, and email. This file must be named ECE 253 hw2 lastname studentid.pdf.
All problems are to be solved using MATLAB unless mentioned otherwise.
You should avoid using loops in your MATLAB code unless you are explicitly permitted to
do so.
Append source code, floats, matrices, and image outputs, to your writeup where applicable.
Simply pasting your code in the report should suffice, but make sure it is indented correctly.
Problem 1. Histogram Equalization (5 points)
It is often found in image processing and related fields that real world data is unsuitable for
direct use. This warrants the inclusion of a pre-processing step before any other operations are
performed. One example of this is histogram equalization.
The goal of this problem is to write a function in MATLAB with the following specifications:
(i) The function takes one input: the image file name.
(ii) Plots the histogram of each channel of the original image.
(iii) Performs histogram equalization.
(iv) Plots the histogram of each channel of the enhanced image.
(v) The function returns one output: the enhanced image.
Evaluate your function on the image fog.jpg. Feel free to make use of inbuilt MATLAB functions.
In your report, include the original image, the image after equalization, and the 6 histogram plots
mentioned above. Make sure all you plots and images are labeled correctly. Additionally, include
your answers (no more than two sentences each) to the following questions:
What do the original histograms look like (statistically speaking)? If youre lost, do some
research on the derivation of histograms.
What effect does histogram equalization have on the original image (in a visual sense)?