How does mac call the camera through open cv2

import cv2 as cv

cap = cv.VideoCapture(0)

while True:
    success, frame = cap.read()

    if success is False:
        print('read video false!')
        exit(0)

    cv.imshow('video', frame)
    if cv.waitKey(1) & 0xFF == ord('q'):
        break
cap.release()
cv.destroyAllWindows()

Press q in the camera capture area to end the video

Guess you like

Origin blog.csdn.net/weixin_45277161/article/details/129759466