调用的Gstreamer里面的OpenCV [英] Calling Gstreamer inside openCV

查看:1654
本文介绍了调用的Gstreamer里面的OpenCV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要打电话Gstremaer的OpenCV的code内(基本上是打开一个视频摄像头)。
当我通过源$ C ​​$ C望去,模块/ highgui / src目录/ cap_gstreamer.cpp 似乎是我要找的文件。

I need to call Gstremaer inside an openCV code (opening a video camera essentially). As I looked through the source code, modules/highgui/src/cap_gstreamer.cpp seems to be the file I'm looking for.

我编的OpenCV在GStreamer标志。

I compiled OpenCV with Gstreamer flag.

 GStreamer:
--       base:                      YES (ver 1.2.3)
--       video:                     YES (ver 1.2.3)
--       app:                       YES (ver 1.2.3)
--       riff:                      YES (ver 1.2.3)
--       pbutils:                   YES (ver 1.2.3)

但我不能调用的Gstreamer相关的功能(例如: cvCreateCapture_GStreamer 这是在 cap_gstreamer.cpp
cap_gstreamer.cpp 已成功建成OpenCV的安装日志提示:

but I'm not able to call a Gstreamer-related functions (e.g. cvCreateCapture_GStreamer which is defined inside cap_gstreamer.cpp) cap_gstreamer.cpp was built successfully as the opencv install log suggested:

[ 17%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_gstreamer.cpp.o

cvCreateCapture_GStreamer 也$在 /usr/local/lib/libopencv_highgui.so.3.0.0 OpenCV的建设后,
(发现使用的grep

cvCreateCapture_GStreamer is also present inside /usr/local/lib/libopencv_highgui.so.3.0.0 after building openCV (found that using grep)

我用的#include< OpenCV的/ highgui.h> 但调用 cvCreateCapture_GStreamer 失败( -lopencv_highgui 标志设置Makefile里):

I use #include <opencv/highgui.h> but calling cvCreateCapture_GStreamerfails(-lopencv_highgui flag is set inside the Makefile):

error: ‘cvCapture_GStreamer’ was not declared in this scope

任何建议将是有益的,大大AP preciated。

Any suggestions would be helpful and greatly appreciated.

谢谢!

推荐答案

其实,您无法通过OpenCV的使用GStreamer的API。什么OpenCV的是一系列的包装函数(如,例如, cvCaptureFromCam ),它通过外部多媒体图书馆实现其功能。例如,除了GStreamer的,OpenCV的可能会用到其他库,如ffmpeg的,V4L。其实,如果你检查通过不同的外部库多媒体捕获,你会发现相关的文件的完整列表:

Actually, you can't use GStreamer API through OpenCV. What OpenCV has is a series of wrapper functions (as, for instance, cvCaptureFromCam) which implement their functionalities through external multimedia libraries. For instance, aside from GStreamer, OpenCV might use other libraries such as ffmpeg, v4l.. in fact, if you check the complete list of files related with multimedia capture through different external libraries you will find:

(in opencv/modules/highgui/src)
cap_cmu.cpp    
cap_dc1394.cpp    
cap_ffmpeg.cpp    
cap_gstreamer.cpp
...

所以,如果你编译的OpenCV在GStreamer支持,你调用相同highgui功能(如 cvCaptureFromCam ),但在较低水平,将被调用函数如 cvCreateCapture_GStreamer 其落实GStreamer的API的调用。不过,这并不意味着你可以称自己为那些低级别的功能(因此并没有在这个范围内声明的错误)。

So, if you compile OpenCV with GStreamer support, you will call the same highgui functions (as cvCaptureFromCam) but, at a low level it will be calling functions like cvCreateCapture_GStreamer which implement the calls to the GStreamer API. But it does not mean that you can call yourself to those low-level functions (hence the "was not declared in this scope" error).

希望它能帮助!

编辑:
看看到 cap.cpp 文件中的OpenCV的源代码。注意对 CvCreateCameraCapture_XXX 的不同选项。这让我觉得你应该可以(通过使用他人代替)打开你的相机没有一些依赖关系。

EDITED: take a look to the cap.cpp file in the opencv source. Notice the different options for CvCreateCameraCapture_XXX. It makes me think that you should be able to open your camera without some of the dependencies (by using others instead).

这篇关于调用的Gstreamer里面的OpenCV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