4.cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) #表示将图片转换为灰度图 代码: import cv2 vc = cv2.VideoCapture('test.mp4') if vc.isOpened(): # 读取视频中的一张图片 ret, frame = vc.read() else: ret = False while ret: ret, frame = vc.read() if ret == True: img = cv2.cvtColor(...