0% found this document useful (0 votes)
255 views7 pages

Ece 565 HW 2 PDF

The document contains answers to 7 questions related to image processing concepts. Key points from the summaries are: 1) It provides an intensity transformation function to map image intensities from original range to [0,L-1]. 2) Setting lower/higher order bit planes to zero affects image histogram by decreasing/increasing some peaks, reducing contrast/darkening the image. 3) It proves that the 2D Laplacian operator is isotropic by showing derivatives are invariant to rotation. 4) It derives an intensity transformation between two given PDFs to accomplish histogram equalization. 5) It calculates the unnormalized and normalized histograms for an example image in a table with pixel counts. 6

Uploaded by

Quỳnh Nga
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)
255 views7 pages

Ece 565 HW 2 PDF

The document contains answers to 7 questions related to image processing concepts. Key points from the summaries are: 1) It provides an intensity transformation function to map image intensities from original range to [0,L-1]. 2) Setting lower/higher order bit planes to zero affects image histogram by decreasing/increasing some peaks, reducing contrast/darkening the image. 3) It proves that the 2D Laplacian operator is isotropic by showing derivatives are invariant to rotation. 4) It derives an intensity transformation between two given PDFs to accomplish histogram equalization. 5) It calculates the unnormalized and normalized histograms for an example image in a table with pixel counts. 6

Uploaded by

Quỳnh Nga
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
You are on page 1/ 7

Homework-2

1. Give a single intensity transformation function for spreading the intensities of an


image so the lowest intensity is 0 and the highest is 𝐿−1.

ANS: Let f denote the input function. Subtracting the minimum value f min from the input
function to get the value of function whose minimum is less than 0
g 1​ = f − f min
Divide the value of g with the maximum value and multiply the function with [L − 1] to get the
values ranging from [0, L − 1] .
g1
g = [L − 1] max(g1)

[L−1]
g = f − f min f − f min
This is the intensity transformation function.

2. Consider the histogram of an image:


(a). What would be the effect on the histogram in general if we set to zero the
lower-order bit planes of the image?

Ans: By setting the lower order bit plane of the input image to zero the number of pixels
having different intensity levels would decrease thus some of the histogram peaks will
increase. This will reduce the contrast of the image.

(​b). What would be the effect on the histogram if we set zero the higher-order bit
planes instead?

Ans: By setting the higher order bit of the image planes to zero the histogram will
become more narrower than wider reducing the brightness of the image (or) darkening
the image, thus all the pixel intensity values are set below 127 making the histogram
narrower and taller.

3. Show that the 2-D Laplacian operator is isotropic (invariant to rotation). You will need
the following equations relating coordinates for axis rotation by an angle 𝜃:
𝑥=𝑥′𝑐𝑜𝑠𝜃−𝑦′𝑠𝑖𝑛𝜃
𝑦=𝑥′𝑠𝑖𝑛𝜃+𝑦′𝑐𝑜𝑠𝜃

Ans: Laplacian operator is defined as


∂2 f ∂2 f
∇2f = ∂x2
+ ∂y 2
For coordinates that are unrotated the laplacian is given by;
2 ∂2 f ∂2 f
∇ f= ∂x′2
+ ∂y ′2
For rotated coordinates the it is given by;
𝑥=𝑥′𝑐𝑜𝑠𝜃−𝑦′𝑠𝑖𝑛𝜃
𝑦=𝑥′𝑠𝑖𝑛𝜃+𝑦′𝑐𝑜𝑠𝜃
Here 𝚹 is the angle of rotation. To prove that the 2D laplacian operator is isotropic we
have to show that the unrotated and rotated equations are equal.
f f x f y
x′ = x x′ + y ′ x′

f f
= x cos + y sin
Partial derivative w.r.t x′

2 2 2
f f f f f
x′ 2 = x2
cos2 + x ( y )sincos + y ( x )sincos + y2
sin2

Similarly,
f f x f y
y′ = x y′ + y′ y′

f f
=− x sin + y cos
Taking second derivative,

2 2 2
f f f f f
y′ 2 = x2
sin2 − x ( y )sincos − y ( x )sincos + y2
cos2
Adding both the derivatives we get the following,

2 2 2 2
f f f f
x′ 2 + y2 = 2 + y2
′ x

This proves that the laplacian operator is independent of the rotation dynamics.

