Hello I have to perform 2D convolution of my 32 bit raw image with the following kernel

```
h(x,y)= a(b* exp^(-squareroot(x^2+y^2))

```

I am not sure how to perform it as I am new to coading. My image size is 1024\*768. should I keep the kernel of the same size and perform convolution or I should keep a small kernel ? Will both of them make a difference? If I keep a small kernel , how do I convolute it with the whole image ?

Please help

please check if the code for generating the kernel is right 

Thank you both of you for answering. Please can you check below this code of generating the kernel and then the convolution . I am not sure if I am doing right

int krowhalf=krow/2,kcolhalf=kcol/2;

```
// sum is for normalization
float sum = 0.0;

// generate  kernel
for (int x = -krowhalf; x <= krowhalf; x++)
{
    for(int y = -kcolhalf; y <= kcolhalf; y++)
    {
        r = sqrtl(x*x + y*y);
        gKernel[x + krowhalf][y + kcolhalf] = a*(b*exp(-(r));
        sum += gKernel[x + krowhalf][y + kcolhalf];
    }
}

 //normalize the Kernel
for(int i = 0; i < krow; ++i)
    for(int j = 0; j < kcol; ++j)

gKernel[i][j] /= sum;

  float **convolve2D(float** in, float** out, int h, int v, float **kernel, int kCols,     int kRows)

  {
      int kCenterX = kCols / 2;

      int kCenterY = kRows / 2;

       int i,j,m,mm,n,nn,ii,jj;

     for(i=0; i < h; ++i) 
         // rows
      {
       for(j=0; j < v; ++j)   
   // columns
        {

   for(m=0; m < kRows; ++m)     // kernel rows

    {
       mm = kRows - 1 - m;      // row index of flipped kernel

        for(n=0; n < kCols; ++n) // kernel columns
        {
            nn = kCols - 1 - n;  // column index of flipped kernel

             //index of input signal, used for checking boundary
         ii = i + (m - kCenterY);
          jj = j + (n - kCenterX);

            // ignore input samples which are out of bound
            if( ii >= 0 && ii < h && jj >= 0 && jj < v )

                //out[i][j] += in[ii][jj] * (kernel[mm+nn*29]);
                out[i][j] += in[ii][jj] * (kernel[mm][nn]);

            }
       }
   }
}

```

return out;
}