Python OpenCV显示网络摄像头

import cv2
url = "http://192.168.0.100:8081"
# 打开网络摄像头
cap = cv2.VideoCapture(url)

# 创建可以调节大小的窗口
cv2.namedWindow("video",0)
while(1):
    # 读取一帧,如果有剩余帧ret为ture,否则为false
    ret, frame = cap.read()
    # print(ret)
    cv2.imshow("video",frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
cap.release()
cv2.destroyAllWindows()

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