0% found this document useful (0 votes)
249 views

HW5 Image Processing AUT

This document provides instructions for Assignment #5 on image compression and morphological operations for a Digital Image Processing course at Amirkabir University. It details how the teaching assistant will evaluate reports and code submissions. Students must submit a PDF report with distinct sections for each problem, labeled output files, and M-files containing their MATLAB code. The deadline for this assignment is June 20th.

Uploaded by

hamidnasiri1369
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
249 views

HW5 Image Processing AUT

This document provides instructions for Assignment #5 on image compression and morphological operations for a Digital Image Processing course at Amirkabir University. It details how the teaching assistant will evaluate reports and code submissions. Students must submit a PDF report with distinct sections for each problem, labeled output files, and M-files containing their MATLAB code. The deadline for this assignment is June 20th.

Uploaded by

hamidnasiri1369
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Digital Image Processing

Spring 2015 - Amirkabir University

Assignment #5
Image Compression and Morphological Operations

How TA evaluates your assignments:


Report: half of your score will be graded proportional to the quality of your report. You should provide
a distinct section for each problem, include the desired outputs and explain what youve done.
Dont forget to discuss your results as well. Note that in your reports, all your figures must have
captions. It is not necessary to accommodate your source codes in your reports unless you want to
refer to them. Compactness, expressiveness and neatness are of high importance.
Source Code: create an m-file for any problem and write all your codes there. If a problem consists
of several sub-problems, separate them by comments in your code. Finally, name your m-files
according to the number of the problems.
For evaluating your codes, TA creates two empty folders just beside your m-files, named as input
and output (in the same directory). Then, he copies the input materials into the input folder and
executes your m-files. Next, the output files will be checked in the output folder. Therefore, write
your codes so as to load input files from an input folder and save the output files in an output
folder. The exact name of the input and output files will be provided in the problem descriptions.
What to hand in:
You must submit your report (.pdf), source codes (m-files) and output files for each assignment. Zip
all your files into an archive file and use the following template to name it:
HW5_XXXXX.zip
where XXXXX must be replaced with your student ID. Your file size must not be bigger than 20MB. If
there is any question, dont hesitate to contact me through [email protected]
The Due Date for This Assignment is: June 20th

1. A source emits letters from an alphabet A a1, a2 , a3 , a4 , a5 with probabilities P a1 0.15 , P a2 0.04
, P a3 0.26 , P a4 0.05 , and P a5 0.50 .
a) Calculate the entropy of this source.
b) Find a Huffman code for this source.
c) Find the average length of the code in (b) and its redundancy.

2 (a). Encode the following sequence using the LZ77 algorithm

barrayar _ bar _ by _ barrayar _ bay


Assume you have a window size of 30 with a look-ahead buffer of size 15. Furthermore assume that
C a 1, C b 2, C _ 3, C r 4, C y 5 .

2 (b). A sequence is encoded using the LZ77 algorithm. Given that C a 1, C _ 2, C r 3, C t 4 .


Decode the following sequence of triples:

0,0,3 0,0,1 0,0,4 2,8,2 3,1,2 0,0,3 6,4,4 9,5,4


Assume that the size of the window is 20 and the size of the look-ahead buffer is 10. Encode the decoded
sequence and make sure you get the same sequence of triples.

Digital Image Processing

Spring 2015 - Amirkabir University

3 (a). Given an initial dictionary consisting of the letters a b r y _ , encode the following message using
the LZW algorithm:

a _ bar _ array _ by _ barrayar _ bay


3 (b). A sequence is encoded using the LZW algorithm and the initial dictionary shown in the following
table:
Index
1
2

Entry
a
_

3
4
5
6

h
i
s
t

The output of the LZW encoder is the following sequence. Decode this sequence.
6

11

16

12

14

20

10

23

13

Encode the decoded sequence using the same initial dictionary. Does your answer match the sequence
given above?

4. Load the images eye.png and fingerprint.png, and apply the following morphological operators
namely erosion, dilation, opening and closing on them. Analyze the resultant images and include them
in your report.

5. Consider a binary image which contains several squares and circles. It is possible to have overlap
between the shapes. The sides of the squares are of equal length and the same condition is true with the
radii of circles. A sample of such an image is Fig. 2. Propose a solution for the following problems and
implement them in MATLAB. Verify your implementation on the image binary.png or any image of your
own choice which satisfies the aforesaid conditions.
a) Counting the number of squares.
b) Counting the number of shapes which have overlap with at least one other shape.
c) Computing the shared area between two or more overlapping shapes.

You might also like