OpenCV 使用前置攝影機 1 2 3 4 5 6 7 8 9 10 11 import cv2 as cv cam = cv.VideoCapture(0) while True: ret, frame = cam.read() cv.imshow('cam',frame) if cv.waitKey(1)==ord('q'): break cam.release() cv.destroyAllWindows()