You are on page 1of 3

ECSE 415: Introduction To Computer Vision

Assignment 1
Due Date: Thursday, Jan. 26th, 2017
Q1 Perspective Projection [15%]:
Consider the following perspective projection where point P=[x , y , z ]T is projected onto an
image plane ' at a distance f ' as shown by the figure 1 below. The three coordinate axes are
resprented as i, j, k . Consider the following projection of a ray in the world coordinate system
P=[4,2, 0]T +t [0, 1, 2]T
where <t <1 . Calculate the coordinates of the endpoints of the projection ray ( P) onto the
image plane ( ' ) .

Figure 1 Perspective Projection

Q2 Thin Lens Equation [15%]:


An illuminated arrow forms a real inverted image of itself at a distance w=110cm measuring
along the optical axis of a thin lens model. The projected image is half the size of the original object.
The following description is shown in figure 2 below.

Figure 2 Thin Lens Equation

1)
2)
3)

How far from the original object must the thin lens be placed?
What is the focal length of the lens?
Suppose the arrow moves x cm to the right while the lens and image place remain fixed. This
process would result in an out-of-focus image. Assuming we know the diameter of the thin lens
is d , what is the radius of the corresponding blur circle formed from the tip of the arrow
projected onto the image plane?

Q3 Denoising [15%]:
The following 5 x 5 image shown in figure 3 below is subject to random, i.e. Salt-andPepper noise. Complete the following tasks:
1)
2)
3)

Reduce the effects of the noise by applying a local averaging filter over a 3 x 3 kernel.
Specify the kernel used.
Apply a median filter over a 3 x 3 kernel.
Discuss the advantages and disadvantages of both techniques.

Note: It is required to zero-pad the image before convolutions.

Figure 3 Denoising

Results of Local Averaging Filter

Results of Medium Filter

Q4 Implementation [55%]:
Take three images of the same scene with slight variations, e.g. rotating the camera slightly
between images. Select the images carefully as they will be used in this assignment in addition to future
assignments. Choose one of the three images and using opencv functions convert the image from RGB
colourspace to grayscale. If the resolution of your image is high, it may be helpful to resize the image
into a smaller resolution, e.g. 640 x 480 . For a lot of image processing tasks these preprocessing
steps are fairly common.
The following image processing functions are to be completed in python/opencv without the aid
of higher level opencv functions. All tasks should be implemented by hand using nested for-loops.
1)

Convolution function with an arbitrary 3 x 3 kernel as specified by the user. Similar to Q3


the user should zero-pad the image before convolutions. The results of the convolution function
should be limited to 256 gray levels.

2)

Sobel edge detection algorithm (magnitude and direction). Devise a method of displaying the
directional information to the user (e.g. pseudo-colour).

3)

Binary image transformation based on image histogram. The image histogram provides a
graphical representation of the colour distribution in an image. For each pixel intensity it
provides the number of pixels at that intensity. Image histograms are useful in many
applications, for this case we are using this information to transform an image from grayscale to
binary (black/white). First, calculate and plot the histogram for your selected image. Using the
information provided by the image histogram, select a threshold level to transform your image
into a binary image.

You might also like