0

我有一个使用 OpenCV 的插件,它可以在 Kubuntu 上完美运行。现在我试图在 CentOS 上运行代码,但是当我运行管道时,我得到:

$ gst-launch videotestsrc ! opencvelement ! ximagesink 
WARNING: erroneous pipeline: no element "opencvelement" 

当我在 Kubuntu 运行 ldd 时,我得到:

    $ ldd .libs/libOPENCVELEMENT.so 
    linux-gate.so.1 =>  (0x0060f000) 
    libgstbase-0.10.so.0 => /usr/lib/libgstbase-0.10.so.0 (0x00a74000) 
    libgstreamer-0.10.so.0 => /usr/lib/libgstreamer-0.10.so.0 (0x00474000) 
    libgobject-2.0.so.0 => /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 (0x006a2000) 
    libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0x00110000) 
    libopencv_core.so.2.3 => /usr/local/lib/libopencv_core.so.2.3 (0x00730000) 
    libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0x00209000) 
    libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0x002f4000) 
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x00acd000) 
    libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0x0031e000) 
    libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0x0033c000) 
    libgthread-2.0.so.0 => /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 (0x00357000) 
    libgmodule-2.0.so.0 => /usr/lib/i386-linux-gnu/libgmodule-2.0.so.0 (0x0035d000) 
    libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00c9c000) 
    librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0x00362000) 
    libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0x0036b000) 
    libffi.so.6 => /usr/lib/i386-linux-gnu/libffi.so.6 (0x00370000) 
    libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0x00e52000) 
    libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0x00377000) 
    /lib/ld-linux.so.2 (0x00a10000) 

但是当我在 CentOS 上运行它时,我没有看到 opencv

    $ ldd .libs/libOPENCVELEMENT.so 
    linux-vdso.so.1 =>  (0x00007fff7a1fd000) 
    libgstvideo-0.10.so.0 => /usr/lib64/libgstvideo-0.10.so.0 (0x00002ba0ac9b7000) 
    libgstcontroller-0.10.so.0 => /usr/lib64/libgstcontroller-0.10.so.0 (0x00002ba0acbc4000) 
    libgstbase-0.10.so.0 => /usr/lib64/libgstbase-0.10.so.0 (0x00002ba0acdeb000) 
    libgstreamer-0.10.so.0 => /usr/lib64/libgstreamer-0.10.so.0 (0x00002ba0ad03c000) 
    libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00002ba0ad326000) 
    libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x00002ba0ad569000) 
    libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x00002ba0ad76c000) 
    librt.so.1 => /lib64/librt.so.1 (0x00002ba0ad970000) 
    libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00002ba0adb7a000) 
    libz.so.1 => /lib64/libz.so.1 (0x00002ba0adeb7000) 
    libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00002ba0ae0cb000) 
    libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002ba0ae3a8000) 
    libm.so.6 => /lib64/libm.so.6 (0x00002ba0ae6a8000) 
    libc.so.6 => /lib64/libc.so.6 (0x00002ba0ae92b000) 
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002ba0aec83000) 
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ba0aee91000) 
    libdl.so.2 => /lib64/libdl.so.2 (0x00002ba0af0ac000) 
    /lib64/ld-linux-x86-64.so.2 (0x0000003f6c800000) 

这是我的 makefile.am,在两个操作系统上都是一样的

plugin_LTLIBRARIES = libOPENCVELEMENT.la 

# Plugin source files: 
libOPENCVELEMENT_la_SOURCES = opencv_chain.c opencv_chain.h datasetup.h 
libOPENCVELEMENT_la_CFLAGS = \ 
    $(GST_PLUGINS_BASE_CFLAGS) \ 
    $(GST_CFLAGS) \ 
    $(OPENCV_CFLAGS) 

libOPENCVELEMENT_la_CXXFLAGS = \ 
    $(GST_PLUGINS_BASE_CFLAGS) \ 
    $(GST_CFLAGS) \ 
    $(OPENCV_CFLAGS) 

libOPENCVELEMENT_la_LIBADD = \ 
    $(GST_PLUGINS_BASE_LIBS) \ 
    $(GST_LIBS) \ 
    $(OPENCV_LIBS) \ 
    -lopencv_core \ 
    -lopencv_highgui 

libOPENCVELEMENT_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) 
libOPENCVELEMENT_la_LIBTOOLFLAGS = --tag=disable-static 

如果您需要更多信息,请与我们联系。任何帮助将不胜感激。谢谢你。

4

2 回答 2

0

你在centos上也安装了所有的opencv开发文件吗?运行一个:

grep  "OPENVC_" Makefile

检查 Make 变量包含的内容。您还可以通过 c++filt 管道连接器(未定义的符号)输出,以查看真实的函数名称而不是损坏的名称。

于 2012-07-31T18:37:15.137 回答
0

我能够通过转到 /usr/lib64/pkgconfig 并修改 opencv.pc 以明确拥有所有库来解决这个问题。我还必须将插件从 /usr/lib/gstreamer-0.10 移动到 /usr/lib64/gstreamer-0.10

于 2012-08-01T18:38:45.557 回答