import cv2 import numpy as numpy cap=cv2.VideoCapture(0) #设置显示分辨率和FPS ,不设置的话会非常卡 cap.set(cv2.CAP_PROP_FRAME_WIDTH,800) cap.set(cv2.CAP_PROP_FRAME_HEIGHT,600) cap.set (cv2.CAP_PROP_FPS,20) while cap.isOpened(): ret,frame=cap.read() # cv2.flip(frame,fr