【发布时间】:2019-09-13 20:23:22
【问题描述】:
我是打开 cv 并试图检测我的图像中是否存在绿色的新手。
我的 cv2.range 中有颜色上限和颜色下限。当我用 cv2.bitwise_ 打开并看到颜色时,它显示有绿色,但我不知道如何打印绿色是否存在
hsv_image= cv2.cvtColor(img,cv2.COLOR_BGR2HSV)
lg = np.array([56,255,251])
ug = np.array([60,255,255])
gmask = cv2.inRange(hsv_image,lg ,ug)
color = cv2.bitwise_and(img,img,mask=gmask)
if gmask.equals(img):
print("green exist")
else:
print("not found")
我希望看到输出绿色存在于给定图像中
【问题讨论】:
标签: python image opencv image-processing computer-vision