0% found this document useful (0 votes)
24 views5 pages

Image and Video Processing Solutions

The document discusses the analysis of images and their corresponding magnitude spectra through various examples, detailing the relationships between image characteristics and frequency components. It explains the periodic nature of distortion signals and how to filter them using notch filters in the frequency domain. Additionally, it explores the implications of Fourier transforms on image properties, including the effects of modulation and reflections in the frequency domain.

Uploaded by

gsoguzhanoguz
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views5 pages

Image and Video Processing Solutions

The document discusses the analysis of images and their corresponding magnitude spectra through various examples, detailing the relationships between image characteristics and frequency components. It explains the periodic nature of distortion signals and how to filter them using notch filters in the frequency domain. Additionally, it explores the implications of Fourier transforms on image properties, including the effects of modulation and reflections in the frequency domain.

Uploaded by

gsoguzhanoguz
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

EQ2330 – Image and Video Processing

Solution #3

Solution
1. First we note that all the plots of the magnitude spectra have DC component
in the center of each plot.
Picture A: There is a slow sinusoidal change of intensity in the horizontal direc-
tion and fast sinusoidal change in the vertical direction. This corresponds to a
magnitude spectrum with four spectral peaks. There are two peaks along hor-
izontal direction and two peaks along vertical direction. Due to low frequency
of changes of intensity in the horizontal direction the corresponding peaks are
close together. Since the change in vertical direction is faster, the corresponding
peaks are further apart. We can, therefore, match the picture A to spectrum 3.
Picture B and Picture C: Picture B contains a centered small white square. We
may consider a cross-section through the center of this square in horizontal and
vertical direction. We know that cross-section should have a sinc-like spectrum.
There are two spectra that fulfill the requirement. We see that picture C shows
a bigger square. Since the square in picture B is small, it must have wider
frequency lobes of the sinc-like spectrum, that the picture with a bigger square.
You may write down an equation to see this immediately. Therefore, we match
picture B to spectrum 1 and picture C to spectrum 2.
Picture D: We match picture D to the spectrum 4. We use similar reasoning
as in the case of Picture A.

2. (i) The distorting signal q(x, y) is periodic with ≈ 10 periods in the horizontal
direction and ≈ 20 periods in the vertical direction. The image is 512×512
pixel, so the period in horizontal direction is Tx = 512/10 ≈ 51 pixels and
the period in vertical direction is Ty = 512/20 ≈ 26 pixels. Assume that
tht signal is a sinus-like in both direction (if you assume it is not, you have
to acknowledge the signal’s overtones, at multiplies of the fundamental
frequency). The DFT has strong components at positions corresponding to
51 pixel periodicity in horizontal direction (u) and at 26 in vertical direction
v. The position of spectral peaks in the DFT spectrum would be then
±512/26 ≈ ±20 in the v-direction and ±512/51 ≈ ±10 in the u-direction
(We use the fact that the magnitude DFT spectrum is symmetrical around
the origin). See the plot in Fig. 1.

1
Figure 1: Magnitude of DFT of q(x, y).

(ii) The distortion may be suppressed by two notch filters that filter out the
sinusoids corresponding to the peaks in the DFT spectrum of the distorting
signal q(x, y). These filters can be defined in the frequency domain as
follows:

0 if v ∈ small circles centered around (0,-20) and (0,20)
Hv =
1 otherwise

0 if u ∈ small circles centered around (-10,0) and (10,0)
Hu =
1 otherwise

Clarification from exercise session: The fourier domain representation does


not affect where exactly we consider the ’zero’ or origin of the image is. Whether
in a corner as in many textbooks or not. Note than in the expression we are
summing over all x and y. Now, the origin of the fourier transform is the DC
in the image, or on other words, sum of all pixel values. This is obtained when
the complex exponent is zero. Mathematically, it can be shifted to any other
place, an arbitrary u0 , v0 by modifying the expression to use a complex exponent
e−j2π((u−u0 )x+(v−v0 )y)/N , such that it vanishes at (u0 , v0 ) but the standard is to
have it at (0, 0) for easiness.

