def find_yellow_birds():
ps, psx, psy = RS.getPlayingScreen()
lower_pink = np.array([28,197,168])
upper_pink = np.array([29,234,239])
mask = cv2.inRange(ps, lower_pink, upper_pink)
#cv2.imshow('img', mask)
#cv2.waitKey(0)
_, contours, _ = cv2.findContours(mask, 1,2)
# returns true if birds found
for cnt in contours:
if cv2.contourArea(cnt) > 0:
return 1
评论列表
文章目录