title: OpenCV Python calcHist
body: <p>I would like to calculate <strong><code>image histogram with OpenCV's calcHist function with Python</code></strong>.<br> But it doesn't work.</p>
  
  <p>Code:</p>
  
  <p><code>im = cv2.imread(imPath,0)
   hist = cv2.calcHist([im],[0],None,[256],[0,256])</code></p>
  
  <p>And I get <strong>error</strong> like this:</p>
  
  <pre><code>OpenCV Error: Assertion failed (step(dims[-1] == (size_t) CV_ELEM_SIZE(flags)) 
  in create, file opencv/sources/modules/core/src/matrix.cpp line:236
  </code></pre>