4. An image with intensities in the range [0, 1] has the PDF 𝑝𝑟(𝑟) shown below. It is
desired to transform the intensity levels of this images so that they will have the
specified PDF 𝑝𝑧(𝑧) shown. Assume continuous quantities and find the transformation
in terms of 𝑟 and 𝑧 that will accomplish this.

Ans: An image with intensities in the range of [0,1] has Probability Density function
(PDF) p r (r) and the required PDF after transformation be pz (z) .
We know that histogram equalization for an image is given by
r r
s = T (r) ∫ p r (w) dw = ∫(− 2w + 2)dw = − r2 + 2r
0 0
Also ,
z z
v = G(z) = ∫ P z (w) dw = ∫ 2wdw = z 2
0 0
This means that z = G−1 (v) = ± √v
Here v has both positive and negative intensity levels but since we are performing
equalization, only positive intensity levels are allowed so we take the value of z = √v
and plugging in the value of v as − r2 + 2r , we get
z = √− r2 + 2r
5. Obtain the unnormalized and the normalized histograms of the following 8-bit 𝑀×𝑁
image. Show the histogram in a table labeling clearly the values of each histogram
component in terms of 𝑀 and 𝑁.

Ans: Given that the image has MxN pixels, therefore the total number of pixels is M N .
there are 4 divisions on the width axis and 3 divisions on the height axis i.e. M has 3
divisions and N has 4 divisions. So the number of pixels in a localized square is
( M3 )( N4 ) = MN
12 . ​Therefor, the number of pixels having each intensity value can
be calculated using this for an unnormalized histogram
Pixels with value 127 = M12N
Pixels with values 16 = M6N
Similarly to find the normalized values of histogram we just have to divide the
unnormalized value by MN.
And so on, the calculated normalized and unnormalized values are given below in a table

Pixel Intensity Number of Pixels Un-normalized Normalized


value Histogram histogram values
components

0 MN/4 MN/4 0.25

16 MN/6 MN/6 0.166

32 MN/12 MN/12 0.083

127 MN/12 MN/12 0.083

191 MN/12 MN/12 0.083

228 MN/12 MN/12 0.083

240 MN/6 MN/6 0.166

255 MN/12 MN/12 0.083

6. Show that the Fourier transform and its inverse are linear processes.
Ans​: To prove that the fourier transform and the inverse fourier is linear, as per linearity
property
[a1 f 1 (x, y ) + a2 f 2 (x, y )] = a1 [f 1 (x, y )] + a2 [f 2 (x, y )]
Here a and b are arbitrary constants.
From definition of the 2D fourier
M −1 N −1
1
[a1 f 1 (x, y ) + a2 f 2 (x, y )] = MN
∑ ∑ [a1 f 1 (x, y ) + a2 f 2 (x, y )] e−j2π((ux/m)+(vy/m))
0 0
Where M,N is the image pixels MxN.
M −1 N −1 M −1 N −1
1
= MN
∑ ∑ [a1 f 1 (x, y )]e−j2π((ux/m)+(vy/m)) + 1
MN
∑ ∑ [a2 f 2 (x, y )] e−j2π((ux/m)+(vy/m))
0 0 0 0
= a1 [f 1 (x, y )] + a2 [f 2 (x, y )]

Hence proved that the fourier transform is linear.

7. Prove the validity of the convolution theorem for 1-D signals. That is,
()∗()↔()()

Ans: ​By definition of convolution theorem;


