import cv2 cap = cv2.VideoCapture(1) cap.set(3, 640) cap.set(4, 480) while (cap.isOpened()): # 获取一帧 ret, frame = cap.read() ##图像处理 frame1 = cv2.flip(frame, 1) gray = cv2.cvtColor(frame1, cv2.COLOR_BGR2GRAY) canny = cv2.Canny(gray, 80, 150) cv2.imshow('frame', canny) if cv2.waitKey(1) == ord('q'): break cap.release() cv2.destroyAllWindows()
自己的笔记
最新推荐文章于 2024-11-08 18:13:56 发布