GNOME Bugzilla – Bug 772822
opencv: reinstate check for opencv contrib, compilation fails without it
Last modified: 2017-01-12 13:58:10 UTC
when migrating to opencv 3.10 that check was removed but if opencv_contrib is not present compilation will fail later. better if it fails fast... ideally, the opencv element that rely on contrib should be excluded from the build if it not present.
Sounds fine. Would you like to provide a patch?
Yes, I will submit a patch eventually. I wanted to assign the issue to myself but could not find how to do that.
Created attachment 340626 [details] [review] opencv: check presence of required opencv_contrib headers The patch simply checks that one of the needed opencv_header is present. This header is needed by the segmentation element of the opencv plugin. Ideally we should have a HAVE_OPENCV_CONTRIB flag and conditionally build the element that depend on it.
Created attachment 340627 [details] [review] opencv: check presence of required opencv_contrib headers
Created attachment 340628 [details] [review] opencv: check presence of required opencv_contrib headers
Attachment 340628 [details] pushed as bf11338 - opencv: check presence of required opencv_contrib headers
Actually, this is probably needed on meson side right ?
> Actually, this is probably needed on meson side right ? Yep.
Note that if opencv_contrib is not detected then neither ext/opencv nor the new gst-libs/gst/opencv will be built. gst-libs/gst/opencv does not depend on opencv_contrib so could be built even if opencv_contrib is missing. Only one ext/opencv element (afaik) relies on opencv_contrib. Ideally the other ones should be build if opencv_contrib is missing. We could introduce a HAVE_OPENCV_CONTRIB and have HAVE_OPENCV be true if plain opencv is found.
Created attachment 341202 [details] [review] opencv/meson: check presence of required opencv_contrib headers
I'm not ignoring what you said, but just keeping things simple for now. We can improve is this actually causes issues later. Attachment 341202 [details] pushed as ab28399 - opencv/meson: check presence of required opencv_contrib headers
No problems. I captured the above for future reference. No urgency.
Best, I guess, is to close this issue as it is done and eventually create a new one for further improvements.
This broke compilation with OpenCV < 3. Merged a patch commit c176904c9efb173c9bc368124ebffcab19b7eac8 Author: Sebastian Dröge <sebastian@centricular.com> Date: Thu Jan 12 15:55:52 2017 +0200 opencv: Fix build with OpenCV < 3 We only need the opencv2/bgsegm.hpp header for OpenCV >= 3 and have compat code for older versions.