GNOME Bugzilla – Bug 687237
OpenCV elements compile with 2.4.2
Last modified: 2013-01-07 00:48:43 UTC
ext/opencv (both 0.10 and 1.0) compiles as-is with OpenCV-2.4.2. The maximum version requirements can be relaxed in master and both stable branches accordingly.
commit 0ec92a3f73fd8ba789dcd611671baee2f2fc0b8b Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> Date: Wed Oct 31 11:38:32 2012 +0000 configure: opencv plugin builds with newer versions up to 2.4.2 as well https://bugzilla.gnome.org/show_bug.cgi?id=687237
make[3]: Entering directory `/home/bilboed/work/devel/1.0/gst-plugins-bad/ext/opencv' CC libgstopencv_la-gstpyramidsegment.lo gstpyramidsegment.c: In function 'gst_pyramid_segment_chain': gstpyramidsegment.c:307:3: error: implicit declaration of function 'cvPyrSegmentation' [-Werror=implicit-function-declaration] gstpyramidsegment.c:307:3: error: nested extern declaration of 'cvPyrSegmentation' [-Werror=nested-externs] cc1: all warnings being treated as errors With opencv-2.4.2 I can't see how it could build with 2.4.2 since cvPyrSegmentation has been moved to the "legacy" stuff, which is in $INCLUDEDIR/opencv2/legacy.hpp That code is deactivated since we build with CV_NO_BACKWARD_COMPATIBILITY
Will have a look later if original reporter isn't faster; feel free to revert in the meantime.
(In reply to comment #2) > CC libgstopencv_la-gstpyramidsegment.lo > gstpyramidsegment.c: In function 'gst_pyramid_segment_chain': > gstpyramidsegment.c:307:3: error: implicit declaration of function > 'cvPyrSegmentation' [-Werror=implicit-function-declaration] > gstpyramidsegment.c:307:3: error: nested extern declaration of > 'cvPyrSegmentation' [-Werror=nested-externs] > cc1: all warnings being treated as errors I was building from the 1.0.2 (and 0.10.23) tarballs, hence no -Werror for me. :-( > I can't see how it could build with 2.4.2 since cvPyrSegmentation has been > moved to the "legacy" stuff, which is in $INCLUDEDIR/opencv2/legacy.hpp In 2.4.2, that's <opencv2/legacy/legacy.hpp>. > That code is deactivated since we build with CV_NO_BACKWARD_COMPATIBILITY Actually, that macro is documented in a different header, namely <opencv2/legacy/compat.hpp>, but nowhere in the 2.4.2 headers is it actually used. In any case, compat.hpp does not #include legacy.hpp. I was able to quiet the warnings by adding the following to either of gstpyramidsegment.{c,h} (after the other #includes): #if CV_MAJOR_VERSION * 100 + CV_MINOR_VERSION >= 204 #include <opencv2/legacy/legacy.hpp> #endif
Thanks, let's hope that works: commit fa20fba1a28b9e36a52991d76a474b6e1dc9fb1a Author: Tim-Philipp Müller <tim@centricular.net> Date: Sat Nov 3 13:51:12 2012 +0000 opencv: fix warnings and build against opencv 2.4.x gstpyramidsegment.c: In function 'gst_pyramid_segment_chain': gstpyramidsegment.c:307:3: error: implicit declaration of function 'cvPyrSegmentation' [-Werror=implicit-function-declaration] gstpyramidsegment.c:307:3: error: nested extern declaration of 'cvPyrSegmentation' [-Werror=nested-externs] https://bugzilla.gnome.org/show_bug.cgi?id=687237
Does the plugin load for you as well then, or just compile? (gst-plugin-scanner:1391): GStreamer-WARNING **: Failed to load plugin '/usr/lib/gstreamer-1.0/libgstopencv.so': /usr/lib/gstreamer-1.0/libgstopencv.so: undefined symbol: cvReleaseImageHeader
(In reply to comment #6) > Does the plugin load for you as well then, or just compile? Yes, it loads. (Cygwin is a PE platform, so it behaves like -Wl,--as-needed,--no-undefined on Linux; any undefined symbols would be an error at link-time.) I would have to guess that your opencv.pc is somehow incomplete. FWIW, my opencv plugin shows direct dependencies on libopencv_{core,highgui,imgproc,legacy,objdetect}-2.4.
This has been in git master for quite some time now, and I haven't seen any issues with it since, so I think I'll just close this again for now. Edward: please investigate what's happening on your end if you still have issues, thanks!