【问题标题】:ret, frame = video_capture.read() ValueError: too many values to unpack (expected 2)ret, frame = video_capture.read() ValueError: 要解压的值太多(预期为 2)
【发布时间】:2020-12-09 16:35:17
【问题描述】:

我想在基于微小人脸检测的项目中使用 IP cam 而不是网络摄像头。

video_capture = cv2.VideoCapture(0)
video_capture=VideoStream("rtsp://admin:bilge06@10.374.140.132:554").start()

【问题讨论】:

    标签: python opencv deep-learning face-recognition


    【解决方案1】:

    对于 Python

    capture= cv2.VideoCapture("rtsp://admin:bilge06@10.374.140.132:554")
    
    if not capture:
        print("Failed")
    else:
       ret, frame= capture.read()
    
    

    在 C++ 中 您需要将代码更改为

    VideoCapture capture;
    Mat ImageMat;
    bool op = capture.open("rtsp://admin:bilge06@10.374.140.132:554");
    if(op)
    {
        capture >> ImageMat;
    }
    

    它将从流中读取。要检查流是否正常工作,您可以使用 VLC 播放器并在网络流中设置 IP,它会验证它

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-04-19
      • 2014-07-31
      • 1970-01-01
      • 2016-09-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多