【问题标题】:Not getting video from cv2.VideoCapture from Parrot AR Drone没有从 Parrot AR Drone 的 cv2.VideoCapture 获取视频
【发布时间】:2016-08-05 02:21:00
【问题描述】:

我没有收到来自 Parrot AR Drone 的 cv2.VideoCapture 的视频:ret 始终是 False

import numpy as np
import cv2

cap = cv2.VideoCapture("tcp://192.168.1.1:5555")

ret, frame = cap.read()

print ret

cap.release()
cv2.destroyAllWindows()

【问题讨论】:

    标签: python opencv ar.drone


    【解决方案1】:
    I am not used to Python, but If it was in Windows I will first check whether cap is getting frames from the given IP Address using:
    
    if(!cap.IsOpened())
    {
    cerr <<"No video Frames were read, please check your IP and Port" <<endl;
    return -1;
    }
    
    This will easily help me know whether I am fetching from the Drone or not.
    
    //Secondly, we have to check for the case where we are able to fetch from the drone..
    
    while(true)
    {
    cap >>frame;
    char c = waitkey(10);
    if( c== 27) break
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-12-25
      • 2020-09-01
      • 2021-12-20
      • 2021-06-11
      • 2021-07-17
      • 2021-04-06
      • 1970-01-01
      相关资源
      最近更新 更多