Project 2 - Image Enhancement - Point Processing (100+10) (Due 09/16)
Tasks
- Task 1: Implement some simple point processing algorithms
for image enhancement purpose. The actual algorithm implementation
(not including the for loops) should be done in ONE line. (Failure
to do so would cause penalties.)
- Task 1.1: Implement image
downsample/subsample by s (s is greater than 1), and
image quantization to q quantization levels in two functions, sampling(), quantization().
- Task 1.2: Implement log transformation and power law transformation in two functions, logtran(), powerlaw(). Use
the image (fourierspectrum.pgm) to
test the algorithms.
- Task 1.3: Implement contrast stretching in cs(). Use "bunker" as a testing image. Print its histogram and design a contrast stretching approach and test it.
- Task 1.4: Implement gray-level slicing in threshold(). Use the bunker image for testing. Choose
appropriate thresholds by observing its histogram such that only the bunkers are
highlighted.
- Task 1.5: Implement bitplane slicing in bitplane(). Use the bunker image for testing.
- Put all the above seven functions in a file pointProcessing.cpp in the /lib directory
- Task 2: Histogram equalization
- Write a function, histeq() to implement histogram equalization
in EIGHT lines (including the for loops) and add it in pointProcessing.cpp in /lib
- Select one image for testing purpose (Suggest the catbone or dogbone image). Show the histogram of both the original and enhanced images.
- How to plot the histogram. Save the histogram in an output data file. Use 'gnuplot' to plot the histogram. You can also use either MATLAB or MAPLE to do it. Following is the instruction on how to use gnuplot
- set terminal 'postscript'
- set output 'xxx.ps'
- plot 'xxx.dat'
- set terminal x11
- Task 3: Image averaging (for graduate students only).
- Write a function to generate Gaussian noise with zero mean and sigma standard deviation. Name it gaussianNoise() and save it in addNoise.cpp
- Use cameraman as a testing image. Generate five noisy images by adding the Gaussian noise to it. Then apply image averaging to see if it enhances the image.
- Increase the number of noisy images generated and see if the enhancement effect is more pleasing.
What to turn in
- a tar file or a zip file with the following items:
- pointProcessing.cpp with 8 functions (sampling, quantization, logtran, powerlaw, cs, threshold, bitplane, histeq)
- addNoise.cpp with 1 function (gaussianNoise) (572 only)
- testing codes for all the 8(472)/9(572) functions
- README
- Makefiles
- (3) Completeness of the above listed files
- a pdf file with the written report that includes the following
- (5/3) An explanation of the difference between image sampling
and image quantization. From two aspects, define image resolution.
- (5/2) Explain pros and cons between vector representation and
bitmap representation.
- (10/10) Comment on the
effect by using different parameters of the power-law transformation. Comment on the similarity/difference between log transformation and power-law transformation. Can power-law transformation replace log transformation?
- (10/5) Describe what bitplane slicing does. Does the most significant bit always contribute the most?
- (10/5) Comment on the difference (pros/cons) between contrast stretching and histogram equalization. Can they replace each other?
- (0/5) Show the derivation for histogram equalization
- (0/10) Prove Equations 2.6-6 and 2.6-7 on page 75 to help understand the image averaging algorithm for enhancement.
- (60/60) results generated from Tasks 1-3
- (35/35) Correctness of functions from Task 1 judged by the code and the resulting image
- (25/15) Correctness of functions from Task 2 judged by the code, the histogram plot and the resulting image
- (0/10) Correctness of functions from Task 3 judged by the code and the resulting image
- Source code print
Bonus (+10)
Implement localized histogram equalization.