没有从 Parrot AR Drone 的 cv2.VideoCapture 获取视频
Posted
技术标签:
【中文标题】没有从 Parrot AR Drone 的 cv2.VideoCapture 获取视频【英文标题】:Not getting video from cv2.VideoCapture from Parrot AR Drone 【发布时间】: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()
【问题讨论】:
【参考方案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
【讨论】:
以上是关于没有从 Parrot AR Drone 的 cv2.VideoCapture 获取视频的主要内容,如果未能解决你的问题,请参考以下文章
如何在笔记本电脑上使用 nodejs 连接到 AR Drone
AR Drone系列之:使用ROS catkin创建package并使用cv_bridge实现对ar drone摄像头数据的处理