FinalSQ Image Processing
FinalSQ Image Processing
FinalSQ Image Processing
Question:
Hint:
Answer:
Define B as the structuring element. Let tool shape is described by B matrix. Desired
geometry consists of inner and outer boundaries. Let outer boundary described by A1 matrix
and inners are A2i matrices. Simply by closing the outer boundary and opening inner
boundaries with B achievable contours it to be found. At the end the sum (combination) of
resulting matrices gives estimated manufactured piece geometry.
Questions Cigdem Avci & Kerem Sahin
From the lowpass and higpass filters in frequency domain , which one is used for
smoothing and which for sharpening? Why?
Lowpass used for smoothing, highpass for sharpening because low pass allows low
frequencies of image in fourier domain and low frequencies represents general view of iimage
without sharp details and edges,high pass is the opposite.
Considering the fourier transformed image given above, how do you obtain low pass
filtering, high pass filtering and band pass filtering?
That image is origin centered and from the origin i select a dimaeter length and allow the
frequencies inside that diameter to pass and with inverse fourier transfor reconstruct the
image. For high pass, again i select a diameter from center but this time the frequencies
outside that diameter i will allow to pass and reconstruct the image by taking inverse fourier
transform.
To reduce noise, i use low pass filtering because it does not passes high frequencies that
correspond to edges in original image.
Which property of fourier transform gains importance when recognizin same shape on
different parts of image? Why?
Shifting property. Because with the same image on different part of the image, the image’s
only changed by a constant .
If your sampling rate does not include all frequencies in your image, ringing effect occurs.
CENG 466
a. Write down the equation of opening operation. What is the geometrical interpretation of
this operation can be?
b. A binary image is given through the matrix follows. (0 corresponds to black and 1
corresponds to white.)
A=
1 1 0 1 1 1 0 0 0
1 0 0 0 1 1 0 0 0
0 0 0 0 0 0 0 0 0
1 0 0 0 1 1 0 0 0
1 1 0 1 1 1 0 0 0
What does the resulting image look like after applying opening operation on this image with a
disk structural element of radius 1 pixel.
Comment on the result.
B=
0 0 0
0 0 0
0 0 0
d. Suppose the image is corrupted by salt and pepper noise which is present in the object part
of the image (not background). Which morphological operation will you prefer for
eliminating it?
SOLUT
TIONS:
a. A º B = (A
A B) B
b.
c. Boundary
B o the objectt will be obttained by th
of he operationns A- (A B ).
(A B ):
d. For getting
g rid of
o the salt annd pepper noise
n that is present inside the objeect, closing is
preferreed. Dilation can also bee applied buut it changess the size off the object, so closing is the
best soluution.
Beliz Uğurhan
U
FINAL QUESTION
İren Berk Özalp 1449040 – Belkay Sarataş 1449081 CENG
Here is an diagram of Discrete Wavelet Transform is a wavelet transform for which the
wavelets are discretely sampled. Here is h[n] stands for high pass filter and g[n] stands for
low pass filter. Result of g[n] is approxiamation coefficients and results of h[n] is detail
coefficients.
Briefly show differences and similarities of the transform, when it is applied like the diagram
above and when the g and h filters are change places.
Answer;
High pass filter are keep high frequncies and return details of an image, low pass filter keep
low frequencies. So when it is applied like above we keep downsampling highpass filter as
our next input so at the end of process we kept less detail with respect to other way. Because
in the other approach we downsample low pass to the next input so kept high pass and kept
more details. But both of them makes some smoothing to the original image. Also both of the
approaches can be used for image compression, also the compression ratio is the same for
both approaches because level of downsamling is same.
C G 466 FINA
CENG AL QU
UESTIO
ON, 2nd Ch
h.
In
ntensity Values
0 1 2 1 0
16
1 4 8 4 1
14
2 8 15 8 2
12
1 4 8 4 1 10
8
6
4
2
0 A B
0 1 2 3 4 5 6
2 8 15 8 2
rd
This is the 3 line of our
T o 5x5 maatrix. Becau use of the syymmetry off Gaussian function
rd
f
from peak point,
p we caan say the 3 column is i also the same.
s The rest of matriix would
b estimatioon. The corrners of thee image are totally blacck, which m
be means “0”. And we
k
know the middle
m points of the edgges are “2”. The intensiity values off (1,2) ; (1,4
4); (2,1);
(
(2,5); (4,1);; (4,5); (5,2) and (5,4) points wou uld be betweeen “2” andd “0”, which means
“
“1”. Afterw wards, the only
o unknow wn values belongs
b to points
p (2,2)) ; (2,4) ; (4,2) and
(
(4,4). Also from the character
c off Gaussian function,
f w can say tthe value would
we w be
b
between “88” and “2”. The real representatio
r on to the Gaussian
G fuunction with h σ = 1,
t
those pixelss have the intensity vaalue of “4””. However,, 3-4-5-6 w would be accceptable
0 2 0 answerrs.
The reesult matrix is:
8
2 8 15 8 2
8
0 2 0
0 1 2 1 0
b) According to the matrix obtained from part A, find the boundary for 4‐adjacency and 8‐
adjacency. Let our region's V={0,1,2,3,4,5,6,7}.
2 8 15 8 2
1 4 8 4 1
0 1 2 1 0
0 1 2 1 0
1 4 8 4 1
2 8 15 8 2
1 4 8 4 1
0 1 2 1 0
Ömer PEKTAŞ
Sara OMRANIAN
CENG 466
SAMPLE QUESTION FOR FINAL
(From Chapter 8)
QUESTION:
Consider a 7x7 image with each pixel represented by 3 bits. The binary images
corresponding to each bit plane of the image are compressed to reduce interpixel redundancies
by using run length coding as given below.
Bit Plane 0 : (1 3 3) (2 2 4) (3 3 3) (4 2 4) (5 3 3)
Bit Plane 1 : (2 1 5) (3 0 6) (4 0 6)
Bit Plane 2 : (1 3 3) (2 2 4) (3 1 5) (4 2 4) (5 0 6)
SOLUTION:
a)
Bit Plane 2 Bit Plane 1 Bit Plane 0
0 1 2 3 4 5 6
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1
2 1 1 0 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 1 1
3 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 1 0 1 1 1
4 1 1 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 1 1
5 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1
6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
b)
For bit plane 0 : (1 3 3) (2 2 4) (3 3 3) (4 2 4) (5 3 3)
Each symbol is represented by 3 bits. Then totally,
( 3 × 3) ⋅ 5 = 45
7× 7× 1 1
CR 1.089 R 1− 0.08 8% redundancy
45 1.089
c) 0 1 2 3 4 5 6
0 7 7 7 7 7 7 7
1 7 7 7 2 7 7 7
2 7 5 0 0 0 5 7
3 5 1 1 0 1 1 5
4 5 5 0 0 0 5 5
5 3 3 3 2 3 3 3
6 7 7 7 7 7 7 7
Consider the first pixel: 7 Æ (111) =(Bit plane2, Bit Plane 1, Bit Plane 0)
d)
Histogram
Total number of pixels:
25 7x7=49
20
P(0) = 7/49
15
P(1) = 4/49
P(2) = 2/49
H(rk)
10 P(3) = 6/49
P(5) = 8/49
5
P(7) = 22/49
0
0 1 2 3 4 5 6 7 8
rk
n
H − ∑ (p(ai)⋅log(P(ai)))
i=0
e) Since the range of gray levels is [0,7] each pixel is represented by 3 bits in fixed length
coding.
m = 3 Î mx(MxN)=3x(7x7)=147 bits needed.
f) Huffman coding
rk ( )
P rk Code 1 2 3 4
7 22/49 1 22 1 22 1 22 1 27
0
5 8/49 000 8 000 12 01 15 00 22
1
0 7/49 001 7 001 8 000 12 01
3 6/49 010 6 010 7 001
2 4/49 0110 6 011
1 2/49 0111
Note that the denominator (49) for P(rk) is not shown in the reduction phase just for
simplicity.
1⋅ ⎛⎜
22 ⎞ ⎛ 8⎞ ⎛ 7⎞ ⎛ 6⎞ ⎛ 4⎞ ⎛ 2⎞
Lavg ∑ (l(rk)⋅P(rk)) ⎝ 49 ⎠
⎟ + 3⋅ ⎜ ⎟ + 3⋅ ⎜ ⎟ + 3⋅ ⎜ ⎟ + 4⋅ ⎜ ⎟ + 4⋅ ⎜ ⎟
⎝ ⎠
49 ⎝ ⎠
49 ⎝ ⎠
49 ⎝ ⎠
49 ⎝ 49 ⎠
2.22 bits/pixel
k
• For storage: (7x7)x2.22 = 109 bits needed. In part d the information carried by the
image was found to be 108 bits. Hence, Huffman coding can be assessed to be quite
successful in compression of this image.
• Redundancy:
3 1
CR 1.35 R 1− 0.26 26% of data in fixed length
22 1.35 coding is redundant.
Reyhan Taşpınar Sample Final Question ( Chapter
10)
Buğra Oktay CENG
466
Question: Given a Hough transform of an image. Roughly draw (only the detected) lines in
this image.
‐ (Θ,r) values for the marked points (Unit for “Θ” is degree and unit for “r“ is pixel)
Theta r
1 0 72
2 45 119
3 45 101
4 45 26
5 120 113
6 120 77
7 225 105
8 225 87
9 225 35
10 225 19
11 270 72
12 270 25
Note that theta values are measured clockwise (from x-axis) in the coordinate system.
Solution:
There is, however, an exception about the point 4. The Hough curves passing through
this point are not close to each other at some points along the curve. This means the peak
point (point 4) will not actually give us a line segment. It is true that there are points in
the image being in the same line but they do not form a line segment since those points
are not neighbours.
The final image:
Ozan Özgün Bilgin
Ahmet Çağan
Yıldırım
Question
a) The histograms of three images are illustrated below. For each image, sketch a
transformation function in the figure below that will help to equalize the histogram.
Figure 1A Figure 1B Figure 1C
b) For the image shown in Figure 2, find a transformation function that will approximately
equalize its histogram, draw the transformed image and give the histogram of the processed
image. Assume that the processed images can only take integer values between 0 and 7
(including 0 and 7).
Figure 2
Solution
a)
Figure 1A Figure 1B Figure 1C
b)
Histogram equalization:
s
r h(r) H(r) =(int(7*H(r)/25)) s h(s)
0 3 3 1 0 0
1 7 10 3 1 3
2 3 13 4 2 0
3 3 16 4 3 7
4 3 19 5 4 6
5 3 22 6 5 3
6 2 24 7 6 3
7 1 25 7 7 3
h(s)
8
0
0 2 4 6 8 10
CENG 466 – FUNDAMENTALS OF IMAGE PROCESSING
FINAL QUESTION
OZAN ŞENER & YUSUF SOYMAN
0 5 3 3 2
6 1 7 1 4
3 4 7 0 6
6 7 1 4 4
2 1 7 0 5
cosθ -sinθ
sinθ cosθ
a)
0 3 5 4 3 3 3 3 2
3 4 3 2 5 4 2 3 3
6 4 1 4 7 4 1 3 4
5 2 3 5 7 4 1 3 5
3 4 4 6 7 4 0 3 6
5 6 6 5 4 4 2 4 5
6 7 7 4 1 3 4 4 4
4 5 4 4 4 4 2 4 5
2 2 1 4 7 4 0 3 5
-1 0 0
0 -1
0 0 1 1 0
1 1 1 1 0
0 0 1 1 0 =
1 1 1 1 0
0 0 0 0 0
CENG 466
FUNDAMENTALS OF IMAGE PROCESSING
FINAL SAMPLE QUESTION
CHAPTER 7
ANSWER
9 FALSE. A decomposed image in subband coding can be reconstructed without
error (i.e. fully reconstructed)
9 TRUE
9 TRUE
9 FALSE. For example if we consider a 2 X 2 Haar matrix
1 ⎞ ⎛1 1 ⎞
H2 := ⎛⎜ ⎟ ⋅⎜ ⎟
⎝ 2 ⎠ ⎝ 1 −1 ⎠