Created
March 13, 2021 08:27
-
-
Save cydal/a75dd17378c5801341b220fd1670696a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from plantcv import plantcv as pcv | |
from PIL import Image | |
import numpy as np | |
import cv2 | |
img = cv2.imread(img_path) | |
a = pcv.rgb2gray_lab(img, channel='a') | |
img_binary = pcv.threshold.binary(gray_img=a, threshold=120, max_value=255, object_type='dark') | |
greenPlants = pcv.fill(bin_img=img_binary, size=200) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment