title: Why is output image black after normalization?
body: <p>I have many grayscale images that I want to normalize by using mean and standard deviation. I use the following process:</p>
  
  <ol>
  <li><p>Calculate the image's mean and standard deviation.</p></li>
  <li><p>Subtract the mean from the image.</p></li>
  <li><p>Divide the resulting image by the standard deviation.</p></li>
  </ol>
  
  <p>However, I got a black image as a result. What is wrong in my code? </p>
  
  <pre><code>    import cv2
  
      img = cv2.imread('E.png')   # read an image 
      gray_image = cv2.cvtColor(img , cv2.COLOR_BGR2GRAY)  # converting the image to grayscale image
      img = cv2.resize(gray_image, (60, 60))  # Resize the image to the size 60x60 pixels
  
      cv2.imwrite("Grayscale Image.png",img)  #To write the result  
  
      mean, stdDev = cv2.meanStdDev(img)  #Get Mean and Standard-deviation
      image = (img-mean)/stdDev  #Normalization process
  
      cv2.imwrite("Normalized Image.png",image)  #To write the result 
  </code></pre>
  
  <p>Input image : <img src="https://i.ibb.co/GnS3r4n/E.png" alt="i1"></p>
  
  <p>Grayscale output: <img src="https://i.ibb.co/9hRwMzt/Grayscale-Image.png" alt="i2"></p>
  
  <p>Normalized image output: <img src="https://i.ibb.co/R0G8xnp/Normalized-Image.png" alt="i3"></p>