title: Plotting histogram of vertical projection of an image
body: <p>Looking for plotting a historgram in a vertical projection of an image</p>
  
  <pre><code>def verticalProjection(img):
     "Return a list containing the sum of the pixels in each column"
     (h, w) = img.shape[:2]
     sumCols = []
     for j in range(w):
         col = img[0:h, j:j+1] # y1:y2, x1:x2
         sumCols.append(np.sum(col))
     return sumCols
  def slice_digits(image_name):
      img = cv2.imread(image_name, 0)
      img = cv2.bitwise_not(img)
      y = verticalProjection(img)
      height_hist = np.histogram(y, bins=500)
      plt.hist(height_hist, bins=500, normed=True)
  
      plt.show()
      plt.plot(y)
  </code></pre>
  
  <p>I'm expecting a histogram that shows the various heights of an image. 
  The image example is here:
  <a href="https://i.stack.imgur.com/gnikj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gnikj.png" alt="enter image description here"></a></p>
  
  <p>That should show a different heights, but I don't get that result, what I'm doing wrong ?</p>
  
  <p>That's what I get</p>
  
  <p><a href="https://i.stack.imgur.com/SlxyL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SlxyL.png" alt="enter image description here"></a></p>
  
  <p>Actually a correct histogram should show various characters with different height, but that doesn't seem to work with my code.</p>