2D convolution with a with a kernel which is not center originated
问题 I want to do 2D convolution of an image with a Gaussian kernel which is not centre originated given by equation: h(x-x', y-y') = exp(-((x-x')^2+(y-y'))/2*sigma) Lets say the centre of kernel is (1,1) instead of (0,0). How should I change my following code for generation of kernel and for the convolution? int krowhalf=krow/2, kcolhalf=kcol/2; int sigma=1 // sum is for normalization float sum = 0.0; // generate kernel for (int x = -krowhalf; x <= krowhalf; x++) { for(int y = -kcolhalf; y <=