def yellowgrayscale(image):
#enhance yellow then find grayscale
#image = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)
# define range of yellow color in HSV
#lower = np.array([40,40,40])
#upper = np.array([150,255,255])
#RGB limits
lower = np.array([80,80,40])
upper = np.array([255,255,80])
# Threshold the HSV image to get only yellow colors
mask = cv2.inRange(image, lower, upper)
#show_image('mask',mask)
# Bitwise-AND mask and original image
res = cv2.bitwise_and(image,image, mask= mask)
res = cv2.addWeighted(res, 1.0, image, 1.0, 0)
res = grayscale(res)
return res
project3.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录