Convolution is the process of adding each element of the image to its local neighbors, weighted by the kernel. In other words, this is an element-wise product by the kernel on the sub-matrix, followed by a summation.
Complexity: O(k1*k2*m1*m2) time where k are the dimensions of the kernel and m are the dimensions of the matrix.