c++ code for convolving images using a convolution kernel