2013-12-20 42 views
1

我想编译VLC 2.0的Ubuntu 13.10OpenCV的支持(第2.4.6.1)。汇编产生以下错误:错误VLC编译与OpenCV的支持

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支持在过去一直是bug,但问题似乎已经解决了。和用示例代码测试opencv库产生令人满意的结果,所以我猜问题来自VLC ...

+0

只是一个警告,vlc过滤代码有点基于opencv1.0,c-api,可怕的过时。另外,你真的想让你的代码在vlc管道内运行吗?使用libvlc制作某种'模拟'VideoCapture对象听起来像是一个更好的主意。 – berak

回答

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)