3. (i) The DC component is located at point (u, v) = (0, 0).


(ii) Since
f (x, y)(−1)x+y = f (x, y) exp (jπ(x + y)),
the operation is equivalent to signal modulation, therefore

f (x, y) exp (jπ(x + y)) ↔ F (u + N/2, v + N/2).

If we now plot |F (u + N/2, v + N/2)| we see that it is symmetrical around


the center of the plot and the DC component is now moved to (N/2, N/2)
(the center).

2
(iii) The operation denoted by ”?” can be implemented by taking the complex
conjugate. We see it from the following
(N −1 N −1 )∗
XX ux + vy
F (u, v)∗ = f (x, y) exp(−j2π )
x=0 y=0
N
N −1 N −1
X X u(−x) + v(−y)
= f (x, y) exp(−j2π )
x=0 y=0
N
= F{f (−x, −y)},

therefore the output image is reflected around the origin.


Clarification from exercise session: Note that images are real-valued.
Thus, Fourier transform is symmetric. Thus F (−u, −v) = F (u, v). You
can also compute the inverse fourier transform of f ∗ (−x, −y) = f (−x, −y)
to get to the answer.

3
This is continuation of what discussed in the class regarding the intuition behine
fourier transform of diagonal stripes. So neeed the context. Others can ignore this.
This is only for intuitive understanding, but not for complete correctness. Img1:
Horizontal stripes

1 1 1 1
0 0 0 0
1 1 1 1
0 0 0 0

Img2: Vertical stripes

1 0 1 0
1 0 1 0
1 0 1 0
1 0 1 0

Img3: diagonal stripes

1 0 1 0
0 1 0 1
1 0 1 0
0 1 0 1

Impulses in Horizontal axis Lets look at F (u, v) in the horizontal axis or u axis,
that is when v = 0.

e−j2πxu/N y e−j2πyv/N f (x, y)


P P
F (u, v) = x
= x e−j2πxu/N y f (x, y)
P P
F (u, 0)
= x e−j2πxu/N fy (x)
P

= F{fy (x)}
P
Here fy (x) = y f (x, y) is the marginal sum of y as a function of a given x. That
is the horizontal axis of the fourier transform contains the fourier transform of the
marginal along Y direction in the original image.

If 0, 0 of the 4 × 4 image shown as matrix above is the top left pixel, we can compute
the marginal sum as below. then for img1,

4
fy (1) =1+0+1+0=2
fy (2) =1+0+1+0=2
fy (3) =1+0+1+0=2
fy (4) =1+0+1+0=2
⇒ Img1:: fy = [2 2 2 2]

Similarly

Img2:: fy = [4 0 4 0]
Img3:: fy = [2 2 2 2]

Note that only Img2, with vertical stripes has fy non constant. This is because pixel
values in each vertical stripe is constant and is different from the neighbouring verti-
cal stripe. In horizontal stripe and diagonal stripe, these are alternating, irrespective
of which x you counsider.

Thus only the periodic Img 2 will have an impulse in the u axis at N/2 = 2 (max
frequency).

Impulses in Vertical axis The argument can be extended to v axis as well with
u = 0. Here F (0, v) = F{fx (y)} and fx (y) is non constant and periodic (with period
2) only for Img1 with horizontal stripes and hence we have two impulses at ±N/2.

Impulses in Diagonal axis Lets consider F (u, u) with v = u = N/2.

F (u, u) = x y e−jπ(x+y) f (x, y)


P P

= x y (−1)(x+y) f (x, y)
P P

Note that ((−1)(x+y) ) is +1 when x + y the index sum of a pixel is positive and is
−1 otherwise (Note that this alternates between +1 and −1 in the diagonals). Thus
F (u, u) with v = u = N/2 is just about summing all the columns with even number
of index sums and subtracting the rest from it. For img1 and Img2 it is 0. For img3
it is 8. Thus there is a a nonzero value at u = v = N/2 for Img3. Similar arguments
for other 4 points in (±N/2, ±N/2) where there are non zero values only for img3.

You might also like