Assignment 4

Due date

Objectives

Note that you are to use the matlab code in the DIP Matlab experiments.

Q1. Hoffman coding.    
Given a piece of information with the following symbols and frequences.
Symbol  Frequency
   A       24
   B       12
   C       10
   D        8
   E        8
a. compute the entropy of the information
b. compute the huffman code for the symbols and compute the average code length of the huffman coding. What do you conclude by comparing this average code lenghth with the above entropy.
c. Do the huffman encoding with Matlab functions.

Q2. Impage compression. Given this image of tif format and bitmap format.
a. What is the compression ratial of this tif image file with the bitmap format? 
b. What is the  bitrate of this image file?
c. Write a simple m file to compress the image by JPeg with bpp = 0.2  (roughly) and output the resulting image and compute the MSE of the compressed images with the  origional image.  
d.
Write a simple m file to compress the image by JPeg2000 with bpp = 0.2 (roughly) and output the resulting image and compute the MSE of the compressed images with the origional image.
e. What do you conclude by the results of c and d.  

Q3.  Image morphology. Given this image. Measure the width and height of the middle square by
a. rosion to remove other things
b. then diation to recover to the orgional size
c. compute and output the width and height
d. Compute the boundary of the origional image
e. Apply other morphology operations (you choose) the origional image.

Q4. 
a. Describe a solution which processes 
this image, and then counts the number of rices in the image.
b. Write a
Matlab function, rice_count('image file'), which read the image in and output the number of  rice grain in the image. 

Q5.
a. Describle a solution to detect if a bottle as in 
this image is full. A bottle is not full if the liquid level is below the middle between the neck and shoulder of the bottle. 
b. Write a Matlab function, bottle_detect('image file'), which reads in the given image, and outputs the number of bottles which are not full, and their position from the left. 

Q6.  (this question is bonus)
a. Describe a solution which recognize the numbers in car plate as in 
this image.
b. Write a Matlab function, plate_number('image file'), which reads in the given image, and outputs the number shown in the plate. 

What to submit

Submit a zip file with name a0_xxxx####.zip (substitute xxxx#### by your WLU's email id) through WebCT. It should containin

  1. A readme.txt file.
  2. Answers to a. of Q1, Q2, Q3,.
  3. All m-files of your programs

Marking scheme

Total  120 points,  12% of the overall.  See readme file for detail.