1 | initial version |
unfortunately, you cannot do this directly, but have to create 2 seperate masks, [150,180] and [0,30] , then combine them, like:
# -30 to 0
image_lower_hsv = np.array([150, 200, 220])
image_upper_hsv = np.array([180, 255, 255])
imageMask1 = cv2.inRange(imageHSV, image_lower_hsv, image_upper_hsv)
# 0 to 30
image_lower_hsv = np.array([0, 200, 220])
image_upper_hsv = np.array([30, 255, 255])
imageMask2 = cv2.inRange(imageHSV, image_lower_hsv, image_upper_hsv)
# combine masks
finalMask = cv2.bitwise_or(imageMask1, imageMask2)