自己的笔记

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()

你可能感兴趣的:(opencv,深度学习)