Both task 1 and task 2 is about programming, and the meaning is that you shall implement things from scratch. Use whatever language you want (Matlab or Python is recommended). You can test your implementation by comparing your results against results from built in libraries.

You can find images to test your implementation here (or everywhere else on the internet).

Task 1 - General convolution

Implement a function that convolves an input 2D image and an input 2D filter (with odd side lengths). The result image shall have the same shape as the input image, and you can use zero-padding. If you want, you can implement the function such that it utilizes separable filters.

Task 2 - Gradient information from Sobel filtering

Use the convolution function you made in task 1 to compute the horizontal and vertical gradient component in an image using a Sobel filter (feel free to try other filter sizes also). Use the gradient components to compute the gradient magnitude and the gradient angle.