diff options
Diffstat (limited to 'backports/recipes-support/opencv/opencv')
10 files changed, 641 insertions, 0 deletions
diff --git a/backports/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch b/backports/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch new file mode 100644 index 0000000..9e6a613 --- /dev/null +++ b/backports/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch @@ -0,0 +1,36 @@ +From 9b4959b97d2e95d4b49cf6ca2a3fce3cdb484f2d Mon Sep 17 00:00:00 2001 +From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> +Date: Thu, 31 Mar 2016 00:20:15 +0200 +Subject: [PATCH] 3rdparty/ippicv: Use pre-downloaded ipp + +Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> +Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com> + +--- + 3rdparty/ippicv/ippicv.cmake | 15 +-------------- + 1 file changed, 1 insertion(+), 14 deletions(-) + +diff --git a/3rdparty/ippicv/ippicv.cmake b/3rdparty/ippicv/ippicv.cmake +index 257af6fcc6..f88460450f 100644 +--- a/3rdparty/ippicv/ippicv.cmake ++++ b/3rdparty/ippicv/ippicv.cmake +@@ -34,18 +34,5 @@ function(download_ippicv root_var) + endif() + + set(THE_ROOT "${OpenCV_BINARY_DIR}/3rdparty/ippicv") +- ocv_download(FILENAME ${OPENCV_ICV_NAME} +- HASH ${OPENCV_ICV_HASH} +- URL +- "${OPENCV_IPPICV_URL}" +- "$ENV{OPENCV_IPPICV_URL}" +- "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_COMMIT}/ippicv/" +- DESTINATION_DIR "${THE_ROOT}" +- ID IPPICV +- STATUS res +- UNPACK RELATIVE_URL) +- +- if(res) +- set(${root_var} "${THE_ROOT}/${OPENCV_ICV_PACKAGE_SUBDIR}" PARENT_SCOPE) +- endif() ++ set(${root_var} "${THE_ROOT}/${OPENCV_ICV_PACKAGE_SUBDIR}" PARENT_SCOPE) + endfunction() diff --git a/backports/recipes-support/opencv/opencv/0001-Add-smaller-version-of-download_models.py.patch b/backports/recipes-support/opencv/opencv/0001-Add-smaller-version-of-download_models.py.patch new file mode 100644 index 0000000..0aabee2 --- /dev/null +++ b/backports/recipes-support/opencv/opencv/0001-Add-smaller-version-of-download_models.py.patch @@ -0,0 +1,179 @@ +From fca4d9eec289f22c081daa2c61a1110e3f268f92 Mon Sep 17 00:00:00 2001 +From: Tom Hochstein <tom.hochstein@nxp.com> +Date: Tue, 1 Sep 2020 14:57:07 -0500 +Subject: [PATCH] Add smaller version of download_models.py + +Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> +--- + testdata/dnn/download_models_basic.py | 159 ++++++++++++++++++++++++++ + 1 file changed, 159 insertions(+) + create mode 100644 testdata/dnn/download_models_basic.py + +diff --git a/testdata/dnn/download_models_basic.py b/testdata/dnn/download_models_basic.py +new file mode 100644 +index 0000000..5c8a616 +--- /dev/null ++++ b/testdata/dnn/download_models_basic.py +@@ -0,0 +1,159 @@ ++#!/usr/bin/env python ++ ++from __future__ import print_function ++import hashlib ++import sys ++import tarfile ++if sys.version_info[0] < 3: ++ from urllib2 import urlopen ++else: ++ from urllib.request import urlopen ++ ++ ++class Model: ++ MB = 1024*1024 ++ BUFSIZE = 10*MB ++ ++ def __init__(self, **kwargs): ++ self.name = kwargs.pop('name') ++ self.url = kwargs.pop('url', None) ++ self.filename = kwargs.pop('filename') ++ self.sha = kwargs.pop('sha', None) ++ self.archive = kwargs.pop('archive', None) ++ self.member = kwargs.pop('member', None) ++ ++ def __str__(self): ++ return 'Model <{}>'.format(self.name) ++ ++ def printRequest(self, r): ++ def getMB(r): ++ d = dict(r.info()) ++ for c in ['content-length', 'Content-Length']: ++ if c in d: ++ return int(d[c]) / self.MB ++ return '<unknown>' ++ print(' {} {} [{} Mb]'.format(r.getcode(), r.msg, getMB(r))) ++ ++ def verify(self): ++ if not self.sha: ++ return False ++ print(' expect {}'.format(self.sha)) ++ sha = hashlib.sha1() ++ try: ++ with open(self.filename, 'rb') as f: ++ while True: ++ buf = f.read(self.BUFSIZE) ++ if not buf: ++ break ++ sha.update(buf) ++ print(' actual {}'.format(sha.hexdigest())) ++ return self.sha == sha.hexdigest() ++ except Exception as e: ++ print(' catch {}'.format(e)) ++ ++ def get(self): ++ if self.verify(): ++ print(' hash match - skipping') ++ return True ++ ++ if self.archive or self.member: ++ assert(self.archive and self.member) ++ print(' hash check failed - extracting') ++ print(' get {}'.format(self.member)) ++ self.extract() ++ else: ++ assert(self.url) ++ print(' hash check failed - downloading') ++ print(' get {}'.format(self.url)) ++ self.download() ++ ++ print(' done') ++ print(' file {}'.format(self.filename)) ++ return self.verify() ++ ++ def download(self): ++ try: ++ r = urlopen(self.url, timeout=60) ++ self.printRequest(r) ++ self.save(r) ++ except Exception as e: ++ print(' catch {}'.format(e)) ++ ++ def extract(self): ++ try: ++ with tarfile.open(self.archive) as f: ++ assert self.member in f.getnames() ++ self.save(f.extractfile(self.member)) ++ except Exception as e: ++ print(' catch {}'.format(e)) ++ ++ def save(self, r): ++ with open(self.filename, 'wb') as f: ++ print(' progress ', end='') ++ sys.stdout.flush() ++ while True: ++ buf = r.read(self.BUFSIZE) ++ if not buf: ++ break ++ f.write(buf) ++ print('>', end='') ++ sys.stdout.flush() ++ ++models = [ ++ Model( ++ name='Fcn', ++ url='http://dl.caffe.berkeleyvision.org/fcn8s-heavy-pascal.caffemodel', ++ sha='c449ea74dd7d83751d1357d6a8c323fcf4038962', ++ filename='fcn8s-heavy-pascal.caffemodel'), ++ Model( ++ name='SqueezeNet_v1.1', ++ url='https://raw.githubusercontent.com/DeepScale/SqueezeNet/b5c3f1a23713c8b3fd7b801d229f6b04c64374a5/SqueezeNet_v1.1/squeezenet_v1.1.caffemodel', ++ sha='3397f026368a45ae236403ccc81cfcbe8ebe1bd0', ++ filename='squeezenet_v1.1.caffemodel'), ++ Model( ++ name='Colorization', ++ url='https://raw.githubusercontent.com/richzhang/colorization/master/models/colorization_deploy_v2.prototxt', ++ sha='f528334e386a69cbaaf237a7611d833bef8e5219', ++ filename='colorization_deploy_v2.prototxt'), ++ Model( ++ name='Colorization', ++ url='http://eecs.berkeley.edu/~rich.zhang/projects/2016_colorization/files/demo_v2/colorization_release_v2.caffemodel', ++ sha='21e61293a3fa6747308171c11b6dd18a68a26e7f', ++ filename='colorization_release_v2.caffemodel'), ++ Model( ++ name='OpenPose/pose/coco', # https://github.com/CMU-Perceptual-Computing-Lab/openpose ++ url='http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/coco/pose_iter_440000.caffemodel', ++ sha='ac7e97da66f3ab8169af2e601384c144e23a95c1', ++ filename='openpose_pose_coco.caffemodel'), ++ Model( ++ name='YOLOv3', # https://pjreddie.com/darknet/yolo/ ++ url='https://pjreddie.com/media/files/yolov3.weights', ++ sha='520878f12e97cf820529daea502acca380f1cb8e', ++ filename='yolov3.weights'), ++ Model( ++ name='EAST', # https://github.com/argman/EAST (a TensorFlow model), https://arxiv.org/abs/1704.03155v2 (a paper) ++ url='https://www.dropbox.com/s/r2ingd0l3zt8hxs/frozen_east_text_detection.tar.gz?dl=1', ++ sha='3ca8233d6edd748f7ed23246c8ca24cbf696bb94', ++ filename='frozen_east_text_detection.tar.gz'), ++ Model( ++ name='EAST', ++ archive='frozen_east_text_detection.tar.gz', ++ member='frozen_east_text_detection.pb', ++ sha='fffabf5ac36f37bddf68e34e84b45f5c4247ed06', ++ filename='frozen_east_text_detection.pb'), ++] ++ ++# Note: models will be downloaded to current working directory ++# expected working directory is opencv_extra/testdata/dnn ++if __name__ == '__main__': ++ failedModels = [] ++ for m in models: ++ print(m) ++ if not m.get(): ++ failedModels.append(m.filename) ++ ++ if failedModels: ++ print("Following models have not been downloaded:") ++ for f in failedModels: ++ print("* {}".format(f)) ++ exit(15) +-- +2.17.1 + diff --git a/backports/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch b/backports/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch new file mode 100644 index 0000000..948a80f --- /dev/null +++ b/backports/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch @@ -0,0 +1,28 @@ +From 66e50ee69fa9ee2469d349100e70d8b296c4b4dc Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 11 Sep 2018 00:21:18 -0700 +Subject: [PATCH] Dont use isystem + +clang really does not like it + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- + cmake/OpenCVPCHSupport.cmake | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/cmake/OpenCVPCHSupport.cmake b/cmake/OpenCVPCHSupport.cmake +index 08cd06def4..46c9c02da3 100644 +--- a/cmake/OpenCVPCHSupport.cmake ++++ b/cmake/OpenCVPCHSupport.cmake +@@ -18,6 +18,8 @@ IF(CV_GCC) + SET(PCHSupport_FOUND TRUE) + ENDIF() + ++ SET(CMAKE_INCLUDE_SYSTEM_FLAG_C "-I") ++ SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-I") + SET(_PCH_include_prefix "-I") + SET(_PCH_isystem_prefix "-isystem") + SET(_PCH_define_prefix "-D") diff --git a/backports/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch b/backports/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch new file mode 100644 index 0000000..d56b8ae --- /dev/null +++ b/backports/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch @@ -0,0 +1,42 @@ +From 11bbf909e08594628bd757d989ae34cf1bfe200b Mon Sep 17 00:00:00 2001 +From: Mingli Yu <mingli.yu@windriver.com> +Date: Thu, 18 Jun 2020 05:51:38 +0000 +Subject: [PATCH] Make ts module external + +Make ts module external + +Reference: https://github.com/qbonnard/opencv/commit/6b229c5834cb9a0930425e762a6c7b03244d7abb + +Upstream-Status: Submitted [https://github.com/opencv/opencv/issues/8408] + +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> +--- + modules/ts/CMakeLists.txt | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/modules/ts/CMakeLists.txt b/modules/ts/CMakeLists.txt +index f95bed0793..66f315bcca 100644 +--- a/modules/ts/CMakeLists.txt ++++ b/modules/ts/CMakeLists.txt +@@ -4,9 +4,6 @@ if(NOT BUILD_opencv_ts AND NOT BUILD_TESTS AND NOT BUILD_PERF_TESTS) + ocv_module_disable(ts) + endif() + +-set(OPENCV_MODULE_TYPE STATIC) +-set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE) +- + if(WINRT) + # WINRT doesn't have access to environment variables + # so adding corresponding macros during CMake run +@@ -16,7 +13,7 @@ endif() + + ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef) + +-ocv_add_module(ts INTERNAL opencv_core opencv_imgproc opencv_imgcodecs opencv_videoio opencv_highgui) ++ocv_add_module(ts opencv_core opencv_imgproc opencv_imgcodecs opencv_videoio opencv_highgui) + + ocv_glob_module_sources() + ocv_module_include_directories() +-- +2.24.1 + diff --git a/backports/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch b/backports/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch new file mode 100644 index 0000000..1e47f8b --- /dev/null +++ b/backports/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch @@ -0,0 +1,31 @@ +From e4ec6cea72da9e9ae5ba57140fa2f5c63f1f8295 Mon Sep 17 00:00:00 2001 +From: Jason Wessel <jason.wessel@windriver.com> +Date: Wed, 9 May 2018 13:33:59 -0700 +Subject: [PATCH] Temporarliy work around deprecated ffmpeg RAW function + compile failure until next uprev + +Signed-off-by: Jason Wessel <jason.wessel@windriver.com> + +--- + modules/videoio/src/cap_ffmpeg_impl.hpp | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp +index 6dca724a89..ae55dd4555 100644 +--- a/modules/videoio/src/cap_ffmpeg_impl.hpp ++++ b/modules/videoio/src/cap_ffmpeg_impl.hpp +@@ -774,6 +774,14 @@ struct ImplMutex::Impl + + #endif + ++/* NOTE This is deprecated in ffmpeg and the code should be removed */ ++#ifndef AVFMT_RAWPICTURE ++#define AVFMT_RAWPICTURE 0x0020 ++#endif /* AVFMT_RAWPICTURE */ ++#ifndef CODEC_FLAG_GLOBAL_HEADER ++#define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER ++#endif ++ + void ImplMutex::init() + { + impl = new Impl(); diff --git a/backports/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch b/backports/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch new file mode 100644 index 0000000..c5a6438 --- /dev/null +++ b/backports/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch @@ -0,0 +1,31 @@ +From 59fafe6e39759e193b5764b36b4c5a93da352123 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 18 Aug 2020 00:36:49 -0700 +Subject: [PATCH] Use -Os to compile tinyxml2.cpp + +This workarounds issue [1] seen on riscv with gcc + +[1] https://github.com/riscv/riscv-gnu-toolchain/issues/624 + +Upstream-Status: Inappropriate [ OE-Specific ] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + modules/datasets/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules/datasets/CMakeLists.txt b/modules/datasets/CMakeLists.txt +index 56ca9e310..99b7a33f6 100644 +--- a/modules/datasets/CMakeLists.txt ++++ b/modules/datasets/CMakeLists.txt +@@ -2,7 +2,7 @@ set(the_description "datasets framework") + + set(filter_srcs "${CMAKE_CURRENT_LIST_DIR}/src/tinyxml2/tinyxml2.cpp") + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +- ocv_append_source_files_cxx_compiler_options(filter_srcs "-Wno-suggest-override") # GCC ++ ocv_append_source_files_cxx_compiler_options(filter_srcs "-Wno-suggest-override -Os") # GCC + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + ocv_append_source_files_cxx_compiler_options(filter_srcs "-Wno-inconsistent-missing-override") # Clang + endif() +-- +2.28.0 + diff --git a/backports/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch b/backports/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch new file mode 100644 index 0000000..7b2c410 --- /dev/null +++ b/backports/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch @@ -0,0 +1,44 @@ +From ffe20fc4ec46c6b491eff29a38f90686d4d035f6 Mon Sep 17 00:00:00 2001 +From: Martin Jansa <Martin.Jansa@gmail.com> +Date: Mon, 12 Apr 2021 20:37:40 +0000 +Subject: [PATCH] sfm: link with Glog_LIBS + +* in 4.5.0 there was explicit linkage with GLOG_LIBRARY, but since 4.5.1 with: + https://github.com/opencv/opencv_contrib/commit/23ee62a19b7a3e50d6dbf295359d8b1aff2e03fd + + it's gone, probably because Glog_FOUND is already set from Ceres, + but then GLOG_LIBRARIES is empty in LIBMV_LIGHT_LIBS and build with gold fails: + +FAILED: bin/example_tutorial_perspective_correction +: && TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-g++ -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -ITOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/git/include -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0=/usr/src/debug/opencv/4.5.2-r0 -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0=/usr/src/debug/opencv/4.5.2-r0 -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot= -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot-native= -fvisibility-inlines-hidden -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -ITOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/git/include -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -mssse3 -DNDEBUG -DNDEBUG -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -ITOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/git/include -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0=/usr/src/debug/opencv/4.5.2-r0 -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0=/usr/src/debug/opencv/4.5.2-r0 -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot= -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot-native= -fvisibility-inlines-hidden -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -ITOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/git/include -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,--gc-sections -Wl,--as-needed samples/cpp/CMakeFiles/example_tutorial_perspective_correction.dir/tutorial_code/features2D/Homography/perspective_correction.cpp.o -o bin/example_tutorial_perspective_correction -ldl -lm -lpthread -lrt lib/libopencv_gapi.so.4.5.2 lib/libopencv_stitching.so.4.5.2 lib/libopencv_ts.so.4.5.2 lib/libopencv_alphamat.so.4.5.2 lib/libopencv_aruco.so.4.5.2 lib/libopencv_bgsegm.so.4.5.2 lib/libopencv_bioinspired.so.4.5.2 lib/libopencv_ccalib.so.4.5.2 lib/libopencv_dnn_objdetect.so.4.5.2 lib/libopencv_dnn_superres.so.4.5.2 lib/libopencv_dpm.so.4.5.2 lib/libopencv_face.so.4.5.2 lib/libopencv_fuzzy.so.4.5.2 lib/libopencv_hfs.so.4.5.2 lib/libopencv_img_hash.so.4.5.2 lib/libopencv_intensity_transform.so.4.5.2 lib/libopencv_line_descriptor.so.4.5.2 lib/libopencv_mcc.so.4.5.2 lib/libopencv_quality.so.4.5.2 lib/libopencv_rapid.so.4.5.2 lib/libopencv_reg.so.4.5.2 lib/libopencv_rgbd.so.4.5.2 lib/libopencv_saliency.so.4.5.2 lib/libopencv_sfm.so.4.5.2 lib/libopencv_stereo.so.4.5.2 lib/libopencv_structured_light.so.4.5.2 lib/libopencv_superres.so.4.5.2 lib/libopencv_surface_matching.so.4.5.2 lib/libopencv_tracking.so.4.5.2 lib/libopencv_videostab.so.4.5.2 lib/libopencv_wechat_qrcode.so.4.5.2 lib/libopencv_xfeatures2d.so.4.5.2 lib/libopencv_xobjdetect.so.4.5.2 lib/libopencv_xphoto.so.4.5.2 lib/libopencv_shape.so.4.5.2 lib/libopencv_highgui.so.4.5.2 lib/libopencv_datasets.so.4.5.2 lib/libopencv_ml.so.4.5.2 lib/libopencv_plot.so.4.5.2 lib/libopencv_phase_unwrapping.so.4.5.2 lib/libopencv_optflow.so.4.5.2 lib/libopencv_ximgproc.so.4.5.2 lib/libopencv_videoio.so.4.5.2 lib/libopencv_video.so.4.5.2 lib/libopencv_dnn.so.4.5.2 lib/libopencv_imgcodecs.so.4.5.2 lib/libopencv_objdetect.so.4.5.2 lib/libopencv_calib3d.so.4.5.2 lib/libopencv_features2d.so.4.5.2 lib/libopencv_flann.so.4.5.2 lib/libopencv_photo.so.4.5.2 lib/libopencv_imgproc.so.4.5.2 lib/libopencv_core.so.4.5.2 -Wl,-rpath-link,TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/build/lib && : +lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessage::LogMessage(char const*, int)' +lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessage::stream()' +lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessage::~LogMessage()' +lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::kLogSiteUninitialized' +lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'fLI::FLAGS_v' +lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::InitVLOG3__(int**, int*, char const*, int)' +lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessageFatal::LogMessageFatal(char const*, int)' +lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessageFatal::~LogMessageFatal()' +collect2: error: ld returned 1 exit status + + Add Glog_LIBS which is set to the same value as GLOG_LIBRARIES used to be. + +Upstream-Status: Submitted [https://github.com/opencv/opencv_contrib/pull/2923] + +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> +--- + modules/sfm/CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules/sfm/CMakeLists.txt b/modules/sfm/CMakeLists.txt +index 045a1fe6e..ee7cecdac 100644 +--- a/modules/sfm/CMakeLists.txt ++++ b/modules/sfm/CMakeLists.txt +@@ -84,6 +84,7 @@ set(LIBMV_LIGHT_LIBS + multiview + numeric + ${GLOG_LIBRARIES} ++ ${Glog_LIBS} + ${GFLAGS_LIBRARIES} + ) + diff --git a/backports/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch b/backports/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch new file mode 100644 index 0000000..bb47ef2 --- /dev/null +++ b/backports/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch @@ -0,0 +1,70 @@ +From f42c9b8c7bafcadc7e95fb25a391707f970eb426 Mon Sep 17 00:00:00 2001 +From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com> +Date: Fri, 19 May 2017 04:27:50 +0900 +Subject: [PATCH] To fix errors as following: + +"test_main.cpp:45: undefined reference to `parseCustomOptions(int, char**)'" +"perf_abs.cpp:13: undefined reference to `cvtest::param_seed'" +"test_superres.cpp:270: undefined reference to `checkIppStatus()'" + +Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com> + +Also add the visibility changes for certain OpenCL-related functions in +ts module. + +Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com> + +--- + modules/ts/include/opencv2/ts.hpp | 4 ++-- + modules/ts/include/opencv2/ts/ocl_test.hpp | 2 +- + modules/ts/include/opencv2/ts/ts_ext.hpp | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/modules/ts/include/opencv2/ts.hpp b/modules/ts/include/opencv2/ts.hpp +index ed7491a89a..80919d13ee 100644 +--- a/modules/ts/include/opencv2/ts.hpp ++++ b/modules/ts/include/opencv2/ts.hpp +@@ -728,7 +728,7 @@ protected: + } + }; + +-extern uint64 param_seed; ++CV_EXPORTS extern uint64 param_seed; + + struct DefaultRngAuto + { +@@ -791,7 +791,7 @@ private: + #endif + #endif + +-void parseCustomOptions(int argc, char **argv); ++CV_EXPORTS void parseCustomOptions(int argc, char **argv); + + #define CV_TEST_INIT0_NOOP (void)0 + +diff --git a/modules/ts/include/opencv2/ts/ocl_test.hpp b/modules/ts/include/opencv2/ts/ocl_test.hpp +index 11572e9f48..438112e2aa 100644 +--- a/modules/ts/include/opencv2/ts/ocl_test.hpp ++++ b/modules/ts/include/opencv2/ts/ocl_test.hpp +@@ -82,7 +82,7 @@ inline UMat ToUMat(InputArray src) + return dst; + } + +-extern int test_loop_times; ++CV_EXPORTS extern int test_loop_times; + + #define MAX_VALUE 357 + +diff --git a/modules/ts/include/opencv2/ts/ts_ext.hpp b/modules/ts/include/opencv2/ts/ts_ext.hpp +index b2a4cac241..b94c681c0c 100644 +--- a/modules/ts/include/opencv2/ts/ts_ext.hpp ++++ b/modules/ts/include/opencv2/ts/ts_ext.hpp +@@ -9,7 +9,7 @@ + #define OPENCV_TS_EXT_HPP + + namespace cvtest { +-void checkIppStatus(); ++CV_EXPORTS void checkIppStatus(); + extern bool skipUnstableTests; + extern bool runBigDataTests; + extern int testThreads; diff --git a/backports/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch b/backports/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch new file mode 100644 index 0000000..0e83e99 --- /dev/null +++ b/backports/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch @@ -0,0 +1,139 @@ +From 3c4daafb54f961e376104a461ca7ec114ff0331a Mon Sep 17 00:00:00 2001 +From: Ludek Slosarcik <ludek.slosarcik@nxp.com> +Date: Fri, 14 Feb 2020 15:46:50 +0100 +Subject: [PATCH] opencv_dnn: added video device for 2 examples, and change text labels + +Signed-off-by: Ludek Slosarcik <ludek.slosarcik@nxp.com> + +Upstream-Status: Pending +--- + samples/cpp/logistic_regression.cpp | 2 +- + samples/dnn/classification.cpp | 7 ++++--- + samples/dnn/object_detection.cpp | 10 +++++----- + samples/dnn/segmentation.cpp | 2 +- + samples/dnn/text_detection.cpp | 5 +++-- + 5 files changed, 14 insertions(+), 12 deletions(-) + +Index: git/samples/cpp/logistic_regression.cpp +=================================================================== +--- git.orig/samples/cpp/logistic_regression.cpp ++++ git/samples/cpp/logistic_regression.cpp +@@ -28,7 +28,7 @@ static float calculateAccuracyPercent(co + + int main() + { +- const String filename = samples::findFile("data01.xml"); ++ const String filename = samples::findFile("../data/data01.xml"); + cout << "**********************************************************************" << endl; + cout << filename + << " contains digits 0 and 1 of 20 samples each, collected on an Android device" << endl; +Index: git/samples/dnn/classification.cpp +=================================================================== +--- git.orig/samples/dnn/classification.cpp ++++ git/samples/dnn/classification.cpp +@@ -11,6 +11,7 @@ std::string keys = + "{ help h | | Print help message. }" + "{ @alias | | An alias name of model to extract preprocessing parameters from models.yml file. }" + "{ zoo | models.yml | An optional path to file with preprocessing parameters }" ++ "{ device | 0 | camera device number. }" + "{ input i | | Path to input image or video file. Skip this argument to capture frames from a camera.}" + "{ initial_width | 0 | Preprocess input image by initial resizing to a specific width.}" + "{ initial_height | 0 | Preprocess input image by initial resizing to a specific height.}" +@@ -102,7 +103,7 @@ int main(int argc, char** argv) + if (parser.has("input")) + cap.open(parser.get<String>("input")); + else +- cap.open(0); ++ cap.open(parser.get<int>("device")); + //! [Open a video file or an image file or a camera stream] + + // Process frames. +@@ -151,13 +152,13 @@ int main(int argc, char** argv) + double freq = getTickFrequency() / 1000; + double t = net.getPerfProfile(layersTimes) / freq; + std::string label = format("Inference time: %.2f ms", t); +- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); ++ putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); + + // Print predicted class. + label = format("%s: %.4f", (classes.empty() ? format("Class #%d", classId).c_str() : + classes[classId].c_str()), + confidence); +- putText(frame, label, Point(0, 40), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); ++ putText(frame, label, Point(0, 45), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); + + imshow(kWinName, frame); + } +Index: git/samples/dnn/object_detection.cpp +=================================================================== +--- git.orig/samples/dnn/object_detection.cpp ++++ git/samples/dnn/object_detection.cpp +@@ -251,13 +251,13 @@ int main(int argc, char** argv) + if (predictionsQueue.counter > 1) + { + std::string label = format("Camera: %.2f FPS", framesQueue.getFPS()); +- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); ++ putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); + + label = format("Network: %.2f FPS", predictionsQueue.getFPS()); +- putText(frame, label, Point(0, 30), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); ++ putText(frame, label, Point(0, 45), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); + + label = format("Skipped frames: %d", framesQueue.counter - predictionsQueue.counter); +- putText(frame, label, Point(0, 45), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); ++ putText(frame, label, Point(0, 70), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); + } + imshow(kWinName, frame); + } +@@ -293,7 +293,7 @@ int main(int argc, char** argv) + double freq = getTickFrequency() / 1000; + double t = net.getPerfProfile(layersTimes) / freq; + std::string label = format("Inference time: %.2f ms", t); +- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); ++ putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); + + imshow(kWinName, frame); + } +@@ -462,7 +462,7 @@ void drawPred(int classId, float conf, i + top = max(top, labelSize.height); + rectangle(frame, Point(left, top - labelSize.height), + Point(left + labelSize.width, top + baseLine), Scalar::all(255), FILLED); +- putText(frame, label, Point(left, top), FONT_HERSHEY_SIMPLEX, 0.5, Scalar()); ++ putText(frame, label, Point(left, top), FONT_HERSHEY_SIMPLEX, 0.8, Scalar()); + } + + void callback(int pos, void*) +Index: git/samples/dnn/segmentation.cpp +=================================================================== +--- git.orig/samples/dnn/segmentation.cpp ++++ git/samples/dnn/segmentation.cpp +@@ -157,7 +157,7 @@ int main(int argc, char** argv) + double freq = getTickFrequency() / 1000; + double t = net.getPerfProfile(layersTimes) / freq; + std::string label = format("Inference time: %.2f ms", t); +- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); ++ putText(frame, label, Point(0, 20), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(0, 0, 255), 2, 8, false); + + imshow(kWinName, frame); + if (!classes.empty()) +Index: git/samples/dnn/text_detection.cpp +=================================================================== +--- git.orig/samples/dnn/text_detection.cpp ++++ git/samples/dnn/text_detection.cpp +@@ -30,6 +30,7 @@ using namespace cv::dnn; + const char* keys = + "{ help h | | Print help message. }" + "{ input i | | Path to input image or video file. Skip this argument to capture frames from a camera.}" ++ "{ device | 0 | camera device number. }" + "{ detModel dmp | | Path to a binary .pb file contains trained detector network.}" + "{ width | 320 | Preprocess input image by resizing to a specific width. It should be multiple by 32. }" + "{ height | 320 | Preprocess input image by resizing to a specific height. It should be multiple by 32. }" +@@ -106,7 +107,7 @@ int main(int argc, char** argv) + + // Open a video file or an image file or a camera stream. + VideoCapture cap; +- bool openSuccess = parser.has("input") ? cap.open(parser.get<String>("input")) : cap.open(0); ++ bool openSuccess = parser.has("input") ? cap.open(parser.get<String>("input")) : cap.open(parser.get<int>("device")); + CV_Assert(openSuccess); + + static const std::string kWinName = "EAST: An Efficient and Accurate Scene Text Detector"; diff --git a/backports/recipes-support/opencv/opencv/download.patch b/backports/recipes-support/opencv/opencv/download.patch new file mode 100644 index 0000000..33ac483 --- /dev/null +++ b/backports/recipes-support/opencv/opencv/download.patch @@ -0,0 +1,41 @@ +From b18a280fab06a680d9f831bf8b462647f3cb6214 Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Thu, 9 Jan 2020 16:24:24 +0000 +Subject: [PATCH] opencv: abort configure if we need to download + +This CMake module will download files during do_configure. This is bad as it +means we can't do offline builds. + +Add an option to disallow downloads by emitting a fatal error. + +Upstream-Status: Pending +Signed-off-by: Ross Burton <ross.burton@intel.com> + +--- + cmake/OpenCVDownload.cmake | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake +index 63cf6d3238..4acf477f70 100644 +--- a/cmake/OpenCVDownload.cmake ++++ b/cmake/OpenCVDownload.cmake +@@ -14,6 +14,7 @@ + # RELATIVE_URL - if set, then URL is treated as a base, and FILENAME will be appended to it + # Note: uses OPENCV_DOWNLOAD_PATH folder as cache, default is <opencv>/.cache + ++set(OPENCV_ALLOW_DOWNLOADS ON CACHE BOOL "Allow downloads") + set(HELP_OPENCV_DOWNLOAD_PATH "Cache directory for downloaded files") + if(DEFINED ENV{OPENCV_DOWNLOAD_PATH}) + set(OPENCV_DOWNLOAD_PATH "$ENV{OPENCV_DOWNLOAD_PATH}" CACHE PATH "${HELP_OPENCV_DOWNLOAD_PATH}") +@@ -156,6 +157,11 @@ function(ocv_download) + + # Download + if(NOT EXISTS "${CACHE_CANDIDATE}") ++ if(NOT OPENCV_ALLOW_DOWNLOADS) ++ message(FATAL_ERROR "Not going to download ${DL_FILENAME}") ++ return() ++ endif() ++ + ocv_download_log("#cmake_download \"${CACHE_CANDIDATE}\" \"${DL_URL}\"") + foreach(try ${OPENCV_DOWNLOAD_TRIES_LIST}) + ocv_download_log("#try ${try}") |