title: Masking Green Color in the Image using OpenCV
body: <p>I am trying to Mask Green Color in the image . </p>
  
  <p>Below in the code which, i am using to do it . </p>
  
  <p>Even if the color Hue value is <code>inRange</code> , It is NOT masking the Image . </p>
  
  <pre><code>    cvtInputBGRtoHSV = cv2.imread(inputFileImage)
      maskInput = cv2.inRange(cvtInputBGRtoHSV,(30, 0, 0),(91, 255,255))
      cv2.imwrite(inputFileImage, maskInput)
  </code></pre>
  
  <p>For reference I have attached the Input and Output image . </p>
  
  <p>When I try to Get the HSV value of the Unmasked Green , I am seeing as 121 for range of 360 , so when I convert to 180 Range of Hue ( Which is actually in Python) it will be ~60</p>
  
  <p>Please help me over this and also let me know , if there is any problem</p>
  
  <p><a href="https://i.stack.imgur.com/E8xBW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E8xBW.png" alt="MaskedImage"></a><a href="https://i.stack.imgur.com/ElKbR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ElKbR.png" alt="InputImage "></a></p>