After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 687237 - OpenCV elements compile with 2.4.2
OpenCV elements compile with 2.4.2
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.x
Other All
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-10-30 22:53 UTC by Yaakov Selkowitz
Modified: 2013-01-07 00:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Yaakov Selkowitz 2012-10-30 22:53:34 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.
Comment 1 Tim-Philipp Müller 2012-10-31 11:40:47 UTC
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
Comment 2 Edward Hervey 2012-11-02 09:22:36 UTC
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
Comment 3 Tim-Philipp Müller 2012-11-02 13:17:38 UTC
Will have a look later if original reporter isn't faster; feel free to revert in the meantime.
Comment 4 Yaakov Selkowitz 2012-11-02 16:34:31 UTC
(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
Comment 5 Tim-Philipp Müller 2012-11-03 13:53:16 UTC
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
Comment 6 Tim-Philipp Müller 2012-11-03 16:04:48 UTC
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
Comment 7 Yaakov Selkowitz 2012-11-04 04:23:49 UTC
(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.
Comment 8 Tim-Philipp Müller 2013-01-07 00:48:43 UTC
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!