求帮助
贴一下代码:
import cv2 as cv
import numpy as np
cap = cv.VideoCapture(0,cv.CAP_DSHOW)
cap.open(0)
while cap.isOpened():
flag, frame = cap.read()
if not flag:
break
key_pressed = cv.waitKey(60)
print('键盘上按下的键是:',key_pressed)
# frame = cv.Canny(frame,100,200)
#frame = np.dstack((frame,frame,frame))
cv.imshow('my_window',frame)
if key_pressed == 27:
break
cap.release( )
cv.destroyALLWindows( )