title: Error getting for src type CV_8UC3 to CV_8UC1 in OpenCV Python?
body: <pre class="lang-py prettyprint-override"><code>import cv2 as cv
  import numpy as np
  from matplotlib import pyplot as plt
  
  img = cv.imread('t2.jpg', cv.COLOR_BGR2GRAY)
  
  blur = cv.GaussianBlur(img, (5, 5), 0)
  ret3, th3 = cv.threshold(blur, 0, 255, cv.THRESH_BINARY + cv.THRESH_OTSU)
  </code></pre>
  <p><strong>I get the error:</strong></p>
  <pre><code>Traceback (most recent call last):
    File &quot;F:/l4 project docs/project/l4proTest1/projectionStepTest.py&quot;, line 11, in &lt;module&gt;
      ret3,th3 = cv.threshold(blur, 0, 255, cv.THRESH_BINARY + cv.THRESH_OTSU)
  cv2.error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-9d_dfo3_\opencv\modules\imgproc\src\thresh.cpp:1557: error: (-2:Unspecified error) in function 'double __cdecl cv::threshold(const class cv::_InputArray &amp;,const class cv::_OutputArray &amp;,double,double,int)'
  </code></pre>
  <pre><code>THRESH_OTSU mode:
      'src_type == CV_8UC1 || src_type == CV_16UC1'
  where
      'src_type' is 16 (CV_8UC3)
  
  Process finished with exit code 1
  </code></pre>