title: Thresholding of a grayscale Image in a range
body: <p>Does OpenCV <code>cv.InRange</code> function work only for RGB images?Can I do thresholding of grayscale image using this function?</p>
  
  <p>I got an error,Following is my code:</p>
  
  <pre><code>   import cv2
     image=cv2.imread("disparitySGB.jpg")
     thresh=cv2.inRange(image,190,255);
  </code></pre>
  
  <p>It gives the following error:  </p>
  
  <blockquote>
    <p>thresh=cv2.inRange(image,190,255);    TypeError: unknown is not a
    numpy array</p>
  </blockquote>
  
  <p>I tried fixing it by:</p>
  
  <pre><code>  thresh=cv2.inRange(image,numpy.array(190),numpy.array(255));
  </code></pre>
  
  <p>Now there is no error but it produces black image.</p>