title: Different results with cv2.GaussianBlur and cv2.filter2D with a gaussian kernel?
body: <p>I am trying to port some lua/torch code in Python, there's a sequence that runs a Gaussian blur over an image as follows:</p>
  
  <pre><code>local gauK = image.gaussian(math.ceil(3*sigma)*2+1, sigma)
  inp = image.convolve(inp, gauK, 'same')
  </code></pre>
  
  <p>To replicate this in my approach, I have been looking at cv2.GaussianBlur() and cv2.filter2D with passing in a gaussian kernel. </p>
  
  <p>Method 1 (cv2.GaussianBlur):</p>
  
  <pre><code>kernel_size = int(math.ceil(3 * sigma) * 2 + 1)  # same size as the lua code
  blurred_image = cv2.GaussianBlur(img, ksize=(kernel_size, kernel_size), sigma)
  </code></pre>
  
  <p>Method 2 (cv2.filter2D)</p>
  
  <pre><code>kernel_size = int(math.ceil(3 * sigma) * 2 + 1)  # same size as the lua code
  gaussian_kernel = cv2.getGaussianKernel(kernel_size, sigma)
  blurred_image_2 = cv2.filter2D(img, -1, gaussian_kernel)
  </code></pre>
  
  <p>Between Method 1 &amp; Method 2, I get different images. It appears that the Method 1 image is a bit more blurred than in Method 2. Is there any reason why I might be getting different results here? I am trying to figure out which one would match the lua code. Thanks.</p>