title: Grayscale image segmentation
body: <p>I'm trying to segment a grayscale picture generated from field measurements, that is why it is not a conventional 3-channel picture.</p>
  
  <p>I have tried this piece of code:</p>
  
  <pre><code>import cv2 #this is the openCV library
  import numpy as np
  
  # some code to generate img
  
  ret,thresh = cv2.threshold(img ,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
  </code></pre>
  
  <p>And it spits out this error:</p>
  
  <pre><code>cv2.error: ..\..\..\modules\imgproc\src\thresh.cpp:719: error: (-215) src.type() == CV_8UC1 in function cv::threshold
  </code></pre>
  
  <p>I have no idea on how to solve this since the usage seems to be pretty straight forward, so any idea is welcome.</p>