import cv2
import os
video_path = os.path.join('D:\9.mp4')
cap = cv2.VideoCapture(video_path)
if cap.isOpened():
opened,frame = cap.read()
cv2.imshow('frame',frame)
else:
open = False
while cap.isOpened():
ret,frame = cap.read()
if frame is None:
break
if ret == True:
gray = cv2.cvtColor(frame,cv2.COlOR_BGR2GRAY)
cv2.imshow('result',gray)
if cv2.waitKey(100) & oxFF == 27:
break
cap.release()#关闭相机
cv2.destroyAllWindows()
报错
gray = cv2.cvtColor(frame,cv2.COlOR_BGR2GRAY) AttributeError: module 'cv2' has no attribute 'COlOR_BGR2GRAY'
感谢帮助