title: How to find the Gaussian Weighted-Average and Standard deviation of a structural element
body: <p>I'm trying to implement an Intensity Normalization algorithm that is described by this formula:</p>
  
  <p>x' = (x - gaussian_weighted_average) / std_deviation</p>
  
  <p>The paper I'm following describes that I have to find the gaussian weighted average and the standard deviation corresponding to each pixel "x" neighbors using a 7x7 kernel.</p>
  
  <p>PS: x' is the new pixel value.</p>
  
  <p><a href="https://i.stack.imgur.com/TNHI8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TNHI8.png" alt="enter image description here"></a></p>
  
  <p>So, my question is: how can I compute a gaussian weighted average and the standard deviation for each pixel in image using a 7x7 kernel?</p>
  
  <p>Does OpenCV provide any method to solve this?</p>
  
  <pre><code>import cv2
  img = cv2.imread("b.png", 0)
  widht = img.shape[0]
  height = img.shape[1]
  for i in range (widht):
      for j in range (height):
          new_image = np.zeros((height,width,1), np.uint8)
          new_image[i][j] = img[i][j] - ...
  </code></pre>