Starting from:

$30

MACHINE VISION-Lab02 Linear filters Solved

 BACKGROUND. 

In Lecture 2 we looked at linear filters. In this exercise you will apply different linear filters to an image and visualise the results. While you can apply this to any image, there is a file cat.png available on Canvas to download and use as input image.

 

Task 1. 

Load the input image and convert it into grayscale. Display both the original and the grayscale image.

 

Task 2. 

Create Sobel filter mask to detect edges in x- and in y-direction. Filter the input image with these masks and display the results.

 

Task 3. 

Create filter masks for the two derivatives of the Gaussian

                                                                    𝜕𝑔𝜎                         𝑥                𝑥2+𝑦2

                                                                                =−      4exp−  2𝜎2

                                                                     𝜕𝑥           2𝜋𝜎

                                                                    𝜕𝑔𝜎                         𝑦                𝑥2+𝑦2

                                                                                =−      4exp−  2𝜎2

                                                                     𝜕𝑦           2𝜋𝜎

using 𝜎=5 and 𝜎=10. Apply those filters to the image and display the results.

 

 

Task 4. 

Calculate the Fourier transform of the input image and display the absolute values of the spectrum as image. Now transform the Fourier spectrum of the image back to the spatial domain and display the resulting image (it should be the same as the input image).

More products