I am beginner in Python OpenCV and I would like to extract the green color from the attached figure. I use the following code
img = cv2.imread('C:/Python27/Caputure.jpg')
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
lower_green = np.array([84,113,85])
upper_green = np.array([84,113,185])
mask = cv2.inRange(hsv, lower_green, upper_green)
res = cv2.bitwise_and(img,img, mask= mask)
cv2.imshow("img",img)
cv2.imshow("mask",mask)
cv2.imshow("res",res)
cv2.waitKey(0)
However, all I got is a black image!! Is that normal? Do you have any idea why the green is not selected?
Thank you very much.