【问题标题】:Error in VLC compilation with opencv support支持 opencv 的 VLC 编译出错
【发布时间】:2013-12-20 22:29:11
【问题描述】:

我正在尝试在 Ubuntu 13.10编译 VLC 2.0,并提供 opencv 支持(v. 2.4.6.1)。编译产生以下错误:

 COMPILE : libopencv_example_plugin_la-opencv_example.lo
opencv_example.c: In function 'Filter':
ERROR   : opencv_example.c:185: 45:  too few arguments to function 'cvHaarDetectObjects'
                                             cvSize(20, 20) );
                                             ^
In file included from /usr/local/include/opencv/cv.h:71:0,
                 from opencv_example.c:41:
/usr/local/include/opencv2/objdetect/objdetect.hpp:139:15: note: declared here
 CVAPI(CvSeq*) cvHaarDetectObjects( const CvArr* image,
               ^
WARNING : opencv_example.c:210: 57:  assignment discards 'const' qualifier from pointer target type [enabled by default]
             p_sys->event_info.p_region[i].p_description = "Face Detected";
                                                         ^
make: *** [all] Error 2

有没有人遇到过同样的问题,或者知道如何解决它?任何帮助将非常感激。过去似乎对opencv的支持一直存在问题,但问题似乎已经解决。并且用示例代码测试opencv库得到了满意的结果,所以我猜问题出在VLC...

【问题讨论】:

  • 只是一个警告,vlc过滤器代码有点基于opencv1.0,c-api,非常过时。另外,你真的想让你的代码在 inside vlc 管道中运行吗?使用 libvlc 制作某种“模拟”VideoCapture 对象对我来说听起来是一个更好的主意。

标签: c++ opencv vlc libvlc


【解决方案1】:

今天也遇到了同样的问题。 打开opencv_example.c或者写,找到创建cvHaarDetectObjects的那一行。它开始于

CvSeq *faces = cvHaarDetectObjects( p_img[0], ...

将 cvHaarDetectObjects 的整个声明替换为以下行:

CvSeq *faces = cvHaarDetectObjects( p_img[0], p_sys->p_cascade, p_sys->p_storage,
1.15, 5, CV_HAAR_DO_CANNY_PRUNING, cvSize(0, 0), cvSize(20,20));

这些更改使我的 opencv_example.c 编译良好(opencv-2.4.9、vlc-2.0.1、Ubuntu-12.04)

【讨论】:

    猜你喜欢
    • 2015-10-02
    • 2010-12-01
    • 2018-01-13
    • 1970-01-01
    • 2017-06-22
    • 2013-12-25
    • 1970-01-01
    • 2012-10-06
    • 1970-01-01
    相关资源
    最近更新 更多