简体   繁体   English

如何将PTAM的视频源更改为IP摄像机?

[英]How to change PTAM's video source to an IP camera?

I am currently working on PTAM(Parrallel tracking and mapping), successfully compiled it on windows with visual studio 2008, also had managed to change the video source to normal usb webcam with EWC libarary from default CMU1394 camera driver. 我目前正在研究PTAM(Parrallel跟踪和映射),并在Visual Studio 2008上成功地在Windows上对其进行了编译,还设法将视频源更改为具有EWC libarary的普通USB网络摄像头(从默认的CMU1394相机驱动程序开始)。

However I am trying to find a way to access the video source to the ip camera from Parrot ARDrone 2.0 (even though I am able to access the ardrone camera with both opencv and FFmpeg individually, don't how to link them all together), through search on the web I couldn't find much resources. 但是,我试图找到一种从Parrot ARDrone 2.0访问视频源到ip摄像机的方法(即使我能够分别使用opencv和FFmpeg来访问ardrone摄像机,也不要将它们全部链接在一起),通过网络搜索,我找不到太多资源。 If there is someone who working on PTAM, can possibly share some ideas of changing the PTAM video source to an ip camera or ardrone camera. 如果有人在做PTAM,可能可以分享一些将PTAM视频源更改为IP摄像机或ardrone摄像机的想法。

Many thanks 非常感谢

You don't need openCV to gather the PaVE packets and decode them. 您不需要openCV来收集PaVE数据包并对其进行解码。 You can do that with FFMPEG alone (I recommend two threads, one is a client, the other the h264 decoder). 您可以单独使用FFMPEG来做到这一点(我建议使用两个线程,一个是客户端,另一个是h264解码器)。 However, converting the image data to a cv::Mat from openCV is extremely useful and gives you access to all of openCV's powers. 但是,将图像数据从openCV转换为cv :: Mat非常有用,并且可以访问openCV的所有功能。

You convert to a cv::Mat as follows: 您将转换为cv :: Mat,如下所示:

cv::Mat img(height,width,CV_8UC3,pictureBGR->data[0]);

where pictureBGR is the AVFrame pointer you received back from FFMPEG's avcodec_decode_video2() and sws_scale() 其中pictureBGR是您从FFMPEG的avcodec_decode_video2()和sws_scale()返回的AVFrame指针

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM