Computer Vision 1 – AI Assignment2 Linear Filters: Gaussians and Derivatives (Solution)

$ 29.99
Category:

Description

1 Gaussian Filters
In this section, you will be working with Gaussian filters and applying them to images, exploiting their separability property.
1.1 1D Gaussian Filter
In this first part, you will be implementing a 1D discrete Gaussian filter:
, (1)
where σ is the standard deviation of the Gaussian distribution.
[3 points] Implement a MATLAB function with two arguments, standard deviation (σ) and kernel length. The function prototype should be in the following form:
function G = gaussian(sigma, kernelLength) … end
Compare your function with MATLAB’s built-in fspecial. What are the differences?
1.2 Convolving an image with a 2D Gaussian
Gaussian kernels possess a powerful property called separability. It provides computational advantages as the complexity of convolution process is reduced to O(n) from O(n2), where n is the kernel length. Using this property convolving an image with a 2D Gaussian kernel becomes equivalent to convolving an image
1
with two 1D Gaussian kernels in x and y directions in an ordered fashion. Equation (2) illustrates the decomposition of a 2D kernel into two 1D kernels.
(2)
[4 points] You are responsible with the implementation of a function which handles the convolution operation between an image and a 2D Gaussian (filter) kernel. The function calls the method you implemented in the first part. Prototype looks like this:
function imOut = gaussianConv(im_path,sigma_x,sigma_y) … end
Hint: See MATLAB’s conv2.
Call conv2 with different options such as ’full’, ’valid’ and ’same’. Explain in your report, briefly, what each corresponds to.
Show that the outputs of convolution with the 2D kernel (i.e. the one corresponding to the two 1D kernels) and convolution with 1D kernels are essentially the same. Use kernel length of 11. Report the numerical equivalence as well as plots at every stage of filtering pipeline.
Explain the benefits of kernel separability, shortly.
1.3 Gaussian Derivative
The Gaussian first order derivative is given by:
(3)

[3 points] Write a function which implements this first order derivative and applies it on a given image. Your function should look like this:
function [imOut Gd] = gaussianDer(image_path,G,sigma) … end
Plot the derivative of Gaussian with a σ of your choice in range [−5σ,5σ]
Use your function to find out the effect of σ. Try a range of values for the standard deviation and report your observations.
Give an example of the Gaussian derivative in terms of application.
2

Reviews

There are no reviews yet.

Be the first to review “Computer Vision 1 – AI Assignment2 Linear Filters: Gaussians and Derivatives (Solution)”

Your email address will not be published. Required fields are marked *