Professional Documents
Culture Documents
Assignment 2
Assignment 2
Fall 2023
Assignment 2
Due: Friday, Oct 6, 2023, at 11.00 pm
(upload the assignment to eClass)
1. Consider a sampled signal fˆ ( x) with five samples at x 0,1, 2,3, 4 are shown below.
Express mathematically the interpolated signal f ( x) (as a function of x ) in the range
x [0, 4] obtained using:
(i) nearest-neighbor interpolation
(ii) linear interpolation
2. Consider again the sampled signal fˆ ( x) in Question 1. We would like to obtain the
interpolated signal using cubic B-spline approximation.
(i) Determine the B-spline coefficients c[ x], x 0,1, 2,3, 4 using the method discussed in the
class.
[One way to verify the obtained c[.] values is to see if the relationship
f ( x) 16 c[ x 1] 64 c[ x] 16 c[ x 1], x 0,1, 2,3, 4 is satisfied (assume periodic extension
of c[.] at the border, i.e., c[1] c[4] & c[5] c[0] ).]
(ii) Using the B-spline coefficients c[ x] determined in step (i), calculate the interpolated
signal in the interval x [2, 3] .
3. In the following, a 4 4 image is shown, where only the corner pixel values are given. We
need to estimate the values at x locations by interpolating the four corner pixel values.
120 x x 90
x x x x
x x x x
100 x x 80
1
(ii) Using Bilinear interpolation, calculate the values at x locations.
4. Consider the following x-y Cartesian coordinate shown below. The point P, at a distance of r
from the origin, is located at coordinate ( x, y ) . A new point P* with coordinate ( x* , y * ) is
obtained by rotating P clockwise, with respect to the origin, by angle (see the following
figure).
x( )
y ()
(0, 0 ) y ( )
r
P
( x, y)
r
P*
x( ) ( x* , y* )
x* cos sin 0 x
*
y sin cos 0 y
1 0 0 1 1
5. Consider a geometric transformation (shear transform in horizontal direction) with input
image ABCD and output image ABC D as shown. Determine the 3 3 transformation
matrix to obtain the output coordinates from the input coordinates.
A B y ()
(0,0)
x* * * * x
*
y * * * y 50
1 * * * 1 ( x, y ) ( x* , y * )
transform.matrix
C D C D
x ()
2
1 0 r 1
8. Assume that a random variable r with pdf pr (r ) , goes through a
0 otherwise
transformation s T (r ) r / 2 .
(i) Determine, intuitively, the pdf ps ( s ) of the output random variable s . Plot ps ( s ) .
(ii) Calculate the pdf ps ( s ) using the histogram modification equation given in the class.
Does it match with what you obtained in (i)?
1.582e r 0 r 1
9. Assume that an image B has the pdf, pr (r ) shown below.
0 otherwise
(i) Find the transformation s T (r ) that will accomplish histogram equalization. In other
1 0 s 1
words, the pdf of s should be ps ( s ) .
0 otherwise
(ii) Sketch the mapping function s T (r ) .
(iii) Intuitively explain – why would the mapping function equalize the pdf (or histogram)?