From cedf6ffb9a5edc8bcba05079380909be6e49aaea Mon Sep 17 00:00:00 2001 From: Luciano Dittgen Date: Mon, 29 Jun 2026 13:36:24 -0300 Subject: opencv: Move recipe to openembedded-layer dynamic layer The OpenCV recipe and the packagegroups that depend on meta-oe recipes should only be parsed when openembedded-layer is present. Move them under the existing openembedded-layer dynamic layer so a core-only meta-freescale setup does not expose those dependencies. Tested with yocto-check-layer against the current worktree. Signed-off-by: Luciano Dittgen --- .../packagegroups/packagegroup-fsl-opencv-imx.bb | 12 + .../packagegroup-fsl-tools-benchmark.bb | 23 ++ .../packagegroup-fsl-tools-testapps.bb | 45 +++ ...01-3rdparty-ippicv-Use-pre-downloaded-ipp.patch | 37 ++ ...missing-header-for-LIBAVCODEC_VERSION_INT.patch | 26 ++ ...Add-smaller-version-of-download_models.py.patch | 180 +++++++++ .../opencv/opencv/0001-Dont-use-isystem.patch | 28 ++ .../opencv/0001-Make-ts-module-external.patch | 42 +++ ...-work-around-deprecated-ffmpeg-RAW-functi.patch | 32 ++ .../0001-Use-Os-to-compile-tinyxml2.cpp.patch | 31 ++ ...ne-argument-version-of-SetTotalBytesLimit.patch | 41 +++ .../opencv/0001-sfm-link-with-Glog_LIBS.patch | 44 +++ .../opencv/0003-To-fix-errors-as-following.patch | 71 ++++ .../opencv/opencv/OpenCV_DNN_examples.patch | 141 +++++++ .../recipes-support/opencv/opencv/download.patch | 41 +++ .../opencv/fix-build-with-protobuf-v22.patch | 408 +++++++++++++++++++++ .../recipes-support/opencv/opencv_4.6.0.imx.bb | 318 ++++++++++++++++ .../packagegroups/packagegroup-fsl-opencv-imx.bb | 12 - .../packagegroup-fsl-tools-benchmark.bb | 23 -- .../packagegroup-fsl-tools-testapps.bb | 45 --- ...01-3rdparty-ippicv-Use-pre-downloaded-ipp.patch | 37 -- ...missing-header-for-LIBAVCODEC_VERSION_INT.patch | 26 -- ...Add-smaller-version-of-download_models.py.patch | 180 --------- .../opencv/opencv/0001-Dont-use-isystem.patch | 28 -- .../opencv/0001-Make-ts-module-external.patch | 42 --- ...-work-around-deprecated-ffmpeg-RAW-functi.patch | 32 -- .../0001-Use-Os-to-compile-tinyxml2.cpp.patch | 31 -- ...ne-argument-version-of-SetTotalBytesLimit.patch | 41 --- .../opencv/0001-sfm-link-with-Glog_LIBS.patch | 44 --- .../opencv/0003-To-fix-errors-as-following.patch | 71 ---- .../opencv/opencv/OpenCV_DNN_examples.patch | 141 ------- recipes-support/opencv/opencv/download.patch | 41 --- .../opencv/fix-build-with-protobuf-v22.patch | 408 --------------------- recipes-support/opencv/opencv_4.6.0.imx.bb | 318 ---------------- 34 files changed, 1520 insertions(+), 1520 deletions(-) create mode 100644 dynamic-layers/openembedded-layer/recipes-fsl/packagegroups/packagegroup-fsl-opencv-imx.bb create mode 100644 dynamic-layers/openembedded-layer/recipes-fsl/packagegroups/packagegroup-fsl-tools-benchmark.bb create mode 100644 dynamic-layers/openembedded-layer/recipes-fsl/packagegroups/packagegroup-fsl-tools-testapps.bb create mode 100644 dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Add-smaller-version-of-download_models.py.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/download.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/fix-build-with-protobuf-v22.patch create mode 100644 dynamic-layers/openembedded-layer/recipes-support/opencv/opencv_4.6.0.imx.bb delete mode 100644 recipes-fsl/packagegroups/packagegroup-fsl-opencv-imx.bb delete mode 100644 recipes-fsl/packagegroups/packagegroup-fsl-tools-benchmark.bb delete mode 100644 recipes-fsl/packagegroups/packagegroup-fsl-tools-testapps.bb delete mode 100644 recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch delete mode 100644 recipes-support/opencv/opencv/0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch delete mode 100644 recipes-support/opencv/opencv/0001-Add-smaller-version-of-download_models.py.patch delete mode 100644 recipes-support/opencv/opencv/0001-Dont-use-isystem.patch delete mode 100644 recipes-support/opencv/opencv/0001-Make-ts-module-external.patch delete mode 100644 recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch delete mode 100644 recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch delete mode 100644 recipes-support/opencv/opencv/0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch delete mode 100644 recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch delete mode 100644 recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch delete mode 100644 recipes-support/opencv/opencv/OpenCV_DNN_examples.patch delete mode 100644 recipes-support/opencv/opencv/download.patch delete mode 100644 recipes-support/opencv/opencv/fix-build-with-protobuf-v22.patch delete mode 100644 recipes-support/opencv/opencv_4.6.0.imx.bb diff --git a/dynamic-layers/openembedded-layer/recipes-fsl/packagegroups/packagegroup-fsl-opencv-imx.bb b/dynamic-layers/openembedded-layer/recipes-fsl/packagegroups/packagegroup-fsl-opencv-imx.bb new file mode 100644 index 000000000..724d0ff53 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-fsl/packagegroups/packagegroup-fsl-opencv-imx.bb @@ -0,0 +1,12 @@ +DESCRIPTION = "Add packages for opencv i.MX build" + +inherit packagegroup + +OPENCV_PKGS = " \ + opencv-apps \ + opencv-samples \ + python3-opencv \ +" +RDEPENDS:${PN} = " \ + ${OPENCV_PKGS} \ +" diff --git a/dynamic-layers/openembedded-layer/recipes-fsl/packagegroups/packagegroup-fsl-tools-benchmark.bb b/dynamic-layers/openembedded-layer/recipes-fsl/packagegroups/packagegroup-fsl-tools-benchmark.bb new file mode 100644 index 000000000..534d37627 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-fsl/packagegroups/packagegroup-fsl-tools-benchmark.bb @@ -0,0 +1,23 @@ +# Copyright (C) 2012-2016 Freescale Semiconductor +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "Package group used by FSL Community to provide a set of benchmark applications." +SUMMARY = "FSL Communtiy package group - tools/benchmark" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +inherit packagegroup + +RDEPENDS:${PN} = " \ + lmbench \ + bonnie++ \ + dbench \ + fio \ + iozone3 \ + iperf3 \ + nbench-byte \ + tiobench \ + ${@bb.utils.contains('TUNE_FEATURES', 'neon', 'cpuburn-neon', \ + bb.utils.contains('TUNE_FEATURES', 'cortexa53 crypto', 'cpuburn-neon', \ + '', d), d)} \ +" diff --git a/dynamic-layers/openembedded-layer/recipes-fsl/packagegroups/packagegroup-fsl-tools-testapps.bb b/dynamic-layers/openembedded-layer/recipes-fsl/packagegroups/packagegroup-fsl-tools-testapps.bb new file mode 100644 index 000000000..2706dca97 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-fsl/packagegroups/packagegroup-fsl-tools-testapps.bb @@ -0,0 +1,45 @@ +# Copyright (C) 2012-2014, 2016 Freescale Semiconductor +# Copyright (C) 2015, 2016 O.S. Systems Software LTDA. +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "Packagegroup used by FSL Community to provide a set of packages and utilities \ +for hardware test." +SUMMARY = "FSL Community packagegroup - tools/testapps" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +inherit packagegroup + +SOC_TOOLS_TEST = "" +SOC_TOOLS_TEST:imx-nxp-bsp = "imx-test" +SOC_TOOLS_TEST:imxgpu = "imx-test imx-gpu-viv-demos" +SOC_TOOLS_TEST:qoriq = "ceetm optee-test-qoriq" + +RDEPENDS:${PN} = " \ + alsa-utils \ + alsa-tools \ + dosfstools \ + evtest \ + e2fsprogs-mke2fs \ + ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'fsl-rc-local', '', d)} \ + fbset \ + i2c-tools \ + iproute2 \ + memtester \ + python3-core \ + python3-json \ + python3-datetime \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'v4l-utils', '', d)} \ + ethtool \ + mtd-utils \ + mtd-utils-ubifs \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gtk+3-demo', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', \ + 'weston-examples', '', d)} \ + ${SOC_TOOLS_TEST} \ +" + +RDEPENDS_IMX_TO_REMOVE = "" +RDEPENDS_IMX_TO_REMOVE:imxgpu3d = "" + +RDEPENDS:${PN}:remove = "${RDEPENDS_IMX_TO_REMOVE}" diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch new file mode 100644 index 000000000..b1b00623d --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch @@ -0,0 +1,37 @@ +From 9b4959b97d2e95d4b49cf6ca2a3fce3cdb484f2d Mon Sep 17 00:00:00 2001 +From: Ricardo Ribalda Delgado +Date: Thu, 31 Mar 2016 00:20:15 +0200 +Subject: [PATCH] 3rdparty/ippicv: Use pre-downloaded ipp + +Upstream-Status: Pending +Signed-off-by: Ricardo Ribalda Delgado +Signed-off-by: Ismo Puustinen + +--- + 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/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch new file mode 100644 index 000000000..59da6ab32 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch @@ -0,0 +1,26 @@ +From d6bdd0a91eb0ed57688c0af5ba5088cf0afdc0a0 Mon Sep 17 00:00:00 2001 +From: Jochen Sprickerhof +Date: Mon, 8 Aug 2022 21:10:13 +0200 +Subject: [PATCH] Add missing header for LIBAVCODEC_VERSION_INT + +Upstream-Status: Backport [https://github.com/opencv/opencv/pull/22357] +Signed-off-by: Khem Raj +--- + modules/videoio/src/ffmpeg_codecs.hpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules/videoio/src/ffmpeg_codecs.hpp b/modules/videoio/src/ffmpeg_codecs.hpp +index 61788e0345..faad2596ed 100644 +--- a/modules/videoio/src/ffmpeg_codecs.hpp ++++ b/modules/videoio/src/ffmpeg_codecs.hpp +@@ -60,6 +60,7 @@ extern "C" { + #include + #endif + ++#include + #include + + #ifdef __cplusplus +-- +2.38.1 + diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Add-smaller-version-of-download_models.py.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Add-smaller-version-of-download_models.py.patch new file mode 100644 index 000000000..46232ec5c --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Add-smaller-version-of-download_models.py.patch @@ -0,0 +1,180 @@ +From fca4d9eec289f22c081daa2c61a1110e3f268f92 Mon Sep 17 00:00:00 2001 +From: Tom Hochstein +Date: Tue, 1 Sep 2020 14:57:07 -0500 +Subject: [PATCH] Add smaller version of download_models.py + +Upstream-Status: Pending +Signed-off-by: Tom Hochstein +--- + 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 '' ++ 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/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch new file mode 100644 index 000000000..948a80faf --- /dev/null +++ b/dynamic-layers/openembedded-layer/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 +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 + +--- + 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/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch new file mode 100644 index 000000000..d56b8ae67 --- /dev/null +++ b/dynamic-layers/openembedded-layer/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 +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 +--- + 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/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch new file mode 100644 index 000000000..aa7d335ea --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch @@ -0,0 +1,32 @@ +From e4ec6cea72da9e9ae5ba57140fa2f5c63f1f8295 Mon Sep 17 00:00:00 2001 +From: Jason Wessel +Date: Wed, 9 May 2018 13:33:59 -0700 +Subject: [PATCH] Temporarliy work around deprecated ffmpeg RAW function + compile failure until next uprev + +Upstream-Status: Inappropriate [platform specific] +Signed-off-by: Jason Wessel + +--- + 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/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch new file mode 100644 index 000000000..c5a64387f --- /dev/null +++ b/dynamic-layers/openembedded-layer/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 +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 +--- + 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/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch new file mode 100644 index 000000000..5d88d1a6a --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch @@ -0,0 +1,41 @@ +From 9cfa84313c5833d7295fcf57be93d5d2aaadfd88 Mon Sep 17 00:00:00 2001 +From: Vincent Rabaud +Date: Sat, 10 Jul 2021 00:21:52 +0200 +Subject: [PATCH] Use the one argument version of SetTotalBytesLimit. + +The two argument versions has been deprecated, cf +https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.coded_stream + +Upstream-Status: Backport [9cfa84313c5833d7295fcf57be93d5d2aaadfd88 - from master after 4.5.3 tag] +Signed-off-by: Martin Jansa +--- + modules/dnn/src/caffe/caffe_io.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp +index 2fc4d84f46..ebecf95eea 100644 +--- a/modules/dnn/src/caffe/caffe_io.cpp ++++ b/modules/dnn/src/caffe/caffe_io.cpp +@@ -92,6 +92,7 @@ + #ifdef HAVE_PROTOBUF + #include + #include ++#include + #include + + #include +@@ -1111,7 +1112,11 @@ static const int kProtoReadBytesLimit = INT_MAX; // Max size of 2 GB minus 1 by + + bool ReadProtoFromBinary(ZeroCopyInputStream* input, Message *proto) { + CodedInputStream coded_input(input); ++#if GOOGLE_PROTOBUF_VERSION >= 3006000 ++ coded_input.SetTotalBytesLimit(kProtoReadBytesLimit); ++#else + coded_input.SetTotalBytesLimit(kProtoReadBytesLimit, 536870912); ++#endif + + return proto->ParseFromCodedStream(&coded_input); + } +-- +2.32.0 + diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch new file mode 100644 index 000000000..7b2c4100a --- /dev/null +++ b/dynamic-layers/openembedded-layer/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 +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 +--- + 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/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch new file mode 100644 index 000000000..d39c05822 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch @@ -0,0 +1,71 @@ +From f42c9b8c7bafcadc7e95fb25a391707f970eb426 Mon Sep 17 00:00:00 2001 +From: Huang Qiyu +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()'" + +Upstream-Status: Pending +Signed-off-by: Huang Qiyu + +Also add the visibility changes for certain OpenCL-related functions in +ts module. + +Signed-off-by: Ismo Puustinen + +--- + 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/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch new file mode 100644 index 000000000..ef7831a5f --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch @@ -0,0 +1,141 @@ +From 3c4daafb54f961e376104a461ca7ec114ff0331a Mon Sep 17 00:00:00 2001 +From: Ludek Slosarcik +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 + +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 +@@ -12,6 +12,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.}" +@@ -113,7 +114,7 @@ int main(int argc, char** argv) + if (parser.has("input")) + cap.open(parser.get("input")); + else +- cap.open(0); ++ cap.open(parser.get("device")); + //! [Open a video file or an image file or a camera stream] + + // Process frames. +@@ -195,14 +196,14 @@ int main(int argc, char** argv) + } + std::string label = format("Inference time of 1 round: %.2f ms", t1); + std::string label2 = format("Average time of 200 rounds: %.2f ms", timeRecorder.getTimeMilli()/200); +- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); +- putText(frame, label2, Point(0, 35), 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); ++ putText(frame, label2, Point(0, 45), 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, 55), 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); + } +Index: git/samples/dnn/object_detection.cpp +=================================================================== +--- git.orig/samples/dnn/object_detection.cpp ++++ git/samples/dnn/object_detection.cpp +@@ -260,13 +260,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); + } +@@ -302,7 +302,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); + } +@@ -471,7 +471,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 +@@ -162,7 +162,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("input")) : cap.open(0); ++ bool openSuccess = parser.has("input") ? cap.open(parser.get("input")) : cap.open(parser.get("device")); + CV_Assert(openSuccess); + + static const std::string kWinName = "EAST: An Efficient and Accurate Scene Text Detector"; diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/download.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/download.patch new file mode 100644 index 000000000..33ac48312 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/download.patch @@ -0,0 +1,41 @@ +From b18a280fab06a680d9f831bf8b462647f3cb6214 Mon Sep 17 00:00:00 2001 +From: Ross Burton +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 + +--- + 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 /.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}") diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/fix-build-with-protobuf-v22.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/fix-build-with-protobuf-v22.patch new file mode 100644 index 000000000..3538f24b3 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/fix-build-with-protobuf-v22.patch @@ -0,0 +1,408 @@ +From 5e4150826fea6f37276f348c65d94ce4847d1211 Mon Sep 17 00:00:00 2001 +From: Kumataro +Date: Sat, 7 Oct 2023 10:11:25 +0900 +Subject: [PATCH] 3rdparty: supporting protobuf v22 and later + +Upstream-Status: Submitted [https://github.com/opencv/opencv/pull/24372] +--- + cmake/OpenCVFindProtobuf.cmake | 37 ++++++++++++++++++++++++++++++++++ + modules/dnn/CMakeLists.txt | 9 +++++++++ + 2 files changed, 46 insertions(+) + +diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake +index 8835347d1d..9bd5c28db8 100644 +--- a/cmake/OpenCVFindProtobuf.cmake ++++ b/cmake/OpenCVFindProtobuf.cmake +@@ -67,6 +67,38 @@ else() + endif() + endif() + ++# See https://github.com/opencv/opencv/issues/24369 ++# In Protocol Buffers v22.0 and later drops C++11 support and depends abseil-cpp. ++# Details: https://protobuf.dev/news/2022-08-03/ ++# And if std::text_view is in abseil-cpp requests C++17 and later. ++if(HAVE_PROTOBUF) ++ if("${Protobuf_VERSION}" MATCHES [[[0-9]+.([0-9]+).[0-9]+]]) ++ string(COMPARE GREATER_EQUAL "${CMAKE_MATCH_1}" "22" REQUEST_ABSL) ++ ++ if(REQUEST_ABSL) ++ string(COMPARE GREATER_EQUAL "${CMAKE_CXX_STANDARD}" "17" USED_AFTER_CXX17) ++ if(NOT USED_AFTER_CXX17) ++ message("CMAKE_CXX_STANDARD : ${CMAKE_CXX_STANDARD}") ++ message("protobuf : ${Protobuf_VERSION}") ++ message(FATAL_ERROR "protobuf(v22 and later) and abseil-cpp request CMAKE_CXX_STANDARD=17 and later.") ++ endif() ++ ++ ocv_check_modules(ABSL_STRINGS absl_strings) ++ if(NOT ABSL_STRINGS_FOUND) ++ message(FATAL_ERROR "protobuf(v22 and later) requests abseil-cpp(strings), but missing.") ++ endif() ++ ++ ocv_check_modules(ABSL_LOG absl_log) ++ if(NOT ABSL_LOG_FOUND) ++ message(FATAL_ERROR "protobuf(v22 and later) requests abseil-cpp(log), but missing.") ++ endif() ++ ++ endif() ++ else() ++ message(FATAL_ERROR "Protobuf version(${Protobuf_VERSION}) is unexpected to split.") ++ endif() ++endif() ++ + if(HAVE_PROTOBUF AND PROTOBUF_UPDATE_FILES AND NOT COMMAND PROTOBUF_GENERATE_CPP) + message(FATAL_ERROR "Can't configure protobuf dependency (BUILD_PROTOBUF=${BUILD_PROTOBUF} PROTOBUF_UPDATE_FILES=${PROTOBUF_UPDATE_FILES})") + endif() +@@ -89,3 +121,8 @@ if(HAVE_PROTOBUF) + BUILD_PROTOBUF THEN "build (${Protobuf_VERSION})" + ELSE "${__location} (${Protobuf_VERSION})") + endif() ++ ++if(HAVE_ABSL_STRINGS AND HAVE_ABSL_LOG) ++ list(APPEND CUSTOM_STATUS absl) ++ list(APPEND CUSTOM_STATUS_absl " abseil-cpp:" "YES (${ABSL_STRINGS_VERSION})" ) ++endif() +diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt +index 804b78ead2..d32007b37e 100644 +--- a/modules/dnn/CMakeLists.txt ++++ b/modules/dnn/CMakeLists.txt +@@ -149,6 +149,15 @@ if(NOT BUILD_PROTOBUF) + list(APPEND include_dirs ${Protobuf_INCLUDE_DIRS}) + endif() + ++if(HAVE_ABSL_STRINGS) ++ list(APPEND libs ${ABSL_STRINGS_LIBRARIES}) ++ list(APPEND include_dirs ${ABSL_STRTRINGS_INCLUDE_DIRS}) ++endif() ++if(HAVE_ABSL_LOG) ++ list(APPEND libs ${ABSL_LOG_LIBRARIES}) ++ list(APPEND include_dirs ${ABSL_LOG_INCLUDE_DIRS}) ++endif() ++ + set(sources_options "") + + list(APPEND libs ${LAPACK_LIBRARIES}) +From 06a7669521d205f647d3e718322ccd153cdbbb77 Mon Sep 17 00:00:00 2001 +From: Kumataro +Date: Sun, 8 Oct 2023 09:39:35 +0900 +Subject: [PATCH] dnn: disable some tests for external protobuf + +--- + modules/dnn/CMakeLists.txt | 5 +++++ + modules/dnn/src/caffe/caffe_io.cpp | 24 ++++++++++++++++++++++-- + modules/dnn/test/test_layers.cpp | 16 ++++++++++++++++ + 3 files changed, 43 insertions(+), 2 deletions(-) + +diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt +index d32007b37e..face38465f 100644 +--- a/modules/dnn/CMakeLists.txt ++++ b/modules/dnn/CMakeLists.txt +@@ -254,6 +254,12 @@ ocv_create_module(${libs} ${dnn_runtime_libs}) + ocv_add_samples() + ocv_add_accuracy_tests(${dnn_runtime_libs}) + ++if(NOT BUILD_PROTOBUF) ++ if(TARGET opencv_test_dnn) ++ ocv_target_compile_definitions(opencv_test_dnn PRIVATE "OPENCV_DNN_EXTERNAL_PROTOBUF=1") ++ endif() ++endif() ++ + set(perf_path "${CMAKE_CURRENT_LIST_DIR}/perf") + file(GLOB_RECURSE perf_srcs "${perf_path}/*.cpp") + file(GLOB_RECURSE perf_hdrs "${perf_path}/*.hpp" "${perf_path}/*.h") + +diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp +index ebecf95eea..ebceca84cf 100644 +--- a/modules/dnn/src/caffe/caffe_io.cpp ++++ b/modules/dnn/src/caffe/caffe_io.cpp +@@ -1130,7 +1130,17 @@ bool ReadProtoFromTextFile(const char* filename, Message* proto) { + parser.AllowUnknownField(true); + parser.SetRecursionLimit(1000); + #endif +- return parser.Parse(&input, proto); ++ const bool ret = parser.Parse(&input, proto); ++ ++#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF ++ if(!ret) ++ { ++ LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; ++ CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); ++ } ++#endif ++ ++ return ret; + } + + bool ReadProtoFromBinaryFile(const char* filename, Message* proto) { +@@ -1148,7 +1158,17 @@ bool ReadProtoFromTextBuffer(const char* data, size_t len, Message* proto) { + parser.AllowUnknownField(true); + parser.SetRecursionLimit(1000); + #endif +- return parser.Parse(&input, proto); ++ const bool ret = parser.Parse(&input, proto); ++ ++#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF ++ if(!ret) ++ { ++ LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; ++ CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); ++ } ++#endif ++ ++ return ret; + } + + +diff --git a/modules/dnn/test/test_layers.cpp b/modules/dnn/test/test_layers.cpp +index 763d94b99c..a07d442d76 100644 +--- a/modules/dnn/test/test_layers.cpp ++++ b/modules/dnn/test/test_layers.cpp +@@ -754,7 +754,11 @@ TEST_F(Layer_RNN_Test, get_set_test) + EXPECT_EQ(shape(outputs[1]), shape(nT, nS, nH)); + } + ++#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF + TEST_P(Test_Caffe_layers, Accum) ++#else ++TEST_P(Test_Caffe_layers, DISABLED_Accum) // requires patched protobuf (available in OpenCV source tree only) ++#endif + { + if (backend == DNN_BACKEND_OPENCV && target != DNN_TARGET_CPU) + applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL, CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); +@@ -778,7 +782,11 @@ TEST_P(Test_Caffe_layers, ChannelNorm) + testLayerUsingCaffeModels("channel_norm", false, false); + } + ++#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF + TEST_P(Test_Caffe_layers, DataAugmentation) ++#else ++TEST_P(Test_Caffe_layers, DISABLED_DataAugmentation) // requires patched protobuf (available in OpenCV source tree only) ++#endif + { + if (backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16) + applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); +@@ -787,7 +795,11 @@ TEST_P(Test_Caffe_layers, DataAugmentation) + testLayerUsingCaffeModels("data_augmentation_8x6", true, false); + } + ++#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF + TEST_P(Test_Caffe_layers, Resample) ++#else ++TEST_P(Test_Caffe_layers, DISABLED_Resample) // requires patched protobuf (available in OpenCV source tree only) ++#endif + { + if (backend != DNN_BACKEND_OPENCV) + applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH); +@@ -795,7 +807,11 @@ TEST_P(Test_Caffe_layers, Resample) + testLayerUsingCaffeModels("nearest", false, false); + } + ++#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF + TEST_P(Test_Caffe_layers, Correlation) ++#else ++TEST_P(Test_Caffe_layers, DISABLED_Correlation) // requires patched protobuf (available in OpenCV source tree only) ++#endif + { + if (backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16) + applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, +From 2c33798f41942aefc203183d673ce4846f32dba4 Mon Sep 17 00:00:00 2001 +From: Kumataro +Date: Sun, 8 Oct 2023 13:28:40 +0900 +Subject: [PATCH] use GREATER instead of GREATER_EQUAL and remove new blank + line at EOF + +--- + cmake/OpenCVFindProtobuf.cmake | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake +index 9bd5c28db8..ba147526d6 100644 +--- a/cmake/OpenCVFindProtobuf.cmake ++++ b/cmake/OpenCVFindProtobuf.cmake +@@ -71,12 +71,14 @@ endif() + # In Protocol Buffers v22.0 and later drops C++11 support and depends abseil-cpp. + # Details: https://protobuf.dev/news/2022-08-03/ + # And if std::text_view is in abseil-cpp requests C++17 and later. ++ + if(HAVE_PROTOBUF) + if("${Protobuf_VERSION}" MATCHES [[[0-9]+.([0-9]+).[0-9]+]]) +- string(COMPARE GREATER_EQUAL "${CMAKE_MATCH_1}" "22" REQUEST_ABSL) ++ string(COMPARE GREATER "${CMAKE_MATCH_1}" "21" REQUEST_ABSL) # >=22 + + if(REQUEST_ABSL) +- string(COMPARE GREATER_EQUAL "${CMAKE_CXX_STANDARD}" "17" USED_AFTER_CXX17) ++ string(COMPARE GREATER "${CMAKE_CXX_STANDARD}" "16" USED_AFTER_CXX17) # >=17 ++ + if(NOT USED_AFTER_CXX17) + message("CMAKE_CXX_STANDARD : ${CMAKE_CXX_STANDARD}") + message("protobuf : ${Protobuf_VERSION}") +From cd709eefbeedd116bf3495b42280323b932791ff Mon Sep 17 00:00:00 2001 +From: Kumataro +Date: Mon, 9 Oct 2023 21:51:04 +0900 +Subject: [PATCH] fix for review + +--- + cmake/OpenCVFindProtobuf.cmake | 5 ---- + modules/dnn/src/caffe/caffe_io.cpp | 24 ++---------------- + modules/dnn/test/test_layers.cpp | 40 +++++++++++++++--------------- + 3 files changed, 22 insertions(+), 47 deletions(-) + +diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake +index ba147526d6..2faf1010bf 100644 +--- a/cmake/OpenCVFindProtobuf.cmake ++++ b/cmake/OpenCVFindProtobuf.cmake +@@ -123,8 +123,3 @@ if(HAVE_PROTOBUF) + BUILD_PROTOBUF THEN "build (${Protobuf_VERSION})" + ELSE "${__location} (${Protobuf_VERSION})") + endif() +- +-if(HAVE_ABSL_STRINGS AND HAVE_ABSL_LOG) +- list(APPEND CUSTOM_STATUS absl) +- list(APPEND CUSTOM_STATUS_absl " abseil-cpp:" "YES (${ABSL_STRINGS_VERSION})" ) +-endif() +diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp +index ebceca84cf..ebecf95eea 100644 +--- a/modules/dnn/src/caffe/caffe_io.cpp ++++ b/modules/dnn/src/caffe/caffe_io.cpp +@@ -1130,17 +1130,7 @@ bool ReadProtoFromTextFile(const char* filename, Message* proto) { + parser.AllowUnknownField(true); + parser.SetRecursionLimit(1000); + #endif +- const bool ret = parser.Parse(&input, proto); +- +-#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF +- if(!ret) +- { +- LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; +- CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); +- } +-#endif +- +- return ret; ++ return parser.Parse(&input, proto); + } + + bool ReadProtoFromBinaryFile(const char* filename, Message* proto) { +@@ -1158,17 +1148,7 @@ bool ReadProtoFromTextBuffer(const char* data, size_t len, Message* proto) { + parser.AllowUnknownField(true); + parser.SetRecursionLimit(1000); + #endif +- const bool ret = parser.Parse(&input, proto); +- +-#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF +- if(!ret) +- { +- LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; +- CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); +- } +-#endif +- +- return ret; ++ return parser.Parse(&input, proto); + } + + +diff --git a/modules/dnn/test/test_layers.cpp b/modules/dnn/test/test_layers.cpp +index a07d442d76..5c6fc541d7 100644 +--- a/modules/dnn/test/test_layers.cpp ++++ b/modules/dnn/test/test_layers.cpp +@@ -754,17 +754,17 @@ TEST_F(Layer_RNN_Test, get_set_test) + EXPECT_EQ(shape(outputs[1]), shape(nT, nS, nH)); + } + +-#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF + TEST_P(Test_Caffe_layers, Accum) +-#else +-TEST_P(Test_Caffe_layers, DISABLED_Accum) // requires patched protobuf (available in OpenCV source tree only) +-#endif + { ++#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF ++ throw SkipTestException("Requires patched protobuf"); ++#else + if (backend == DNN_BACKEND_OPENCV && target != DNN_TARGET_CPU) + applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL, CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); + + testLayerUsingCaffeModels("accum", false, false, 0.0, 0.0, 2); + testLayerUsingCaffeModels("accum_ref", false, false, 0.0, 0.0, 2); ++#endif + } + + TEST_P(Test_Caffe_layers, FlowWarp) +@@ -782,42 +782,42 @@ TEST_P(Test_Caffe_layers, ChannelNorm) + testLayerUsingCaffeModels("channel_norm", false, false); + } + +-#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF + TEST_P(Test_Caffe_layers, DataAugmentation) +-#else +-TEST_P(Test_Caffe_layers, DISABLED_DataAugmentation) // requires patched protobuf (available in OpenCV source tree only) +-#endif + { ++#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF ++ throw SkipTestException("Requires patched protobuf"); ++#else + if (backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16) + applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); + testLayerUsingCaffeModels("data_augmentation", true, false); + testLayerUsingCaffeModels("data_augmentation_2x1", true, false); + testLayerUsingCaffeModels("data_augmentation_8x6", true, false); ++#endif + } + +-#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF + TEST_P(Test_Caffe_layers, Resample) +-#else +-TEST_P(Test_Caffe_layers, DISABLED_Resample) // requires patched protobuf (available in OpenCV source tree only) +-#endif + { ++#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF ++ throw SkipTestException("Requires patched protobuf"); ++#else + if (backend != DNN_BACKEND_OPENCV) + applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH); + testLayerUsingCaffeModels("nearest_2inps", false, false, 0.0, 0.0, 2); + testLayerUsingCaffeModels("nearest", false, false); ++#endif + } + +-#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF + TEST_P(Test_Caffe_layers, Correlation) +-#else +-TEST_P(Test_Caffe_layers, DISABLED_Correlation) // requires patched protobuf (available in OpenCV source tree only) +-#endif + { ++#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF ++ throw SkipTestException("Requires patched protobuf"); ++#else + if (backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16) + applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, + CV_TEST_TAG_DNN_SKIP_OPENCL, CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); + testLayerUsingCaffeModels("correlation", false, false, 0.0, 0.0, 2); + } ++#endif + + TEST_P(Test_Caffe_layers, Convolution2Inputs) + { +@@ -1644,12 +1644,11 @@ private: + int outWidth, outHeight, zoomFactor; + }; + +-#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF + TEST_P(Test_Caffe_layers, Interp) +-#else +-TEST_P(Test_Caffe_layers, DISABLED_Interp) // requires patched protobuf (available in OpenCV source tree only) +-#endif + { ++#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF ++ throw SkipTestException("Requires patched protobuf"); ++#else + #if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2022010000) + // Cannot get memory! + if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target == DNN_TARGET_CPU) +@@ -1686,6 +1685,7 @@ TEST_P(Test_Caffe_layers, DISABLED_Interp) // requires patched protobuf (availa + + // Test an implemented layer. + testLayerUsingCaffeModels("layer_interp", false, false); ++#endif + } + + INSTANTIATE_TEST_CASE_P(/*nothing*/, Test_Caffe_layers, dnnBackendsAndTargets()); diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv_4.6.0.imx.bb b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv_4.6.0.imx.bb new file mode 100644 index 000000000..0195bc61a --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv_4.6.0.imx.bb @@ -0,0 +1,318 @@ +# This recipe is for the i.MX fork of opencv. For ease of +# maintenance, the top section is a verbatim copy of an OE-core +# recipe. The second section customizes the recipe for i.MX. + +########## meta-openembedded copy ########### +# Upstream hash: 72dc42966be7da07f9553f75b825123b81704f0b +# Commit https://github.com/openembedded/meta-openembedded/commit/225ce6a14a8110ab6b573b4dc9f5297a03d17e0f added + +SUMMARY = "Opencv : The Open Computer Vision Library" +HOMEPAGE = "http://opencv.org/" +SECTION = "libs" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" + +ARM_INSTRUCTION_SET:armv4 = "arm" +ARM_INSTRUCTION_SET:armv5 = "arm" + +DEPENDS = "libtool swig-native bzip2 zlib glib-2.0 libwebp" + +SRCREV_opencv = "b0dc474160e389b9c9045da5db49d03ae17c6a6b" +SRCREV_contrib = "7b77c355a8fdc97667b3fa1e7a0d37e4973fc868" +SRCREV_ipp = "a56b6ac6f030c312b2dce17430eef13aed9af274" +SRCREV_boostdesc = "34e4206aef44d50e6bbcd0ab06354b52e7466d26" +SRCREV_vgg = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d" +SRCREV_face = "8afa57abc8229d611c4937165d20e2a2d9fc5a12" +SRCREV_wechat-qrcode = "a8b69ccc738421293254aec5ddb38bd523503252" + +def ipp_filename(d): + import re + arch = d.getVar('TARGET_ARCH') + if re.match("i.86$", arch): + return "ippicv_2020_lnx_ia32_20191018_general.tgz" + else: + return "ippicv_2020_lnx_intel64_20191018_general.tgz" + +def ipp_md5sum(d): + import re + arch = d.getVar('TARGET_ARCH') + if re.match("i.86$", arch): + return "ad189a940fb60eb71f291321322fe3e8" + else: + return "7421de0095c7a39162ae13a6098782f9" + +IPP_FILENAME = "${@ipp_filename(d)}" +IPP_MD5 = "${@ipp_md5sum(d)}" + +SRCREV_FORMAT = "opencv_contrib_ipp_boostdesc_vgg" +SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=master;protocol=https \ + git://github.com/opencv/opencv_contrib.git;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/contrib;name=contrib;branch=master;protocol=https \ + git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20191018;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/ipp;name=ipp;protocol=https \ + git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/boostdesc;name=boostdesc;protocol=https \ + git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/vgg;name=vgg;protocol=https \ + git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/face;name=face;protocol=https \ + git://github.com/WeChatCV/opencv_3rdparty.git;branch=wechat_qrcode;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/wechat_qrcode;name=wechat-qrcode;protocol=https \ + file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \ + file://0003-To-fix-errors-as-following.patch \ + file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \ + file://0001-Dont-use-isystem.patch \ + file://download.patch \ + file://0001-Make-ts-module-external.patch \ + file://0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch \ + file://fix-build-with-protobuf-v22.patch \ + " +SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=contrib" + +# OpenCV wants to download more files during configure. We download these in +# do_fetch and construct a source cache in the format it expects +OPENCV_DLDIR = "${UNPACKDIR}/downloads" + +do_unpack_extra() { + tar xzf ${S}/ipp/ippicv/${IPP_FILENAME} -C ${S} + + md5() { + # Return the MD5 of $1 + echo $(md5sum $1 | cut -d' ' -f1) + } + cache() { + TAG=$1 + shift + mkdir --parents ${OPENCV_DLDIR}/$TAG + for F in $*; do + DEST=${OPENCV_DLDIR}/$TAG/$(md5 $F)-$(basename $F) + test -e $DEST || ln -s $F $DEST + done + } + cache xfeatures2d/boostdesc ${S}/boostdesc/*.i + cache xfeatures2d/vgg ${S}/vgg/*.i + cache data ${S}/face/*.dat + cache wechat_qrcode ${S}/wechat_qrcode/*.caffemodel + cache wechat_qrcode ${S}/wechat_qrcode/*.prototxt +} +addtask unpack_extra after do_unpack before do_patch + +CMAKE_VERBOSE = "VERBOSE=1" + +EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${S}/contrib/modules \ + -DWITH_1394=OFF \ + -DENABLE_PRECOMPILED_HEADERS=OFF \ + -DCMAKE_SKIP_RPATH=ON \ + -DOPENCV_ICV_HASH=${IPP_MD5} \ + -DIPPROOT=${S}/ippicv_lnx \ + -DOPENCV_GENERATE_PKGCONFIG=ON \ + -DOPENCV_DOWNLOAD_PATH=${OPENCV_DLDIR} \ + -DOPENCV_ALLOW_DOWNLOADS=OFF \ + ${@bb.utils.contains("TARGET_CC_ARCH", "-msse3", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1", "", d)} \ + ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \ + ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.2", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1 -DENABLE_SSE42=1", "", d)} \ +" +LDFLAGS:append:mips = " -Wl,--no-as-needed -latomic -Wl,--as-needed" +LDFLAGS:append:riscv32 = " -Wl,--no-as-needed -latomic -Wl,--as-needed" + +EXTRA_OECMAKE:append:x86 = " -DX86=ON" +# disable sse4.1 and sse4.2 to fix 32bit build failure +# https://github.com/opencv/opencv/issues/21597 +EXTRA_OECMAKE:remove:x86 = " -DENABLE_SSE41=1 -DENABLE_SSE42=1" + +PACKAGECONFIG ??= "gapi python3 eigen jpeg png tiff v4l libv4l gstreamer samples tbb gphoto2 \ + ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \ + ${@bb.utils.contains_any("LICENSE_FLAGS_ACCEPTED", "commercial_ffmpeg commercial", "libav", "", d)}" + +# TBB does not build for powerpc so disable that package config +PACKAGECONFIG:remove:powerpc = "tbb" +# tbb now needs getcontect/setcontext which is not there for all arches on musl +PACKAGECONFIG:remove:libc-musl:riscv64 = "tbb" +PACKAGECONFIG:remove:libc-musl:riscv32 = "tbb" + +PACKAGECONFIG[gapi] = "-DWITH_ADE=ON -Dade_DIR=${STAGING_LIBDIR},-DWITH_ADE=OFF,ade" +PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas," +PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft," +PACKAGECONFIG[dnn] = "-DBUILD_opencv_dnn=ON -DPROTOBUF_UPDATE_FILES=ON -DBUILD_PROTOBUF=OFF -DCMAKE_CXX_STANDARD=17,-DBUILD_opencv_dnn=OFF,protobuf protobuf-native," +PACKAGECONFIG[eigen] = "-DWITH_EIGEN=ON,-DWITH_EIGEN=OFF,libeigen gflags glog," +PACKAGECONFIG[freetype] = "-DBUILD_opencv_freetype=ON,-DBUILD_opencv_freetype=OFF,freetype," +PACKAGECONFIG[gphoto2] = "-DWITH_GPHOTO2=ON,-DWITH_GPHOTO2=OFF,libgphoto2," +PACKAGECONFIG[gstreamer] = "-DWITH_GSTREAMER=ON,-DWITH_GSTREAMER=OFF,gstreamer1.0 gstreamer1.0-plugins-base," +PACKAGECONFIG[gtk] = "-DWITH_GTK=ON,-DWITH_GTK=OFF,gtk+3," +PACKAGECONFIG[jasper] = "-DWITH_JASPER=ON,-DWITH_JASPER=OFF,jasper," +PACKAGECONFIG[java] = "-DJAVA_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native fastjar-native openjdk-8-native," +PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON,-DWITH_JPEG=OFF,jpeg," +PACKAGECONFIG[libav] = "-DWITH_FFMPEG=ON,-DWITH_FFMPEG=OFF,libav," +PACKAGECONFIG[libv4l] = "-DWITH_LIBV4L=ON,-DWITH_LIBV4L=OFF,v4l-utils," +PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,opencl-headers virtual/libopencl1," +PACKAGECONFIG[oracle-java] = "-DJAVA_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${ORACLE_JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native oracle-jse-jdk oracle-jse-jdk-native," +PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng," +PACKAGECONFIG[python2] = "-DPYTHON2_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python-numpy," +PACKAGECONFIG[python3] = "-DPYTHON3_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/_core/include,,python3-numpy," +PACKAGECONFIG[samples] = "-DBUILD_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON,-DBUILD_EXAMPLES=OFF,," +PACKAGECONFIG[tbb] = "-DWITH_TBB=ON,-DWITH_TBB=OFF,tbb," +PACKAGECONFIG[tests] = "-DBUILD_TESTS=ON,-DBUILD_TESTS=OFF,," +PACKAGECONFIG[text] = "-DBUILD_opencv_text=ON,-DBUILD_opencv_text=OFF,tesseract," +PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff," +PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils," + +inherit pkgconfig cmake + +inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'setuptools3-base', '', d)} +inherit ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'distutils-base', '', d)} + +export PYTHON_CSPEC = "-I${STAGING_INCDIR}/${PYTHON_DIR}" +export PYTHON = "${STAGING_BINDIR_NATIVE}/${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3', 'python', d)}" +export ORACLE_JAVA_HOME = "${STAGING_DIR_NATIVE}/usr/bin/java" +export JAVA_HOME = "${STAGING_DIR_NATIVE}/usr/lib/jvm/openjdk-8-native" +export ANT_DIR = "${STAGING_DIR_NATIVE}/usr/share/ant/" + +TARGET_CC_ARCH += "-I${S}/include " + +PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'samples', '${PN}-samples', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'oracle-java', '${PN}-java', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'java', '${PN}-java', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'python-${BPN}', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-${BPN}', '', d)} \ + ${PN}-apps" + +python populate_packages:prepend () { + cv_libdir = d.expand('${libdir}') + do_split_packages(d, cv_libdir, r'^lib(.*)\.so$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev', allow_links=True) + do_split_packages(d, cv_libdir, r'^lib(.*)\.la$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev') + do_split_packages(d, cv_libdir, r'^lib(.*)\.a$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev') + do_split_packages(d, cv_libdir, r'^lib(.*)\.so\.*', 'lib%s', 'OpenCV %s library', extra_depends='', allow_links=True) + + pn = d.getVar('PN') + metapkg = pn + '-dev' + d.setVar('ALLOW_EMPTY:' + metapkg, "1") + blacklist = [ metapkg ] + metapkg_rdepends = [ ] + packages = d.getVar('PACKAGES').split() + for pkg in packages[1:]: + if not pkg in blacklist and not pkg in metapkg_rdepends and pkg.endswith('-dev'): + metapkg_rdepends.append(pkg) + d.setVar('RRECOMMENDS:' + metapkg, ' '.join(metapkg_rdepends)) + + metapkg = pn + d.setVar('ALLOW_EMPTY:' + metapkg, "1") + blacklist = [ metapkg, "libopencv-ts" ] + metapkg_rdepends = [ ] + for pkg in packages[1:]: + if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-doc') and not pkg.endswith('-locale') and not pkg.endswith('-staticdev'): + metapkg_rdepends.append(pkg) + d.setVar('RDEPENDS:' + metapkg, ' '.join(metapkg_rdepends)) +} + +PACKAGES_DYNAMIC += "^libopencv-.*" + +FILES:${PN} = "" +FILES:${PN}-dbg += "${datadir}/OpenCV/java/.debug/* ${datadir}/OpenCV/samples/bin/.debug/*" +FILES:${PN}-dev = "${includedir} ${libdir}/pkgconfig ${libdir}/cmake/opencv4/*.cmake" +FILES:${PN}-staticdev += "${libdir}/opencv4/3rdparty/*.a" +FILES:${PN}-apps = "${bindir}/* ${datadir}/opencv4 ${datadir}/licenses" +FILES:${PN}-java = "${datadir}/OpenCV/java" +FILES:${PN}-samples = "${datadir}/opencv4/samples/" + +INSANE_SKIP:${PN}-java = "libdir" +INSANE_SKIP:${PN}-dbg = "libdir" + +ALLOW_EMPTY:${PN} = "1" + +SUMMARY:python-opencv = "Python bindings to opencv" +FILES:python-opencv = "${PYTHON_SITEPACKAGES_DIR}/*" +RDEPENDS:python-opencv = "python-core python-numpy" + +SUMMARY:python3-opencv = "Python bindings to opencv" +FILES:python3-opencv = "${PYTHON_SITEPACKAGES_DIR}/*" +RDEPENDS:python3-opencv = "python3-core python3-numpy" + +RDEPENDS:${PN}-apps = "bash" + +do_compile:prepend() { + # remove the build host info to improve reproducibility + if [ -f ${WORKDIR}/build/modules/core/version_string.inc ]; then + sed -i "s#${WORKDIR}#/workdir#g" ${WORKDIR}/build/modules/core/version_string.inc + fi +} + +do_install:append() { + # Move Python files into correct library folder (for multilib build) + if [ "$libdir" != "/usr/lib" -a -d ${D}/usr/lib ]; then + mv ${D}/usr/lib/* ${D}/${libdir}/ + rm -rf ${D}/usr/lib + fi + # remove build host path to improve reproducibility + if [ -f ${D}${libdir}/cmake/opencv4/OpenCVModules.cmake ]; then + sed -e 's@${STAGING_DIR_HOST}@@g' \ + -i ${D}${libdir}/cmake/opencv4/OpenCVModules.cmake + fi + # remove setup_vars_opencv4.sh as its content is confusing and useless + if [ -f ${D}${bindir}/setup_vars_opencv4.sh ]; then + rm -rf ${D}${bindir}/setup_vars_opencv4.sh + fi +} + +########## End of meta-openembedded copy ########## + +########## i.MX overrides ########## + +SUMMARY = "Opencv : The Open Computer Vision Library, i.MX Fork" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" + +# Replace the opencv URL with the fork +SRC_URI:remove = "git://github.com/opencv/opencv.git;name=opencv;branch=master;protocol=https" +SRC_URI =+ "${OPENCV_SRC};branch=${SRCBRANCH};name=opencv" +OPENCV_SRC ?= "git://github.com/nxp-imx/opencv-imx.git;protocol=https;branch=master" +SRCBRANCH = "4.6.0_imx" +SRCREV_opencv = "d3440df40a6e90cd1d2a1b729bcbc16aa4d42f5d" + +# Add opencv_extra +SRC_URI += " \ + git://github.com/opencv/opencv_extra.git;destsuffix=extra;name=extra;branch=master;protocol=https \ + file://0001-Add-smaller-version-of-download_models.py.patch;patchdir=${UNPACKDIR}/extra \ +" +SRCREV_FORMAT:append = "_extra" +SRCREV_extra = "936854e2b666853d6d0732a8eabc2d699f4fa3d8" + +# Patch DNN example +SRC_URI += " \ + file://OpenCV_DNN_examples.patch \ +" + +PACKAGECONFIG:remove = "eigen" + +PACKAGECONFIG:append:mx8-nxp-bsp = " dnn text" +PACKAGECONFIG:append:mx9-nxp-bsp = " dnn text" + +PACKAGECONFIG:append = " ${PACKAGECONFIG_OPENCL}" +PACKAGECONFIG_OPENCL = "" +PACKAGECONFIG_OPENCL:mx8-nxp-bsp = "opencl" +PACKAGECONFIG_OPENCL:mx8dxl-nxp-bsp = "" +PACKAGECONFIG_OPENCL:mx8mm-nxp-bsp = "" +PACKAGECONFIG_OPENCL:mx8mnul-nxp-bsp = "" + +PACKAGECONFIG[openvx] = "-DWITH_OPENVX=ON -DOPENVX_ROOT=${STAGING_LIBDIR} -DOPENVX_LIB_CANDIDATES='OpenVX;OpenVXU',-DWITH_OPENVX=OFF,virtual/libopenvx," +PACKAGECONFIG[qt5] = "-DWITH_QT=ON -DOE_QMAKE_PATH_EXTERNAL_HOST_BINS=${STAGING_BINDIR_NATIVE} -DCMAKE_PREFIX_PATH=${STAGING_BINDIR_NATIVE}/cmake,-DWITH_QT=OFF,qtbase qtbase-native," +PACKAGECONFIG[qt6] = "-DWITH_QT=ON -DQT_HOST_PATH=${RECIPE_SYSROOT_NATIVE}${prefix_native},-DWITH_QT=OFF,qtbase qtbase-native," +PACKAGECONFIG[tests-imx] = "-DINSTALL_TESTS=ON -DOPENCV_TEST_DATA_PATH=${UNPACKDIR}/extra/testdata, -DINSTALL_TESTS=OFF," +PACKAGECONFIG[tim-vx] = "-DWITH_TIMVX=ON -DTIMVX_INSTALL_DIR=${STAGING_DIR_HOST}${libdir},-DWITH_TIMVX=OFF,tim-vx" + +# Disable cvv module in opencv_contrib as it is not yet suppported for Qt6 +# (opencv debug framework) +EXTRA_OECMAKE:append = " -DBUILD_opencv_cvv=OFF" + +do_install:append() { + ln -sf opencv4/opencv2 ${D}${includedir}/opencv2 + if ${@bb.utils.contains('PACKAGECONFIG', 'samples', 'true', 'false', d)}; then + install -d ${D}${datadir}/OpenCV/samples/data + cp -r ${S}/samples/data/* ${D}${datadir}/OpenCV/samples/data + install -d ${D}${datadir}/OpenCV/samples/bin/ + cp -f bin/example_* ${D}${datadir}/OpenCV/samples/bin/ + fi + if ${@bb.utils.contains('PACKAGECONFIG', 'tests-imx', 'true', 'false', d)}; then + cp -r share/opencv4/testdata/cv/face/* ${D}${datadir}/opencv4/testdata/cv/face/ + fi +} + +FILES:${PN}-samples += "${datadir}/OpenCV/samples" + +COMPATIBLE_MACHINE = "(mx8-nxp-bsp|mx9-nxp-bsp)" + +########## End of i.MX overrides ########## diff --git a/recipes-fsl/packagegroups/packagegroup-fsl-opencv-imx.bb b/recipes-fsl/packagegroups/packagegroup-fsl-opencv-imx.bb deleted file mode 100644 index 724d0ff53..000000000 --- a/recipes-fsl/packagegroups/packagegroup-fsl-opencv-imx.bb +++ /dev/null @@ -1,12 +0,0 @@ -DESCRIPTION = "Add packages for opencv i.MX build" - -inherit packagegroup - -OPENCV_PKGS = " \ - opencv-apps \ - opencv-samples \ - python3-opencv \ -" -RDEPENDS:${PN} = " \ - ${OPENCV_PKGS} \ -" diff --git a/recipes-fsl/packagegroups/packagegroup-fsl-tools-benchmark.bb b/recipes-fsl/packagegroups/packagegroup-fsl-tools-benchmark.bb deleted file mode 100644 index 534d37627..000000000 --- a/recipes-fsl/packagegroups/packagegroup-fsl-tools-benchmark.bb +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (C) 2012-2016 Freescale Semiconductor -# Released under the MIT license (see COPYING.MIT for the terms) - -DESCRIPTION = "Package group used by FSL Community to provide a set of benchmark applications." -SUMMARY = "FSL Communtiy package group - tools/benchmark" - -PACKAGE_ARCH = "${MACHINE_ARCH}" - -inherit packagegroup - -RDEPENDS:${PN} = " \ - lmbench \ - bonnie++ \ - dbench \ - fio \ - iozone3 \ - iperf3 \ - nbench-byte \ - tiobench \ - ${@bb.utils.contains('TUNE_FEATURES', 'neon', 'cpuburn-neon', \ - bb.utils.contains('TUNE_FEATURES', 'cortexa53 crypto', 'cpuburn-neon', \ - '', d), d)} \ -" diff --git a/recipes-fsl/packagegroups/packagegroup-fsl-tools-testapps.bb b/recipes-fsl/packagegroups/packagegroup-fsl-tools-testapps.bb deleted file mode 100644 index 2706dca97..000000000 --- a/recipes-fsl/packagegroups/packagegroup-fsl-tools-testapps.bb +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (C) 2012-2014, 2016 Freescale Semiconductor -# Copyright (C) 2015, 2016 O.S. Systems Software LTDA. -# Released under the MIT license (see COPYING.MIT for the terms) - -DESCRIPTION = "Packagegroup used by FSL Community to provide a set of packages and utilities \ -for hardware test." -SUMMARY = "FSL Community packagegroup - tools/testapps" - -PACKAGE_ARCH = "${MACHINE_ARCH}" - -inherit packagegroup - -SOC_TOOLS_TEST = "" -SOC_TOOLS_TEST:imx-nxp-bsp = "imx-test" -SOC_TOOLS_TEST:imxgpu = "imx-test imx-gpu-viv-demos" -SOC_TOOLS_TEST:qoriq = "ceetm optee-test-qoriq" - -RDEPENDS:${PN} = " \ - alsa-utils \ - alsa-tools \ - dosfstools \ - evtest \ - e2fsprogs-mke2fs \ - ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'fsl-rc-local', '', d)} \ - fbset \ - i2c-tools \ - iproute2 \ - memtester \ - python3-core \ - python3-json \ - python3-datetime \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'v4l-utils', '', d)} \ - ethtool \ - mtd-utils \ - mtd-utils-ubifs \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gtk+3-demo', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', \ - 'weston-examples', '', d)} \ - ${SOC_TOOLS_TEST} \ -" - -RDEPENDS_IMX_TO_REMOVE = "" -RDEPENDS_IMX_TO_REMOVE:imxgpu3d = "" - -RDEPENDS:${PN}:remove = "${RDEPENDS_IMX_TO_REMOVE}" diff --git a/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch b/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch deleted file mode 100644 index b1b00623d..000000000 --- a/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 9b4959b97d2e95d4b49cf6ca2a3fce3cdb484f2d Mon Sep 17 00:00:00 2001 -From: Ricardo Ribalda Delgado -Date: Thu, 31 Mar 2016 00:20:15 +0200 -Subject: [PATCH] 3rdparty/ippicv: Use pre-downloaded ipp - -Upstream-Status: Pending -Signed-off-by: Ricardo Ribalda Delgado -Signed-off-by: Ismo Puustinen - ---- - 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/recipes-support/opencv/opencv/0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch b/recipes-support/opencv/opencv/0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch deleted file mode 100644 index 59da6ab32..000000000 --- a/recipes-support/opencv/opencv/0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch +++ /dev/null @@ -1,26 +0,0 @@ -From d6bdd0a91eb0ed57688c0af5ba5088cf0afdc0a0 Mon Sep 17 00:00:00 2001 -From: Jochen Sprickerhof -Date: Mon, 8 Aug 2022 21:10:13 +0200 -Subject: [PATCH] Add missing header for LIBAVCODEC_VERSION_INT - -Upstream-Status: Backport [https://github.com/opencv/opencv/pull/22357] -Signed-off-by: Khem Raj ---- - modules/videoio/src/ffmpeg_codecs.hpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/modules/videoio/src/ffmpeg_codecs.hpp b/modules/videoio/src/ffmpeg_codecs.hpp -index 61788e0345..faad2596ed 100644 ---- a/modules/videoio/src/ffmpeg_codecs.hpp -+++ b/modules/videoio/src/ffmpeg_codecs.hpp -@@ -60,6 +60,7 @@ extern "C" { - #include - #endif - -+#include - #include - - #ifdef __cplusplus --- -2.38.1 - diff --git a/recipes-support/opencv/opencv/0001-Add-smaller-version-of-download_models.py.patch b/recipes-support/opencv/opencv/0001-Add-smaller-version-of-download_models.py.patch deleted file mode 100644 index 46232ec5c..000000000 --- a/recipes-support/opencv/opencv/0001-Add-smaller-version-of-download_models.py.patch +++ /dev/null @@ -1,180 +0,0 @@ -From fca4d9eec289f22c081daa2c61a1110e3f268f92 Mon Sep 17 00:00:00 2001 -From: Tom Hochstein -Date: Tue, 1 Sep 2020 14:57:07 -0500 -Subject: [PATCH] Add smaller version of download_models.py - -Upstream-Status: Pending -Signed-off-by: Tom Hochstein ---- - 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 '' -+ 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/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch b/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch deleted file mode 100644 index 948a80faf..000000000 --- a/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 66e50ee69fa9ee2469d349100e70d8b296c4b4dc Mon Sep 17 00:00:00 2001 -From: Khem Raj -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 - ---- - 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/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch b/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch deleted file mode 100644 index d56b8ae67..000000000 --- a/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 11bbf909e08594628bd757d989ae34cf1bfe200b Mon Sep 17 00:00:00 2001 -From: Mingli Yu -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 ---- - 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/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch b/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch deleted file mode 100644 index aa7d335ea..000000000 --- a/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch +++ /dev/null @@ -1,32 +0,0 @@ -From e4ec6cea72da9e9ae5ba57140fa2f5c63f1f8295 Mon Sep 17 00:00:00 2001 -From: Jason Wessel -Date: Wed, 9 May 2018 13:33:59 -0700 -Subject: [PATCH] Temporarliy work around deprecated ffmpeg RAW function - compile failure until next uprev - -Upstream-Status: Inappropriate [platform specific] -Signed-off-by: Jason Wessel - ---- - 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/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch b/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch deleted file mode 100644 index c5a64387f..000000000 --- a/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 59fafe6e39759e193b5764b36b4c5a93da352123 Mon Sep 17 00:00:00 2001 -From: Khem Raj -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 ---- - 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/recipes-support/opencv/opencv/0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch b/recipes-support/opencv/opencv/0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch deleted file mode 100644 index 5d88d1a6a..000000000 --- a/recipes-support/opencv/opencv/0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 9cfa84313c5833d7295fcf57be93d5d2aaadfd88 Mon Sep 17 00:00:00 2001 -From: Vincent Rabaud -Date: Sat, 10 Jul 2021 00:21:52 +0200 -Subject: [PATCH] Use the one argument version of SetTotalBytesLimit. - -The two argument versions has been deprecated, cf -https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.coded_stream - -Upstream-Status: Backport [9cfa84313c5833d7295fcf57be93d5d2aaadfd88 - from master after 4.5.3 tag] -Signed-off-by: Martin Jansa ---- - modules/dnn/src/caffe/caffe_io.cpp | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp -index 2fc4d84f46..ebecf95eea 100644 ---- a/modules/dnn/src/caffe/caffe_io.cpp -+++ b/modules/dnn/src/caffe/caffe_io.cpp -@@ -92,6 +92,7 @@ - #ifdef HAVE_PROTOBUF - #include - #include -+#include - #include - - #include -@@ -1111,7 +1112,11 @@ static const int kProtoReadBytesLimit = INT_MAX; // Max size of 2 GB minus 1 by - - bool ReadProtoFromBinary(ZeroCopyInputStream* input, Message *proto) { - CodedInputStream coded_input(input); -+#if GOOGLE_PROTOBUF_VERSION >= 3006000 -+ coded_input.SetTotalBytesLimit(kProtoReadBytesLimit); -+#else - coded_input.SetTotalBytesLimit(kProtoReadBytesLimit, 536870912); -+#endif - - return proto->ParseFromCodedStream(&coded_input); - } --- -2.32.0 - diff --git a/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch b/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch deleted file mode 100644 index 7b2c4100a..000000000 --- a/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch +++ /dev/null @@ -1,44 +0,0 @@ -From ffe20fc4ec46c6b491eff29a38f90686d4d035f6 Mon Sep 17 00:00:00 2001 -From: Martin Jansa -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 ---- - 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/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch b/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch deleted file mode 100644 index d39c05822..000000000 --- a/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch +++ /dev/null @@ -1,71 +0,0 @@ -From f42c9b8c7bafcadc7e95fb25a391707f970eb426 Mon Sep 17 00:00:00 2001 -From: Huang Qiyu -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()'" - -Upstream-Status: Pending -Signed-off-by: Huang Qiyu - -Also add the visibility changes for certain OpenCL-related functions in -ts module. - -Signed-off-by: Ismo Puustinen - ---- - 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/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch b/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch deleted file mode 100644 index ef7831a5f..000000000 --- a/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch +++ /dev/null @@ -1,141 +0,0 @@ -From 3c4daafb54f961e376104a461ca7ec114ff0331a Mon Sep 17 00:00:00 2001 -From: Ludek Slosarcik -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 - -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 -@@ -12,6 +12,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.}" -@@ -113,7 +114,7 @@ int main(int argc, char** argv) - if (parser.has("input")) - cap.open(parser.get("input")); - else -- cap.open(0); -+ cap.open(parser.get("device")); - //! [Open a video file or an image file or a camera stream] - - // Process frames. -@@ -195,14 +196,14 @@ int main(int argc, char** argv) - } - std::string label = format("Inference time of 1 round: %.2f ms", t1); - std::string label2 = format("Average time of 200 rounds: %.2f ms", timeRecorder.getTimeMilli()/200); -- putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0)); -- putText(frame, label2, Point(0, 35), 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); -+ putText(frame, label2, Point(0, 45), 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, 55), 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); - } -Index: git/samples/dnn/object_detection.cpp -=================================================================== ---- git.orig/samples/dnn/object_detection.cpp -+++ git/samples/dnn/object_detection.cpp -@@ -260,13 +260,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); - } -@@ -302,7 +302,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); - } -@@ -471,7 +471,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 -@@ -162,7 +162,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("input")) : cap.open(0); -+ bool openSuccess = parser.has("input") ? cap.open(parser.get("input")) : cap.open(parser.get("device")); - CV_Assert(openSuccess); - - static const std::string kWinName = "EAST: An Efficient and Accurate Scene Text Detector"; diff --git a/recipes-support/opencv/opencv/download.patch b/recipes-support/opencv/opencv/download.patch deleted file mode 100644 index 33ac48312..000000000 --- a/recipes-support/opencv/opencv/download.patch +++ /dev/null @@ -1,41 +0,0 @@ -From b18a280fab06a680d9f831bf8b462647f3cb6214 Mon Sep 17 00:00:00 2001 -From: Ross Burton -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 - ---- - 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 /.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}") diff --git a/recipes-support/opencv/opencv/fix-build-with-protobuf-v22.patch b/recipes-support/opencv/opencv/fix-build-with-protobuf-v22.patch deleted file mode 100644 index 3538f24b3..000000000 --- a/recipes-support/opencv/opencv/fix-build-with-protobuf-v22.patch +++ /dev/null @@ -1,408 +0,0 @@ -From 5e4150826fea6f37276f348c65d94ce4847d1211 Mon Sep 17 00:00:00 2001 -From: Kumataro -Date: Sat, 7 Oct 2023 10:11:25 +0900 -Subject: [PATCH] 3rdparty: supporting protobuf v22 and later - -Upstream-Status: Submitted [https://github.com/opencv/opencv/pull/24372] ---- - cmake/OpenCVFindProtobuf.cmake | 37 ++++++++++++++++++++++++++++++++++ - modules/dnn/CMakeLists.txt | 9 +++++++++ - 2 files changed, 46 insertions(+) - -diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake -index 8835347d1d..9bd5c28db8 100644 ---- a/cmake/OpenCVFindProtobuf.cmake -+++ b/cmake/OpenCVFindProtobuf.cmake -@@ -67,6 +67,38 @@ else() - endif() - endif() - -+# See https://github.com/opencv/opencv/issues/24369 -+# In Protocol Buffers v22.0 and later drops C++11 support and depends abseil-cpp. -+# Details: https://protobuf.dev/news/2022-08-03/ -+# And if std::text_view is in abseil-cpp requests C++17 and later. -+if(HAVE_PROTOBUF) -+ if("${Protobuf_VERSION}" MATCHES [[[0-9]+.([0-9]+).[0-9]+]]) -+ string(COMPARE GREATER_EQUAL "${CMAKE_MATCH_1}" "22" REQUEST_ABSL) -+ -+ if(REQUEST_ABSL) -+ string(COMPARE GREATER_EQUAL "${CMAKE_CXX_STANDARD}" "17" USED_AFTER_CXX17) -+ if(NOT USED_AFTER_CXX17) -+ message("CMAKE_CXX_STANDARD : ${CMAKE_CXX_STANDARD}") -+ message("protobuf : ${Protobuf_VERSION}") -+ message(FATAL_ERROR "protobuf(v22 and later) and abseil-cpp request CMAKE_CXX_STANDARD=17 and later.") -+ endif() -+ -+ ocv_check_modules(ABSL_STRINGS absl_strings) -+ if(NOT ABSL_STRINGS_FOUND) -+ message(FATAL_ERROR "protobuf(v22 and later) requests abseil-cpp(strings), but missing.") -+ endif() -+ -+ ocv_check_modules(ABSL_LOG absl_log) -+ if(NOT ABSL_LOG_FOUND) -+ message(FATAL_ERROR "protobuf(v22 and later) requests abseil-cpp(log), but missing.") -+ endif() -+ -+ endif() -+ else() -+ message(FATAL_ERROR "Protobuf version(${Protobuf_VERSION}) is unexpected to split.") -+ endif() -+endif() -+ - if(HAVE_PROTOBUF AND PROTOBUF_UPDATE_FILES AND NOT COMMAND PROTOBUF_GENERATE_CPP) - message(FATAL_ERROR "Can't configure protobuf dependency (BUILD_PROTOBUF=${BUILD_PROTOBUF} PROTOBUF_UPDATE_FILES=${PROTOBUF_UPDATE_FILES})") - endif() -@@ -89,3 +121,8 @@ if(HAVE_PROTOBUF) - BUILD_PROTOBUF THEN "build (${Protobuf_VERSION})" - ELSE "${__location} (${Protobuf_VERSION})") - endif() -+ -+if(HAVE_ABSL_STRINGS AND HAVE_ABSL_LOG) -+ list(APPEND CUSTOM_STATUS absl) -+ list(APPEND CUSTOM_STATUS_absl " abseil-cpp:" "YES (${ABSL_STRINGS_VERSION})" ) -+endif() -diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt -index 804b78ead2..d32007b37e 100644 ---- a/modules/dnn/CMakeLists.txt -+++ b/modules/dnn/CMakeLists.txt -@@ -149,6 +149,15 @@ if(NOT BUILD_PROTOBUF) - list(APPEND include_dirs ${Protobuf_INCLUDE_DIRS}) - endif() - -+if(HAVE_ABSL_STRINGS) -+ list(APPEND libs ${ABSL_STRINGS_LIBRARIES}) -+ list(APPEND include_dirs ${ABSL_STRTRINGS_INCLUDE_DIRS}) -+endif() -+if(HAVE_ABSL_LOG) -+ list(APPEND libs ${ABSL_LOG_LIBRARIES}) -+ list(APPEND include_dirs ${ABSL_LOG_INCLUDE_DIRS}) -+endif() -+ - set(sources_options "") - - list(APPEND libs ${LAPACK_LIBRARIES}) -From 06a7669521d205f647d3e718322ccd153cdbbb77 Mon Sep 17 00:00:00 2001 -From: Kumataro -Date: Sun, 8 Oct 2023 09:39:35 +0900 -Subject: [PATCH] dnn: disable some tests for external protobuf - ---- - modules/dnn/CMakeLists.txt | 5 +++++ - modules/dnn/src/caffe/caffe_io.cpp | 24 ++++++++++++++++++++++-- - modules/dnn/test/test_layers.cpp | 16 ++++++++++++++++ - 3 files changed, 43 insertions(+), 2 deletions(-) - -diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt -index d32007b37e..face38465f 100644 ---- a/modules/dnn/CMakeLists.txt -+++ b/modules/dnn/CMakeLists.txt -@@ -254,6 +254,12 @@ ocv_create_module(${libs} ${dnn_runtime_libs}) - ocv_add_samples() - ocv_add_accuracy_tests(${dnn_runtime_libs}) - -+if(NOT BUILD_PROTOBUF) -+ if(TARGET opencv_test_dnn) -+ ocv_target_compile_definitions(opencv_test_dnn PRIVATE "OPENCV_DNN_EXTERNAL_PROTOBUF=1") -+ endif() -+endif() -+ - set(perf_path "${CMAKE_CURRENT_LIST_DIR}/perf") - file(GLOB_RECURSE perf_srcs "${perf_path}/*.cpp") - file(GLOB_RECURSE perf_hdrs "${perf_path}/*.hpp" "${perf_path}/*.h") - -diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp -index ebecf95eea..ebceca84cf 100644 ---- a/modules/dnn/src/caffe/caffe_io.cpp -+++ b/modules/dnn/src/caffe/caffe_io.cpp -@@ -1130,7 +1130,17 @@ bool ReadProtoFromTextFile(const char* filename, Message* proto) { - parser.AllowUnknownField(true); - parser.SetRecursionLimit(1000); - #endif -- return parser.Parse(&input, proto); -+ const bool ret = parser.Parse(&input, proto); -+ -+#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF -+ if(!ret) -+ { -+ LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; -+ CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); -+ } -+#endif -+ -+ return ret; - } - - bool ReadProtoFromBinaryFile(const char* filename, Message* proto) { -@@ -1148,7 +1158,17 @@ bool ReadProtoFromTextBuffer(const char* data, size_t len, Message* proto) { - parser.AllowUnknownField(true); - parser.SetRecursionLimit(1000); - #endif -- return parser.Parse(&input, proto); -+ const bool ret = parser.Parse(&input, proto); -+ -+#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF -+ if(!ret) -+ { -+ LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; -+ CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); -+ } -+#endif -+ -+ return ret; - } - - -diff --git a/modules/dnn/test/test_layers.cpp b/modules/dnn/test/test_layers.cpp -index 763d94b99c..a07d442d76 100644 ---- a/modules/dnn/test/test_layers.cpp -+++ b/modules/dnn/test/test_layers.cpp -@@ -754,7 +754,11 @@ TEST_F(Layer_RNN_Test, get_set_test) - EXPECT_EQ(shape(outputs[1]), shape(nT, nS, nH)); - } - -+#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF - TEST_P(Test_Caffe_layers, Accum) -+#else -+TEST_P(Test_Caffe_layers, DISABLED_Accum) // requires patched protobuf (available in OpenCV source tree only) -+#endif - { - if (backend == DNN_BACKEND_OPENCV && target != DNN_TARGET_CPU) - applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL, CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); -@@ -778,7 +782,11 @@ TEST_P(Test_Caffe_layers, ChannelNorm) - testLayerUsingCaffeModels("channel_norm", false, false); - } - -+#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF - TEST_P(Test_Caffe_layers, DataAugmentation) -+#else -+TEST_P(Test_Caffe_layers, DISABLED_DataAugmentation) // requires patched protobuf (available in OpenCV source tree only) -+#endif - { - if (backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16) - applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); -@@ -787,7 +795,11 @@ TEST_P(Test_Caffe_layers, DataAugmentation) - testLayerUsingCaffeModels("data_augmentation_8x6", true, false); - } - -+#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF - TEST_P(Test_Caffe_layers, Resample) -+#else -+TEST_P(Test_Caffe_layers, DISABLED_Resample) // requires patched protobuf (available in OpenCV source tree only) -+#endif - { - if (backend != DNN_BACKEND_OPENCV) - applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH); -@@ -795,7 +807,11 @@ TEST_P(Test_Caffe_layers, Resample) - testLayerUsingCaffeModels("nearest", false, false); - } - -+#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF - TEST_P(Test_Caffe_layers, Correlation) -+#else -+TEST_P(Test_Caffe_layers, DISABLED_Correlation) // requires patched protobuf (available in OpenCV source tree only) -+#endif - { - if (backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16) - applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, -From 2c33798f41942aefc203183d673ce4846f32dba4 Mon Sep 17 00:00:00 2001 -From: Kumataro -Date: Sun, 8 Oct 2023 13:28:40 +0900 -Subject: [PATCH] use GREATER instead of GREATER_EQUAL and remove new blank - line at EOF - ---- - cmake/OpenCVFindProtobuf.cmake | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake -index 9bd5c28db8..ba147526d6 100644 ---- a/cmake/OpenCVFindProtobuf.cmake -+++ b/cmake/OpenCVFindProtobuf.cmake -@@ -71,12 +71,14 @@ endif() - # In Protocol Buffers v22.0 and later drops C++11 support and depends abseil-cpp. - # Details: https://protobuf.dev/news/2022-08-03/ - # And if std::text_view is in abseil-cpp requests C++17 and later. -+ - if(HAVE_PROTOBUF) - if("${Protobuf_VERSION}" MATCHES [[[0-9]+.([0-9]+).[0-9]+]]) -- string(COMPARE GREATER_EQUAL "${CMAKE_MATCH_1}" "22" REQUEST_ABSL) -+ string(COMPARE GREATER "${CMAKE_MATCH_1}" "21" REQUEST_ABSL) # >=22 - - if(REQUEST_ABSL) -- string(COMPARE GREATER_EQUAL "${CMAKE_CXX_STANDARD}" "17" USED_AFTER_CXX17) -+ string(COMPARE GREATER "${CMAKE_CXX_STANDARD}" "16" USED_AFTER_CXX17) # >=17 -+ - if(NOT USED_AFTER_CXX17) - message("CMAKE_CXX_STANDARD : ${CMAKE_CXX_STANDARD}") - message("protobuf : ${Protobuf_VERSION}") -From cd709eefbeedd116bf3495b42280323b932791ff Mon Sep 17 00:00:00 2001 -From: Kumataro -Date: Mon, 9 Oct 2023 21:51:04 +0900 -Subject: [PATCH] fix for review - ---- - cmake/OpenCVFindProtobuf.cmake | 5 ---- - modules/dnn/src/caffe/caffe_io.cpp | 24 ++---------------- - modules/dnn/test/test_layers.cpp | 40 +++++++++++++++--------------- - 3 files changed, 22 insertions(+), 47 deletions(-) - -diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake -index ba147526d6..2faf1010bf 100644 ---- a/cmake/OpenCVFindProtobuf.cmake -+++ b/cmake/OpenCVFindProtobuf.cmake -@@ -123,8 +123,3 @@ if(HAVE_PROTOBUF) - BUILD_PROTOBUF THEN "build (${Protobuf_VERSION})" - ELSE "${__location} (${Protobuf_VERSION})") - endif() -- --if(HAVE_ABSL_STRINGS AND HAVE_ABSL_LOG) -- list(APPEND CUSTOM_STATUS absl) -- list(APPEND CUSTOM_STATUS_absl " abseil-cpp:" "YES (${ABSL_STRINGS_VERSION})" ) --endif() -diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp -index ebceca84cf..ebecf95eea 100644 ---- a/modules/dnn/src/caffe/caffe_io.cpp -+++ b/modules/dnn/src/caffe/caffe_io.cpp -@@ -1130,17 +1130,7 @@ bool ReadProtoFromTextFile(const char* filename, Message* proto) { - parser.AllowUnknownField(true); - parser.SetRecursionLimit(1000); - #endif -- const bool ret = parser.Parse(&input, proto); -- --#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF -- if(!ret) -- { -- LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; -- CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); -- } --#endif -- -- return ret; -+ return parser.Parse(&input, proto); - } - - bool ReadProtoFromBinaryFile(const char* filename, Message* proto) { -@@ -1158,17 +1148,7 @@ bool ReadProtoFromTextBuffer(const char* data, size_t len, Message* proto) { - parser.AllowUnknownField(true); - parser.SetRecursionLimit(1000); - #endif -- const bool ret = parser.Parse(&input, proto); -- --#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF -- if(!ret) -- { -- LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; -- CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); -- } --#endif -- -- return ret; -+ return parser.Parse(&input, proto); - } - - -diff --git a/modules/dnn/test/test_layers.cpp b/modules/dnn/test/test_layers.cpp -index a07d442d76..5c6fc541d7 100644 ---- a/modules/dnn/test/test_layers.cpp -+++ b/modules/dnn/test/test_layers.cpp -@@ -754,17 +754,17 @@ TEST_F(Layer_RNN_Test, get_set_test) - EXPECT_EQ(shape(outputs[1]), shape(nT, nS, nH)); - } - --#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF - TEST_P(Test_Caffe_layers, Accum) --#else --TEST_P(Test_Caffe_layers, DISABLED_Accum) // requires patched protobuf (available in OpenCV source tree only) --#endif - { -+#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF -+ throw SkipTestException("Requires patched protobuf"); -+#else - if (backend == DNN_BACKEND_OPENCV && target != DNN_TARGET_CPU) - applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL, CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); - - testLayerUsingCaffeModels("accum", false, false, 0.0, 0.0, 2); - testLayerUsingCaffeModels("accum_ref", false, false, 0.0, 0.0, 2); -+#endif - } - - TEST_P(Test_Caffe_layers, FlowWarp) -@@ -782,42 +782,42 @@ TEST_P(Test_Caffe_layers, ChannelNorm) - testLayerUsingCaffeModels("channel_norm", false, false); - } - --#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF - TEST_P(Test_Caffe_layers, DataAugmentation) --#else --TEST_P(Test_Caffe_layers, DISABLED_DataAugmentation) // requires patched protobuf (available in OpenCV source tree only) --#endif - { -+#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF -+ throw SkipTestException("Requires patched protobuf"); -+#else - if (backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16) - applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); - testLayerUsingCaffeModels("data_augmentation", true, false); - testLayerUsingCaffeModels("data_augmentation_2x1", true, false); - testLayerUsingCaffeModels("data_augmentation_8x6", true, false); -+#endif - } - --#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF - TEST_P(Test_Caffe_layers, Resample) --#else --TEST_P(Test_Caffe_layers, DISABLED_Resample) // requires patched protobuf (available in OpenCV source tree only) --#endif - { -+#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF -+ throw SkipTestException("Requires patched protobuf"); -+#else - if (backend != DNN_BACKEND_OPENCV) - applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH); - testLayerUsingCaffeModels("nearest_2inps", false, false, 0.0, 0.0, 2); - testLayerUsingCaffeModels("nearest", false, false); -+#endif - } - --#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF - TEST_P(Test_Caffe_layers, Correlation) --#else --TEST_P(Test_Caffe_layers, DISABLED_Correlation) // requires patched protobuf (available in OpenCV source tree only) --#endif - { -+#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF -+ throw SkipTestException("Requires patched protobuf"); -+#else - if (backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16) - applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, - CV_TEST_TAG_DNN_SKIP_OPENCL, CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); - testLayerUsingCaffeModels("correlation", false, false, 0.0, 0.0, 2); - } -+#endif - - TEST_P(Test_Caffe_layers, Convolution2Inputs) - { -@@ -1644,12 +1644,11 @@ private: - int outWidth, outHeight, zoomFactor; - }; - --#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF - TEST_P(Test_Caffe_layers, Interp) --#else --TEST_P(Test_Caffe_layers, DISABLED_Interp) // requires patched protobuf (available in OpenCV source tree only) --#endif - { -+#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF -+ throw SkipTestException("Requires patched protobuf"); -+#else - #if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2022010000) - // Cannot get memory! - if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target == DNN_TARGET_CPU) -@@ -1686,6 +1685,7 @@ TEST_P(Test_Caffe_layers, DISABLED_Interp) // requires patched protobuf (availa - - // Test an implemented layer. - testLayerUsingCaffeModels("layer_interp", false, false); -+#endif - } - - INSTANTIATE_TEST_CASE_P(/*nothing*/, Test_Caffe_layers, dnnBackendsAndTargets()); diff --git a/recipes-support/opencv/opencv_4.6.0.imx.bb b/recipes-support/opencv/opencv_4.6.0.imx.bb deleted file mode 100644 index 0195bc61a..000000000 --- a/recipes-support/opencv/opencv_4.6.0.imx.bb +++ /dev/null @@ -1,318 +0,0 @@ -# This recipe is for the i.MX fork of opencv. For ease of -# maintenance, the top section is a verbatim copy of an OE-core -# recipe. The second section customizes the recipe for i.MX. - -########## meta-openembedded copy ########### -# Upstream hash: 72dc42966be7da07f9553f75b825123b81704f0b -# Commit https://github.com/openembedded/meta-openembedded/commit/225ce6a14a8110ab6b573b4dc9f5297a03d17e0f added - -SUMMARY = "Opencv : The Open Computer Vision Library" -HOMEPAGE = "http://opencv.org/" -SECTION = "libs" - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" - -ARM_INSTRUCTION_SET:armv4 = "arm" -ARM_INSTRUCTION_SET:armv5 = "arm" - -DEPENDS = "libtool swig-native bzip2 zlib glib-2.0 libwebp" - -SRCREV_opencv = "b0dc474160e389b9c9045da5db49d03ae17c6a6b" -SRCREV_contrib = "7b77c355a8fdc97667b3fa1e7a0d37e4973fc868" -SRCREV_ipp = "a56b6ac6f030c312b2dce17430eef13aed9af274" -SRCREV_boostdesc = "34e4206aef44d50e6bbcd0ab06354b52e7466d26" -SRCREV_vgg = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d" -SRCREV_face = "8afa57abc8229d611c4937165d20e2a2d9fc5a12" -SRCREV_wechat-qrcode = "a8b69ccc738421293254aec5ddb38bd523503252" - -def ipp_filename(d): - import re - arch = d.getVar('TARGET_ARCH') - if re.match("i.86$", arch): - return "ippicv_2020_lnx_ia32_20191018_general.tgz" - else: - return "ippicv_2020_lnx_intel64_20191018_general.tgz" - -def ipp_md5sum(d): - import re - arch = d.getVar('TARGET_ARCH') - if re.match("i.86$", arch): - return "ad189a940fb60eb71f291321322fe3e8" - else: - return "7421de0095c7a39162ae13a6098782f9" - -IPP_FILENAME = "${@ipp_filename(d)}" -IPP_MD5 = "${@ipp_md5sum(d)}" - -SRCREV_FORMAT = "opencv_contrib_ipp_boostdesc_vgg" -SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=master;protocol=https \ - git://github.com/opencv/opencv_contrib.git;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/contrib;name=contrib;branch=master;protocol=https \ - git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20191018;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/ipp;name=ipp;protocol=https \ - git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/boostdesc;name=boostdesc;protocol=https \ - git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/vgg;name=vgg;protocol=https \ - git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/face;name=face;protocol=https \ - git://github.com/WeChatCV/opencv_3rdparty.git;branch=wechat_qrcode;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/wechat_qrcode;name=wechat-qrcode;protocol=https \ - file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \ - file://0003-To-fix-errors-as-following.patch \ - file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \ - file://0001-Dont-use-isystem.patch \ - file://download.patch \ - file://0001-Make-ts-module-external.patch \ - file://0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch \ - file://fix-build-with-protobuf-v22.patch \ - " -SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=contrib" - -# OpenCV wants to download more files during configure. We download these in -# do_fetch and construct a source cache in the format it expects -OPENCV_DLDIR = "${UNPACKDIR}/downloads" - -do_unpack_extra() { - tar xzf ${S}/ipp/ippicv/${IPP_FILENAME} -C ${S} - - md5() { - # Return the MD5 of $1 - echo $(md5sum $1 | cut -d' ' -f1) - } - cache() { - TAG=$1 - shift - mkdir --parents ${OPENCV_DLDIR}/$TAG - for F in $*; do - DEST=${OPENCV_DLDIR}/$TAG/$(md5 $F)-$(basename $F) - test -e $DEST || ln -s $F $DEST - done - } - cache xfeatures2d/boostdesc ${S}/boostdesc/*.i - cache xfeatures2d/vgg ${S}/vgg/*.i - cache data ${S}/face/*.dat - cache wechat_qrcode ${S}/wechat_qrcode/*.caffemodel - cache wechat_qrcode ${S}/wechat_qrcode/*.prototxt -} -addtask unpack_extra after do_unpack before do_patch - -CMAKE_VERBOSE = "VERBOSE=1" - -EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${S}/contrib/modules \ - -DWITH_1394=OFF \ - -DENABLE_PRECOMPILED_HEADERS=OFF \ - -DCMAKE_SKIP_RPATH=ON \ - -DOPENCV_ICV_HASH=${IPP_MD5} \ - -DIPPROOT=${S}/ippicv_lnx \ - -DOPENCV_GENERATE_PKGCONFIG=ON \ - -DOPENCV_DOWNLOAD_PATH=${OPENCV_DLDIR} \ - -DOPENCV_ALLOW_DOWNLOADS=OFF \ - ${@bb.utils.contains("TARGET_CC_ARCH", "-msse3", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1", "", d)} \ - ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \ - ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.2", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1 -DENABLE_SSE42=1", "", d)} \ -" -LDFLAGS:append:mips = " -Wl,--no-as-needed -latomic -Wl,--as-needed" -LDFLAGS:append:riscv32 = " -Wl,--no-as-needed -latomic -Wl,--as-needed" - -EXTRA_OECMAKE:append:x86 = " -DX86=ON" -# disable sse4.1 and sse4.2 to fix 32bit build failure -# https://github.com/opencv/opencv/issues/21597 -EXTRA_OECMAKE:remove:x86 = " -DENABLE_SSE41=1 -DENABLE_SSE42=1" - -PACKAGECONFIG ??= "gapi python3 eigen jpeg png tiff v4l libv4l gstreamer samples tbb gphoto2 \ - ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \ - ${@bb.utils.contains_any("LICENSE_FLAGS_ACCEPTED", "commercial_ffmpeg commercial", "libav", "", d)}" - -# TBB does not build for powerpc so disable that package config -PACKAGECONFIG:remove:powerpc = "tbb" -# tbb now needs getcontect/setcontext which is not there for all arches on musl -PACKAGECONFIG:remove:libc-musl:riscv64 = "tbb" -PACKAGECONFIG:remove:libc-musl:riscv32 = "tbb" - -PACKAGECONFIG[gapi] = "-DWITH_ADE=ON -Dade_DIR=${STAGING_LIBDIR},-DWITH_ADE=OFF,ade" -PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas," -PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft," -PACKAGECONFIG[dnn] = "-DBUILD_opencv_dnn=ON -DPROTOBUF_UPDATE_FILES=ON -DBUILD_PROTOBUF=OFF -DCMAKE_CXX_STANDARD=17,-DBUILD_opencv_dnn=OFF,protobuf protobuf-native," -PACKAGECONFIG[eigen] = "-DWITH_EIGEN=ON,-DWITH_EIGEN=OFF,libeigen gflags glog," -PACKAGECONFIG[freetype] = "-DBUILD_opencv_freetype=ON,-DBUILD_opencv_freetype=OFF,freetype," -PACKAGECONFIG[gphoto2] = "-DWITH_GPHOTO2=ON,-DWITH_GPHOTO2=OFF,libgphoto2," -PACKAGECONFIG[gstreamer] = "-DWITH_GSTREAMER=ON,-DWITH_GSTREAMER=OFF,gstreamer1.0 gstreamer1.0-plugins-base," -PACKAGECONFIG[gtk] = "-DWITH_GTK=ON,-DWITH_GTK=OFF,gtk+3," -PACKAGECONFIG[jasper] = "-DWITH_JASPER=ON,-DWITH_JASPER=OFF,jasper," -PACKAGECONFIG[java] = "-DJAVA_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native fastjar-native openjdk-8-native," -PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON,-DWITH_JPEG=OFF,jpeg," -PACKAGECONFIG[libav] = "-DWITH_FFMPEG=ON,-DWITH_FFMPEG=OFF,libav," -PACKAGECONFIG[libv4l] = "-DWITH_LIBV4L=ON,-DWITH_LIBV4L=OFF,v4l-utils," -PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,opencl-headers virtual/libopencl1," -PACKAGECONFIG[oracle-java] = "-DJAVA_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${ORACLE_JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native oracle-jse-jdk oracle-jse-jdk-native," -PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng," -PACKAGECONFIG[python2] = "-DPYTHON2_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python-numpy," -PACKAGECONFIG[python3] = "-DPYTHON3_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/_core/include,,python3-numpy," -PACKAGECONFIG[samples] = "-DBUILD_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON,-DBUILD_EXAMPLES=OFF,," -PACKAGECONFIG[tbb] = "-DWITH_TBB=ON,-DWITH_TBB=OFF,tbb," -PACKAGECONFIG[tests] = "-DBUILD_TESTS=ON,-DBUILD_TESTS=OFF,," -PACKAGECONFIG[text] = "-DBUILD_opencv_text=ON,-DBUILD_opencv_text=OFF,tesseract," -PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff," -PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils," - -inherit pkgconfig cmake - -inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'setuptools3-base', '', d)} -inherit ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'distutils-base', '', d)} - -export PYTHON_CSPEC = "-I${STAGING_INCDIR}/${PYTHON_DIR}" -export PYTHON = "${STAGING_BINDIR_NATIVE}/${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3', 'python', d)}" -export ORACLE_JAVA_HOME = "${STAGING_DIR_NATIVE}/usr/bin/java" -export JAVA_HOME = "${STAGING_DIR_NATIVE}/usr/lib/jvm/openjdk-8-native" -export ANT_DIR = "${STAGING_DIR_NATIVE}/usr/share/ant/" - -TARGET_CC_ARCH += "-I${S}/include " - -PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'samples', '${PN}-samples', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'oracle-java', '${PN}-java', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'java', '${PN}-java', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'python-${BPN}', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-${BPN}', '', d)} \ - ${PN}-apps" - -python populate_packages:prepend () { - cv_libdir = d.expand('${libdir}') - do_split_packages(d, cv_libdir, r'^lib(.*)\.so$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev', allow_links=True) - do_split_packages(d, cv_libdir, r'^lib(.*)\.la$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev') - do_split_packages(d, cv_libdir, r'^lib(.*)\.a$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev') - do_split_packages(d, cv_libdir, r'^lib(.*)\.so\.*', 'lib%s', 'OpenCV %s library', extra_depends='', allow_links=True) - - pn = d.getVar('PN') - metapkg = pn + '-dev' - d.setVar('ALLOW_EMPTY:' + metapkg, "1") - blacklist = [ metapkg ] - metapkg_rdepends = [ ] - packages = d.getVar('PACKAGES').split() - for pkg in packages[1:]: - if not pkg in blacklist and not pkg in metapkg_rdepends and pkg.endswith('-dev'): - metapkg_rdepends.append(pkg) - d.setVar('RRECOMMENDS:' + metapkg, ' '.join(metapkg_rdepends)) - - metapkg = pn - d.setVar('ALLOW_EMPTY:' + metapkg, "1") - blacklist = [ metapkg, "libopencv-ts" ] - metapkg_rdepends = [ ] - for pkg in packages[1:]: - if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-doc') and not pkg.endswith('-locale') and not pkg.endswith('-staticdev'): - metapkg_rdepends.append(pkg) - d.setVar('RDEPENDS:' + metapkg, ' '.join(metapkg_rdepends)) -} - -PACKAGES_DYNAMIC += "^libopencv-.*" - -FILES:${PN} = "" -FILES:${PN}-dbg += "${datadir}/OpenCV/java/.debug/* ${datadir}/OpenCV/samples/bin/.debug/*" -FILES:${PN}-dev = "${includedir} ${libdir}/pkgconfig ${libdir}/cmake/opencv4/*.cmake" -FILES:${PN}-staticdev += "${libdir}/opencv4/3rdparty/*.a" -FILES:${PN}-apps = "${bindir}/* ${datadir}/opencv4 ${datadir}/licenses" -FILES:${PN}-java = "${datadir}/OpenCV/java" -FILES:${PN}-samples = "${datadir}/opencv4/samples/" - -INSANE_SKIP:${PN}-java = "libdir" -INSANE_SKIP:${PN}-dbg = "libdir" - -ALLOW_EMPTY:${PN} = "1" - -SUMMARY:python-opencv = "Python bindings to opencv" -FILES:python-opencv = "${PYTHON_SITEPACKAGES_DIR}/*" -RDEPENDS:python-opencv = "python-core python-numpy" - -SUMMARY:python3-opencv = "Python bindings to opencv" -FILES:python3-opencv = "${PYTHON_SITEPACKAGES_DIR}/*" -RDEPENDS:python3-opencv = "python3-core python3-numpy" - -RDEPENDS:${PN}-apps = "bash" - -do_compile:prepend() { - # remove the build host info to improve reproducibility - if [ -f ${WORKDIR}/build/modules/core/version_string.inc ]; then - sed -i "s#${WORKDIR}#/workdir#g" ${WORKDIR}/build/modules/core/version_string.inc - fi -} - -do_install:append() { - # Move Python files into correct library folder (for multilib build) - if [ "$libdir" != "/usr/lib" -a -d ${D}/usr/lib ]; then - mv ${D}/usr/lib/* ${D}/${libdir}/ - rm -rf ${D}/usr/lib - fi - # remove build host path to improve reproducibility - if [ -f ${D}${libdir}/cmake/opencv4/OpenCVModules.cmake ]; then - sed -e 's@${STAGING_DIR_HOST}@@g' \ - -i ${D}${libdir}/cmake/opencv4/OpenCVModules.cmake - fi - # remove setup_vars_opencv4.sh as its content is confusing and useless - if [ -f ${D}${bindir}/setup_vars_opencv4.sh ]; then - rm -rf ${D}${bindir}/setup_vars_opencv4.sh - fi -} - -########## End of meta-openembedded copy ########## - -########## i.MX overrides ########## - -SUMMARY = "Opencv : The Open Computer Vision Library, i.MX Fork" - -LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" - -# Replace the opencv URL with the fork -SRC_URI:remove = "git://github.com/opencv/opencv.git;name=opencv;branch=master;protocol=https" -SRC_URI =+ "${OPENCV_SRC};branch=${SRCBRANCH};name=opencv" -OPENCV_SRC ?= "git://github.com/nxp-imx/opencv-imx.git;protocol=https;branch=master" -SRCBRANCH = "4.6.0_imx" -SRCREV_opencv = "d3440df40a6e90cd1d2a1b729bcbc16aa4d42f5d" - -# Add opencv_extra -SRC_URI += " \ - git://github.com/opencv/opencv_extra.git;destsuffix=extra;name=extra;branch=master;protocol=https \ - file://0001-Add-smaller-version-of-download_models.py.patch;patchdir=${UNPACKDIR}/extra \ -" -SRCREV_FORMAT:append = "_extra" -SRCREV_extra = "936854e2b666853d6d0732a8eabc2d699f4fa3d8" - -# Patch DNN example -SRC_URI += " \ - file://OpenCV_DNN_examples.patch \ -" - -PACKAGECONFIG:remove = "eigen" - -PACKAGECONFIG:append:mx8-nxp-bsp = " dnn text" -PACKAGECONFIG:append:mx9-nxp-bsp = " dnn text" - -PACKAGECONFIG:append = " ${PACKAGECONFIG_OPENCL}" -PACKAGECONFIG_OPENCL = "" -PACKAGECONFIG_OPENCL:mx8-nxp-bsp = "opencl" -PACKAGECONFIG_OPENCL:mx8dxl-nxp-bsp = "" -PACKAGECONFIG_OPENCL:mx8mm-nxp-bsp = "" -PACKAGECONFIG_OPENCL:mx8mnul-nxp-bsp = "" - -PACKAGECONFIG[openvx] = "-DWITH_OPENVX=ON -DOPENVX_ROOT=${STAGING_LIBDIR} -DOPENVX_LIB_CANDIDATES='OpenVX;OpenVXU',-DWITH_OPENVX=OFF,virtual/libopenvx," -PACKAGECONFIG[qt5] = "-DWITH_QT=ON -DOE_QMAKE_PATH_EXTERNAL_HOST_BINS=${STAGING_BINDIR_NATIVE} -DCMAKE_PREFIX_PATH=${STAGING_BINDIR_NATIVE}/cmake,-DWITH_QT=OFF,qtbase qtbase-native," -PACKAGECONFIG[qt6] = "-DWITH_QT=ON -DQT_HOST_PATH=${RECIPE_SYSROOT_NATIVE}${prefix_native},-DWITH_QT=OFF,qtbase qtbase-native," -PACKAGECONFIG[tests-imx] = "-DINSTALL_TESTS=ON -DOPENCV_TEST_DATA_PATH=${UNPACKDIR}/extra/testdata, -DINSTALL_TESTS=OFF," -PACKAGECONFIG[tim-vx] = "-DWITH_TIMVX=ON -DTIMVX_INSTALL_DIR=${STAGING_DIR_HOST}${libdir},-DWITH_TIMVX=OFF,tim-vx" - -# Disable cvv module in opencv_contrib as it is not yet suppported for Qt6 -# (opencv debug framework) -EXTRA_OECMAKE:append = " -DBUILD_opencv_cvv=OFF" - -do_install:append() { - ln -sf opencv4/opencv2 ${D}${includedir}/opencv2 - if ${@bb.utils.contains('PACKAGECONFIG', 'samples', 'true', 'false', d)}; then - install -d ${D}${datadir}/OpenCV/samples/data - cp -r ${S}/samples/data/* ${D}${datadir}/OpenCV/samples/data - install -d ${D}${datadir}/OpenCV/samples/bin/ - cp -f bin/example_* ${D}${datadir}/OpenCV/samples/bin/ - fi - if ${@bb.utils.contains('PACKAGECONFIG', 'tests-imx', 'true', 'false', d)}; then - cp -r share/opencv4/testdata/cv/face/* ${D}${datadir}/opencv4/testdata/cv/face/ - fi -} - -FILES:${PN}-samples += "${datadir}/OpenCV/samples" - -COMPATIBLE_MACHINE = "(mx8-nxp-bsp|mx9-nxp-bsp)" - -########## End of i.MX overrides ########## -- cgit v1.2.3-54-g00ecf From 5505cf5facd4623ad8009fe2945f2381a43abd32 Mon Sep 17 00:00:00 2001 From: Luciano Dittgen Date: Mon, 29 Jun 2026 13:41:14 -0300 Subject: qoriq_build_64bit_kernel: Scope arch QA override Only remove the arch QA check when BUILD_64BIT_KERNEL promotes the QorIQ kernel build to the 64-bit toolchain. This keeps the override tied to the configuration that needs it and handles an empty ERROR_QA value safely. Tested as part of the series with bitbake -p and yocto-check-layer. Signed-off-by: Luciano Dittgen --- classes/qoriq_build_64bit_kernel.bbclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/qoriq_build_64bit_kernel.bbclass b/classes/qoriq_build_64bit_kernel.bbclass index 5186c2a41..9c8f9ce7d 100644 --- a/classes/qoriq_build_64bit_kernel.bbclass +++ b/classes/qoriq_build_64bit_kernel.bbclass @@ -12,7 +12,7 @@ python () { d.setVar('KERNEL_LD', d.getVar('CCACHE', False) + sys_multilib + '-' + 'ld.bfd' + d.getVar('HOST_LD_KERNEL_ARCH', False) + tc_options) d.setVar('KERNEL_AR', d.getVar('CCACHE', False) + sys_multilib + '-' + 'ar' + d.getVar('HOST_AR_KERNEL_ARCH', False)) - error_qa = d.getVar('ERROR_QA') - if 'arch' in error_qa: - d.setVar('ERROR_QA', error_qa.replace(' arch', '')) + error_qa = (d.getVar('ERROR_QA') or '').split() + if 'arch' in error_qa: + d.setVar('ERROR_QA', ' '.join(flag for flag in error_qa if flag != 'arch')) } -- cgit v1.2.3-54-g00ecf From 72444a3452540f9a1b2778f0963caaa880dc8c26 Mon Sep 17 00:00:00 2001 From: Luciano Dittgen Date: Mon, 29 Jun 2026 13:41:14 -0300 Subject: firmware-nxp-wifi: Restrict recipe to i.MX machines The firmware is only used by i.MX BSP machines. Set COMPATIBLE_MACHINE so the recipe is skipped outside the i.MX machine family instead of being exposed to unrelated BSPs. Tested as part of the series with bitbake -p and yocto-check-layer. Signed-off-by: Luciano Dittgen --- recipes-bsp/firmware-imx/firmware-nxp-wifi_1.1.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-bsp/firmware-imx/firmware-nxp-wifi_1.1.bb b/recipes-bsp/firmware-imx/firmware-nxp-wifi_1.1.bb index 98fb5c5e5..f43f2adee 100644 --- a/recipes-bsp/firmware-imx/firmware-nxp-wifi_1.1.bb +++ b/recipes-bsp/firmware-imx/firmware-nxp-wifi_1.1.bb @@ -13,6 +13,7 @@ SRC_URI = "git://github.com/nxp-imx/imx-firmware.git;protocol=https;branch=${SRC SRCBRANCH = "lf-6.18.2_1.0.0" SRCREV = "d7e4bb37b45bbf93faf888e0ca6763a29e28054a" +COMPATIBLE_MACHINE = "(imx-generic-bsp)" inherit allarch -- cgit v1.2.3-54-g00ecf From 18ec8ff159acc314f7e6015df211e15c823233fe Mon Sep 17 00:00:00 2001 From: Luciano Dittgen Date: Mon, 29 Jun 2026 13:41:14 -0300 Subject: iproute2: Scope header install to NXP machines The bbappend installs iproute2 headers for NXP BSP consumers. Apply the install hook only for i.MX and QorIQ machine overrides so generic machines are not affected by the layer. Tested as part of the series with bitbake -p and yocto-check-layer. Signed-off-by: Luciano Dittgen --- recipes-connectivity/iproute2/iproute2_%.bbappend | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/recipes-connectivity/iproute2/iproute2_%.bbappend b/recipes-connectivity/iproute2/iproute2_%.bbappend index 0f9b5a87d..660984d7a 100644 --- a/recipes-connectivity/iproute2/iproute2_%.bbappend +++ b/recipes-connectivity/iproute2/iproute2_%.bbappend @@ -1,5 +1,11 @@ -do_install:append () { - install -d ${D}/usr/include/tc +do_install:append:imx-generic-bsp () { + install -d ${D}/usr/include/tc + cp -a ${B}/include ${D}/usr/include + cp -a ${B}/tc/*.h ${D}/usr/include/tc +} + +do_install:append:qoriq-generic-bsp () { + install -d ${D}/usr/include/tc cp -a ${B}/include ${D}/usr/include cp -a ${B}/tc/*.h ${D}/usr/include/tc } -- cgit v1.2.3-54-g00ecf From 2924609e2d39ccb15f14d309f5db006f5a5a7b18 Mon Sep 17 00:00:00 2001 From: Luciano Dittgen Date: Mon, 29 Jun 2026 13:41:14 -0300 Subject: fsl-image-machine-test: Guard meta-oe packagegroups The testapps and benchmark packagegroups now live in the openembedded-layer dynamic layer. Only install them when that collection is available so the image can parse with the declared core-only layer dependency. Tested as part of the series with bitbake -p and yocto-check-layer. Signed-off-by: Luciano Dittgen --- recipes-fsl/images/fsl-image-machine-test.bb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes-fsl/images/fsl-image-machine-test.bb b/recipes-fsl/images/fsl-image-machine-test.bb index c78828e6f..43af6f7e9 100644 --- a/recipes-fsl/images/fsl-image-machine-test.bb +++ b/recipes-fsl/images/fsl-image-machine-test.bb @@ -20,8 +20,10 @@ CORE_IMAGE_EXTRA_INSTALL += " \ packagegroup-fsl-gstreamer1.0-full \ packagegroup-fsl-tools-gpu \ packagegroup-fsl-tools-gpu-external \ - packagegroup-fsl-tools-testapps \ - packagegroup-fsl-tools-benchmark \ + ${@bb.utils.contains('BBFILE_COLLECTIONS', 'openembedded-layer', \ + 'packagegroup-fsl-tools-testapps', '', d)} \ + ${@bb.utils.contains('BBFILE_COLLECTIONS', 'openembedded-layer', \ + 'packagegroup-fsl-tools-benchmark', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', \ 'firmwared', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', \ -- cgit v1.2.3-54-g00ecf From daa98924994608985236d3729f21dfd395b94323 Mon Sep 17 00:00:00 2001 From: Luciano Dittgen Date: Mon, 29 Jun 2026 13:41:14 -0300 Subject: rapidvulkan: Require vulkan distro feature rapidvulkan is only useful when Vulkan support is enabled. Inherit features_check and require the vulkan distro feature so the recipe is skipped cleanly otherwise. Tested as part of the series with bitbake -p and yocto-check-layer. Signed-off-by: Luciano Dittgen --- recipes-graphics/rapidvulkan/rapidvulkan_1.2.162.0.bb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes-graphics/rapidvulkan/rapidvulkan_1.2.162.0.bb b/recipes-graphics/rapidvulkan/rapidvulkan_1.2.162.0.bb index 86ec697d2..c37cf7411 100644 --- a/recipes-graphics/rapidvulkan/rapidvulkan_1.2.162.0.bb +++ b/recipes-graphics/rapidvulkan/rapidvulkan_1.2.162.0.bb @@ -8,6 +8,8 @@ SRC_URI = "git://github.com/Unarmed1000/RapidVulkan;protocol=https;branch=master SRCREV = "e39a407c5ae880792d8843ada65a19dd26b3dca7" -inherit cmake +REQUIRED_DISTRO_FEATURES = "vulkan" + +inherit cmake features_check ALLOW_EMPTY:${PN} = "1" -- cgit v1.2.3-54-g00ecf From 6e2a0572e1ca7ddfced8ff23bf513746a97c879a Mon Sep 17 00:00:00 2001 From: Luciano Dittgen Date: Mon, 29 Jun 2026 13:41:14 -0300 Subject: vulkan-wsi-layer: Require vulkan distro feature vulkan-wsi-layer depends on Vulkan being part of the distro configuration. Inherit features_check and require the vulkan distro feature so non-Vulkan builds skip the recipe cleanly. Tested as part of the series with bitbake -p and yocto-check-layer. Signed-off-by: Luciano Dittgen --- recipes-graphics/vulkan/vulkan-wsi-layer_git.bb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes-graphics/vulkan/vulkan-wsi-layer_git.bb b/recipes-graphics/vulkan/vulkan-wsi-layer_git.bb index 4abe7db50..0118975a5 100644 --- a/recipes-graphics/vulkan/vulkan-wsi-layer_git.bb +++ b/recipes-graphics/vulkan/vulkan-wsi-layer_git.bb @@ -12,7 +12,9 @@ SRC_URI = "git://gitlab.freedesktop.org/mesa/vulkan-wsi-layer.git;protocol=https file://0001-wayland-Add-C-guard-before-__STDC_VERSION__-define.patch" SRCREV = "cb1a50cf7e640ad7306e673131ded98c0f133628" -inherit cmake pkgconfig +REQUIRED_DISTRO_FEATURES = "vulkan" + +inherit cmake pkgconfig features_check PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', 'headless', d)}" -- cgit v1.2.3-54-g00ecf From 7011d36e88f16d17349df86953e9cf761da50417 Mon Sep 17 00:00:00 2001 From: Luciano Dittgen Date: Mon, 29 Jun 2026 13:41:14 -0300 Subject: waffle: Scope patches to i.MX GPU machines The waffle patches are only needed for i.MX GPU configurations. Apply FILESEXTRAPATHS and SRC_URI changes through the i.MX GPU override so unrelated machines are not affected. Tested as part of the series with bitbake -p and yocto-check-layer. Signed-off-by: Luciano Dittgen --- recipes-graphics/waffle/waffle_%.bbappend | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes-graphics/waffle/waffle_%.bbappend b/recipes-graphics/waffle/waffle_%.bbappend index e88f558d4..fd375271f 100644 --- a/recipes-graphics/waffle/waffle_%.bbappend +++ b/recipes-graphics/waffle/waffle_%.bbappend @@ -1,6 +1,6 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +FILESEXTRAPATHS:prepend:imxgpu := "${THISDIR}/${PN}:" -SRC_URI += " \ +SRC_URI:append:imxgpu = " \ file://0001-meson-Add-missing-wayland-dependency-on-EGL.patch \ file://0002-meson-Separate-surfaceless-option-from-x11.patch \ " -- cgit v1.2.3-54-g00ecf From c8ebbee296090231755ae9ec1a950ade3f4aa64b Mon Sep 17 00:00:00 2001 From: Luciano Dittgen Date: Mon, 29 Jun 2026 13:41:14 -0300 Subject: pulseaudio: Scope i.MX audio changes The PulseAudio patches and install hook are specific to i.MX BSP machines. Apply them through i.MX overrides so the bbappend does not alter PulseAudio for unrelated machines. Tested as part of the series with bitbake -p and yocto-check-layer. Signed-off-by: Luciano Dittgen --- recipes-multimedia/pulseaudio/pulseaudio_%.bbappend | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend b/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend index 6e4db9110..7f5a7ffbe 100644 --- a/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend +++ b/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend @@ -1,6 +1,6 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}/imx-nxp-bsp:" +FILESEXTRAPATHS:prepend:imx-nxp-bsp := "${THISDIR}/${PN}/imx-nxp-bsp:" -SRC_URI += "${SRC_URI_IMX}" +SRC_URI:append:imx-nxp-bsp = " ${SRC_URI_IMX}" SRC_URI_IMX = "" SRC_URI_IMX:mx6-nxp-bsp = " \ file://0001-Fix-pulseaudio-mutex-issue-when-do-pause-in-gstreame.patch \ @@ -16,7 +16,7 @@ SRC_URI_IMX:mx9-nxp-bsp = " \ CACHED_CONFIGUREVARS:append:mx6-nxp-bsp = " ax_cv_PTHREAD_PRIO_INHERIT=no" -do_install:append() { +do_install:append:imx-nxp-bsp() { if [ -e "${UNPACKDIR}/daemon.conf" ] && [ -e "${UNPACKDIR}/default.pa" ]; then install -m 0644 ${UNPACKDIR}/daemon.conf ${D}${sysconfdir}/pulse/daemon.conf install -m 0644 ${UNPACKDIR}/default.pa ${D}${sysconfdir}/pulse/default.pa -- cgit v1.2.3-54-g00ecf