title: I use python3.5 and OpenCV 3.1.0,OpenCV function cv2.countNonZero(img) I got a error
body: <p>I get an error with the following code:</p>
  
  <pre><code>img = cv2.imread('temp.jpg')
  z = cv2.countNonZero(img)
  print(z)
  
  OpenCV Error: Assertion failed (cn == 1) in cv::countNonZero, file D:\Build\OpenCV\opencv-3.1.0\modules\core\src\stat.cpp, line 1342
  Traceback (most recent call last):
    File "C:\Users\hasee\Desktop\open\GuiFeaturesinOpenCV\Performance Measurement and Improvement Techniques\TestTickCount.py", line 29, in &lt;module&gt;
      z = cv2.countNonZero(img)
  cv2.error: D:\Build\OpenCV\opencv-3.1.0\modules\core\src\stat.cpp:1342: error: (215) cn == 1 in function cv::countNonZero
  </code></pre>
  
  <p>But, use if I numpy function it is ok:</p>
  
  <pre><code>z = np.count_nonzero(img)
  print(z)
  </code></pre>
  
  <p>I don't understand why.</p>