I am currently trying a code which I saw in a youtube tutorial(I specified it in my Github link from above). I see that there are two masks applied but I tried several RGB values and I still can`t get the lighr green pixels(which are exposed to more light). I would like to know what masks should I apply in my code and how can I tell which one is good in any given color extraction.
image_blur = cv2.GaussianBlur(image, (7, 7), 0)
#t unlike RGB, HSV separates luma, or the image intensity, from
# chroma or the color information.
#just want to focus on color, segmentation
image_blur_hsv = cv2.cvtColor(image_blur, cv2.COLOR_RGB2HSV)
# Filter by colour
# 0-10 hue
#minimum red amount, max red amount
min_green = np.array([36, 0, 0])
max_green = np.array([70, 255,255])
#layer
mask1 = cv2.inRange(image_blur_hsv, min_green, max_green)
#birghtness of a color is hue
# 170-180 hue
min_green2 = np.array([188,0,0])
max_green2 = np.array([208,243,139])
mask2 = cv2.inRange(image_blur_hsv, min_green2, max_green2)
#looking for what is in both ranges
# Combine masks
mask = mask1 + mask2
Here is my link to Github where you can find the pictures and the entire code: https://github.com/andreyy03/PlantsRecognition
Thank you!