Session Ready
Exercise

Image convolutions

The convolution of an image with a kernel summarizes a part of the image as the sum of the multiplication of that part of the image with the kernel. In this exercise, you will write the code that executes a convolution of an image with a kernel using Numpy. Given a black and white image that is stored in the variable im, write the operations inside the loop that would execute the convolution with the provided kernel.

Instructions
100 XP
  • Select the right window from the image in each iteration and multiply this part of the image with the kernel.
  • Sum the result and allocate the sum to the correct entry in the output array (results).