+∞
()∗() = ∫ f (x) g(y − x) dx
−∞
Taking fourier transform we get,
+∞ +∞
∫ [ ∫ f (x) g(y − x) dx e−i2πuy dy
−∞ −∞
By taking the nested integrations as summations we get
+∞ +∞
∫ f (x)[ ∫ g(x − y)e−i2πuy dy]dx
−∞ −∞
With shifting property and considering the function f (x) as it is being integrated with
respect to y
+∞
∫ g(y − x)e−i2πuy dy = F [g(y − x)] = e−i2πux G(u)
−∞
+∞ +∞ ∞
∫ f (x)[ ∫ g(x − y)e −i2πuy
dy]dx = ∫ f (x) e−i2πux dx ˙G(u)dx
−∞ −∞ −∞
= F (u)G(u)
Therefore the convolution of ​ ()∗() ​is equal to F (u).G(u) .

8. Show the validity of the following translation properties of 2-D discrete Fourier
transform pairs.
a. (, )2(0 /+0 /) ↔(−0 , −0 )
b. ( − x0 , − y 0 )↔(, )2(x0 u/+y0 v/)

Ans: ​consider the input function f (x, y ) and it is translated by x​0 and
​ y​0
f (x, y ) → f (x − x0 , y − y 0 )
Taking fourier transform
j2π
1 ∑ ∑ f (x − x0 , y − y 0 )e N (u(x−x0 )+v(y−y0 ))
(u, v ) = N
−j2π
(u, v ) = F (u, v ).e N (ux0 +vy 0 )

Similarly the inverse fourier transform also yields a similar result



F (u − u0 , v − v 0 ) = f (x, y )ej N (ux0 +vy0 )
Therefore we arrive with the following properties as the shift x​0​,y​0 does not change
Fourier Spectrum but adds phase difference
(, )2(0 /+0 /) ↔(−0 , −0 )

( − x0 , − y 0 )↔(, )2(x0 u/+y0 v/)


9. Show the validity of the following 2-D discrete Fourier transform pairs.

−2(0+0)
a. (−0 , −0 )↔

Consider the delta function δ (x − x0 , y − y 0 )


Taking fourier transform of the delta function;
∞ ∞
{δ(x − x0 , y − y 0 )} = ∫ ∫ δ (x − x0 , y − y 0 )e−j2π(ux+vy) dxdy
−∞ − ∞
As per shifting property we get that
∞ ∞
∫ ∫ δ (x − x0 , y − y 0 )e−j2π(ux+vy) dxdy = e−j2π(ux0 +vy0 )
−∞ − ∞
Thus proven;
{δ(x − x0 , y − y 0 )} = e−j2π(ux0 +vy0 )
Also due to linearity the converse will also be true, thus we get
{δ(x − x0 , y − y 0 )} ↔ e−j2π(ux0 +vy0 )

2πu0 x 2πv 0 y MN
b. cos( M + N ) ⇔ 2 [δ(u + u0 , v + v 0 ) − (δ(u − u0 , v − v 0 )]
Ans: ​we know that the fourier transform of a impulse function f (u, v) in the frequency
domain is;
F (u, v ) = δ (u − u0 , v − v 0 )
Its inverse transform is
∞ ∞
f (x, y ) = ∫ ∫ δ(u − u0 , v − v0 )ej2π(ux+vy) dxdy
−∞ −∞
u x v y
Now instead of f (x, y ) we put cos(2π( M0 + N0 )) , taking fourier transform we get the
following result for the fourier transform pair:
u x v0 y 1
{cos(2π( M0 + N ))} = 2 [(M N )[δ(u + u0 , v + v 0 ) − δ (u − u0 , v − v 0 )]]
Similarly the inverse is also true because of the linearity and shifting property, hence the
fourier transform pair is proven;

u x v0 y MN
{cos(2π( M0 + N ))} ⇔ 2 [δ(u + u0 , v + v 0 ) − δ (u − u0 , v − v 0 )]

10. Consider a 3×3 spatial filter that averages the four closest neighbors of a point (𝑥,𝑦) but
excludes the point itself from the average. Find the equivalent filter in the frequency domain.

Ans: given that the 3 x 3 filter averages the four closest neighbours alone, therefore the points
will be like (x+1,y),(x,y+1),(x-1,y),(x,y-1). Therefore the spatial average is given by,

1
g (x, y ) = 4 [f (x, y + 1) + f (x + 1, y ) + f (x − 1, y ) + f (x, y − 1)]

−j2π(ux0 /m +vy 0 /N )
By using the following property f (x − x0 , y − y 0 ) ⇔ F (u, v )e we get the
following answer after taking fourier transform on both sides,

j2πv j2πu −j2πu −j2πv


1
G(u, v ) = 4 [e
N +e M +e N +e M ]F (u, v )

= H(u, v )F (u, v )
Here H (u, v ) is the filter’s transfer function and the function after simplification is given by,

1
H (u, v ) = 4 [cos(2πu/M ) + cos(2πv/N )]
​This filter can be represented as follows in the frequency domain;
H (u, v ) = 12 [cos(2π(u − M /2)/M ) + cos(2π(v − N /2)/N )]

This is the function that is similar to that of a low pass filter.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy