import cv2 import numpy as np def get_leave_areas(image): img = cv2.imread(image) GrayImage = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ret, threshed_img = cv2.threshold(GrayImage, 160, 255,cv2.THRESH_BINARY) # 二值化, 阈值偏高 image, contours, hierarchy = cv2.…