diff options
23 files changed, 1185 insertions, 541 deletions
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 deleted file mode 100644 index b1b00623d..000000000 --- a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | From 9b4959b97d2e95d4b49cf6ca2a3fce3cdb484f2d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | ||
| 3 | Date: Thu, 31 Mar 2016 00:20:15 +0200 | ||
| 4 | Subject: [PATCH] 3rdparty/ippicv: Use pre-downloaded ipp | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | ||
| 8 | Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com> | ||
| 9 | |||
| 10 | --- | ||
| 11 | 3rdparty/ippicv/ippicv.cmake | 15 +-------------- | ||
| 12 | 1 file changed, 1 insertion(+), 14 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/3rdparty/ippicv/ippicv.cmake b/3rdparty/ippicv/ippicv.cmake | ||
| 15 | index 257af6fcc6..f88460450f 100644 | ||
| 16 | --- a/3rdparty/ippicv/ippicv.cmake | ||
| 17 | +++ b/3rdparty/ippicv/ippicv.cmake | ||
| 18 | @@ -34,18 +34,5 @@ function(download_ippicv root_var) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | set(THE_ROOT "${OpenCV_BINARY_DIR}/3rdparty/ippicv") | ||
| 22 | - ocv_download(FILENAME ${OPENCV_ICV_NAME} | ||
| 23 | - HASH ${OPENCV_ICV_HASH} | ||
| 24 | - URL | ||
| 25 | - "${OPENCV_IPPICV_URL}" | ||
| 26 | - "$ENV{OPENCV_IPPICV_URL}" | ||
| 27 | - "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_COMMIT}/ippicv/" | ||
| 28 | - DESTINATION_DIR "${THE_ROOT}" | ||
| 29 | - ID IPPICV | ||
| 30 | - STATUS res | ||
| 31 | - UNPACK RELATIVE_URL) | ||
| 32 | - | ||
| 33 | - if(res) | ||
| 34 | - set(${root_var} "${THE_ROOT}/${OPENCV_ICV_PACKAGE_SUBDIR}" PARENT_SCOPE) | ||
| 35 | - endif() | ||
| 36 | + set(${root_var} "${THE_ROOT}/${OPENCV_ICV_PACKAGE_SUBDIR}" PARENT_SCOPE) | ||
| 37 | 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 deleted file mode 100644 index 59da6ab32..000000000 --- a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | From d6bdd0a91eb0ed57688c0af5ba5088cf0afdc0a0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jochen Sprickerhof <jspricke@debian.org> | ||
| 3 | Date: Mon, 8 Aug 2022 21:10:13 +0200 | ||
| 4 | Subject: [PATCH] Add missing header for LIBAVCODEC_VERSION_INT | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://github.com/opencv/opencv/pull/22357] | ||
| 7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 8 | --- | ||
| 9 | modules/videoio/src/ffmpeg_codecs.hpp | 1 + | ||
| 10 | 1 file changed, 1 insertion(+) | ||
| 11 | |||
| 12 | diff --git a/modules/videoio/src/ffmpeg_codecs.hpp b/modules/videoio/src/ffmpeg_codecs.hpp | ||
| 13 | index 61788e0345..faad2596ed 100644 | ||
| 14 | --- a/modules/videoio/src/ffmpeg_codecs.hpp | ||
| 15 | +++ b/modules/videoio/src/ffmpeg_codecs.hpp | ||
| 16 | @@ -60,6 +60,7 @@ extern "C" { | ||
| 17 | #include <errno.h> | ||
| 18 | #endif | ||
| 19 | |||
| 20 | +#include <libavcodec/version.h> | ||
| 21 | #include <libavformat/avformat.h> | ||
| 22 | |||
| 23 | #ifdef __cplusplus | ||
| 24 | -- | ||
| 25 | 2.38.1 | ||
| 26 | |||
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 index 46232ec5c..29e0d5f95 100644 --- 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 | |||
| @@ -4,6 +4,7 @@ Date: Tue, 1 Sep 2020 14:57:07 -0500 | |||
| 4 | Subject: [PATCH] Add smaller version of download_models.py | 4 | Subject: [PATCH] Add smaller version of download_models.py |
| 5 | 5 | ||
| 6 | Upstream-Status: Pending | 6 | Upstream-Status: Pending |
| 7 | |||
| 7 | Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> | 8 | Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> |
| 8 | --- | 9 | --- |
| 9 | testdata/dnn/download_models_basic.py | 159 ++++++++++++++++++++++++++ | 10 | testdata/dnn/download_models_basic.py | 159 ++++++++++++++++++++++++++ |
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 index d56b8ae67..9e72fe2f5 100644 --- 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 | |||
| @@ -7,7 +7,7 @@ Make ts module external | |||
| 7 | 7 | ||
| 8 | Reference: https://github.com/qbonnard/opencv/commit/6b229c5834cb9a0930425e762a6c7b03244d7abb | 8 | Reference: https://github.com/qbonnard/opencv/commit/6b229c5834cb9a0930425e762a6c7b03244d7abb |
| 9 | 9 | ||
| 10 | Upstream-Status: Submitted [https://github.com/opencv/opencv/issues/8408] | 10 | Upstream-Status: Denied [https://github.com/opencv/opencv/issues/8408] |
| 11 | 11 | ||
| 12 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | 12 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> |
| 13 | --- | 13 | --- |
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Renamed-templated-BlocksCompensator-feed-method-to-e.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Renamed-templated-BlocksCompensator-feed-method-to-e.patch new file mode 100644 index 000000000..ec2bb2d10 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Renamed-templated-BlocksCompensator-feed-method-to-e.patch | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | From b28d9bef1d96d10e9a47d55a63d9f1443e6e3d2b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexander Smorkalov <alexander.smorkalov@xperience.ai> | ||
| 3 | Date: Mon, 8 Sep 2025 14:52:58 +0300 | ||
| 4 | Subject: [PATCH] Renamed templated BlocksCompensator::feed method to exclude | ||
| 5 | claches with base class pure virtual method. | ||
| 6 | |||
| 7 | Upstream-Status: Backport [https://github.com/opencv/opencv/commit/b28d9bef1d96d10e9a47d55a63d9f1443e6e3d2b] | ||
| 8 | Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> | ||
| 9 | --- | ||
| 10 | .../opencv2/stitching/detail/exposure_compensate.hpp | 2 +- | ||
| 11 | modules/stitching/src/exposure_compensate.cpp | 6 +++--- | ||
| 12 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp b/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp | ||
| 15 | index dea76c957b..2954f32ca3 100644 | ||
| 16 | --- a/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp | ||
| 17 | +++ b/modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp | ||
| 18 | @@ -187,7 +187,7 @@ public: | ||
| 19 | |||
| 20 | protected: | ||
| 21 | template<class Compensator> | ||
| 22 | - void feed(const std::vector<Point> &corners, const std::vector<UMat> &images, | ||
| 23 | + void feedWithStrategy(const std::vector<Point> &corners, const std::vector<UMat> &images, | ||
| 24 | const std::vector<std::pair<UMat,uchar> > &masks); | ||
| 25 | |||
| 26 | private: | ||
| 27 | diff --git a/modules/stitching/src/exposure_compensate.cpp b/modules/stitching/src/exposure_compensate.cpp | ||
| 28 | index 59542d95ba..f7c33fa4ef 100644 | ||
| 29 | --- a/modules/stitching/src/exposure_compensate.cpp | ||
| 30 | +++ b/modules/stitching/src/exposure_compensate.cpp | ||
| 31 | @@ -460,7 +460,7 @@ void ChannelsCompensator::setMatGains(std::vector<Mat>& umv) | ||
| 32 | |||
| 33 | |||
| 34 | template<class Compensator> | ||
| 35 | -void BlocksCompensator::feed(const std::vector<Point> &corners, const std::vector<UMat> &images, | ||
| 36 | +void BlocksCompensator::feedWithStrategy(const std::vector<Point> &corners, const std::vector<UMat> &images, | ||
| 37 | const std::vector<std::pair<UMat,uchar> > &masks) | ||
| 38 | { | ||
| 39 | CV_Assert(corners.size() == images.size() && images.size() == masks.size()); | ||
| 40 | @@ -605,13 +605,13 @@ void BlocksCompensator::setMatGains(std::vector<Mat>& umv) | ||
| 41 | void BlocksGainCompensator::feed(const std::vector<Point> &corners, const std::vector<UMat> &images, | ||
| 42 | const std::vector<std::pair<UMat,uchar> > &masks) | ||
| 43 | { | ||
| 44 | - BlocksCompensator::feed<GainCompensator>(corners, images, masks); | ||
| 45 | + BlocksCompensator::feedWithStrategy<GainCompensator>(corners, images, masks); | ||
| 46 | } | ||
| 47 | |||
| 48 | void BlocksChannelsCompensator::feed(const std::vector<Point> &corners, const std::vector<UMat> &images, | ||
| 49 | const std::vector<std::pair<UMat,uchar> > &masks) | ||
| 50 | { | ||
| 51 | - BlocksCompensator::feed<ChannelsCompensator>(corners, images, masks); | ||
| 52 | + BlocksCompensator::feedWithStrategy<ChannelsCompensator>(corners, images, masks); | ||
| 53 | } | ||
| 54 | |||
| 55 | |||
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 index aa7d335ea..a3bbefaab 100644 --- 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 | |||
| @@ -4,10 +4,11 @@ Date: Wed, 9 May 2018 13:33:59 -0700 | |||
| 4 | Subject: [PATCH] Temporarliy work around deprecated ffmpeg RAW function | 4 | Subject: [PATCH] Temporarliy work around deprecated ffmpeg RAW function |
| 5 | compile failure until next uprev | 5 | compile failure until next uprev |
| 6 | 6 | ||
| 7 | Upstream-Status: Inappropriate [platform specific] | ||
| 8 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | 7 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> |
| 9 | 8 | ||
| 10 | --- | 9 | --- |
| 10 | Upstream-Status: Pending | ||
| 11 | |||
| 11 | modules/videoio/src/cap_ffmpeg_impl.hpp | 8 ++++++++ | 12 | modules/videoio/src/cap_ffmpeg_impl.hpp | 8 ++++++++ |
| 12 | 1 file changed, 8 insertions(+) | 13 | 1 file changed, 8 insertions(+) |
| 13 | 14 | ||
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 deleted file mode 100644 index 5d88d1a6a..000000000 --- a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch +++ /dev/null | |||
| @@ -1,41 +0,0 @@ | |||
| 1 | From 9cfa84313c5833d7295fcf57be93d5d2aaadfd88 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Vincent Rabaud <vrabaud@google.com> | ||
| 3 | Date: Sat, 10 Jul 2021 00:21:52 +0200 | ||
| 4 | Subject: [PATCH] Use the one argument version of SetTotalBytesLimit. | ||
| 5 | |||
| 6 | The two argument versions has been deprecated, cf | ||
| 7 | https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.coded_stream | ||
| 8 | |||
| 9 | Upstream-Status: Backport [9cfa84313c5833d7295fcf57be93d5d2aaadfd88 - from master after 4.5.3 tag] | ||
| 10 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
| 11 | --- | ||
| 12 | modules/dnn/src/caffe/caffe_io.cpp | 5 +++++ | ||
| 13 | 1 file changed, 5 insertions(+) | ||
| 14 | |||
| 15 | diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp | ||
| 16 | index 2fc4d84f46..ebecf95eea 100644 | ||
| 17 | --- a/modules/dnn/src/caffe/caffe_io.cpp | ||
| 18 | +++ b/modules/dnn/src/caffe/caffe_io.cpp | ||
| 19 | @@ -92,6 +92,7 @@ | ||
| 20 | #ifdef HAVE_PROTOBUF | ||
| 21 | #include <google/protobuf/io/coded_stream.h> | ||
| 22 | #include <google/protobuf/io/zero_copy_stream_impl.h> | ||
| 23 | +#include <google/protobuf/stubs/common.h> | ||
| 24 | #include <google/protobuf/text_format.h> | ||
| 25 | |||
| 26 | #include <opencv2/core.hpp> | ||
| 27 | @@ -1111,7 +1112,11 @@ static const int kProtoReadBytesLimit = INT_MAX; // Max size of 2 GB minus 1 by | ||
| 28 | |||
| 29 | bool ReadProtoFromBinary(ZeroCopyInputStream* input, Message *proto) { | ||
| 30 | CodedInputStream coded_input(input); | ||
| 31 | +#if GOOGLE_PROTOBUF_VERSION >= 3006000 | ||
| 32 | + coded_input.SetTotalBytesLimit(kProtoReadBytesLimit); | ||
| 33 | +#else | ||
| 34 | coded_input.SetTotalBytesLimit(kProtoReadBytesLimit, 536870912); | ||
| 35 | +#endif | ||
| 36 | |||
| 37 | return proto->ParseFromCodedStream(&coded_input); | ||
| 38 | } | ||
| 39 | -- | ||
| 40 | 2.32.0 | ||
| 41 | |||
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 deleted file mode 100644 index 7b2c4100a..000000000 --- a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | From ffe20fc4ec46c6b491eff29a38f90686d4d035f6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Martin Jansa <Martin.Jansa@gmail.com> | ||
| 3 | Date: Mon, 12 Apr 2021 20:37:40 +0000 | ||
| 4 | Subject: [PATCH] sfm: link with Glog_LIBS | ||
| 5 | |||
| 6 | * in 4.5.0 there was explicit linkage with GLOG_LIBRARY, but since 4.5.1 with: | ||
| 7 | https://github.com/opencv/opencv_contrib/commit/23ee62a19b7a3e50d6dbf295359d8b1aff2e03fd | ||
| 8 | |||
| 9 | it's gone, probably because Glog_FOUND is already set from Ceres, | ||
| 10 | but then GLOG_LIBRARIES is empty in LIBMV_LIGHT_LIBS and build with gold fails: | ||
| 11 | |||
| 12 | FAILED: bin/example_tutorial_perspective_correction | ||
| 13 | : && 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 && : | ||
| 14 | lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessage::LogMessage(char const*, int)' | ||
| 15 | lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessage::stream()' | ||
| 16 | lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessage::~LogMessage()' | ||
| 17 | lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::kLogSiteUninitialized' | ||
| 18 | lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'fLI::FLAGS_v' | ||
| 19 | lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::InitVLOG3__(int**, int*, char const*, int)' | ||
| 20 | lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessageFatal::LogMessageFatal(char const*, int)' | ||
| 21 | lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessageFatal::~LogMessageFatal()' | ||
| 22 | collect2: error: ld returned 1 exit status | ||
| 23 | |||
| 24 | Add Glog_LIBS which is set to the same value as GLOG_LIBRARIES used to be. | ||
| 25 | |||
| 26 | Upstream-Status: Submitted [https://github.com/opencv/opencv_contrib/pull/2923] | ||
| 27 | |||
| 28 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
| 29 | --- | ||
| 30 | modules/sfm/CMakeLists.txt | 1 + | ||
| 31 | 1 file changed, 1 insertion(+) | ||
| 32 | |||
| 33 | diff --git a/modules/sfm/CMakeLists.txt b/modules/sfm/CMakeLists.txt | ||
| 34 | index 045a1fe6e..ee7cecdac 100644 | ||
| 35 | --- a/modules/sfm/CMakeLists.txt | ||
| 36 | +++ b/modules/sfm/CMakeLists.txt | ||
| 37 | @@ -84,6 +84,7 @@ set(LIBMV_LIGHT_LIBS | ||
| 38 | multiview | ||
| 39 | numeric | ||
| 40 | ${GLOG_LIBRARIES} | ||
| 41 | + ${Glog_LIBS} | ||
| 42 | ${GFLAGS_LIBRARIES} | ||
| 43 | ) | ||
| 44 | |||
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 index d39c05822..9df419d0b 100644 --- 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 | |||
| @@ -7,7 +7,6 @@ Subject: [PATCH] To fix errors as following: | |||
| 7 | "perf_abs.cpp:13: undefined reference to `cvtest::param_seed'" | 7 | "perf_abs.cpp:13: undefined reference to `cvtest::param_seed'" |
| 8 | "test_superres.cpp:270: undefined reference to `checkIppStatus()'" | 8 | "test_superres.cpp:270: undefined reference to `checkIppStatus()'" |
| 9 | 9 | ||
| 10 | Upstream-Status: Pending | ||
| 11 | Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com> | 10 | Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com> |
| 12 | 11 | ||
| 13 | Also add the visibility changes for certain OpenCL-related functions in | 12 | Also add the visibility changes for certain OpenCL-related functions in |
| @@ -16,6 +15,8 @@ ts module. | |||
| 16 | Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com> | 15 | Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com> |
| 17 | 16 | ||
| 18 | --- | 17 | --- |
| 18 | Upstream-Status: Pending | ||
| 19 | |||
| 19 | modules/ts/include/opencv2/ts.hpp | 4 ++-- | 20 | modules/ts/include/opencv2/ts.hpp | 4 ++-- |
| 20 | modules/ts/include/opencv2/ts/ocl_test.hpp | 2 +- | 21 | modules/ts/include/opencv2/ts/ocl_test.hpp | 2 +- |
| 21 | modules/ts/include/opencv2/ts/ts_ext.hpp | 2 +- | 22 | modules/ts/include/opencv2/ts/ts_ext.hpp | 2 +- |
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0008-Do-not-embed-build-directory-in-binaries.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0008-Do-not-embed-build-directory-in-binaries.patch new file mode 100644 index 000000000..8fda85708 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0008-Do-not-embed-build-directory-in-binaries.patch | |||
| @@ -0,0 +1,138 @@ | |||
| 1 | From: Victor Westerhuis <victor@westerhu.is> | ||
| 2 | Date: Sat, 19 Nov 2022 21:45:39 +0100 | ||
| 3 | Subject: Do not embed build directory in binaries | ||
| 4 | |||
| 5 | This makes the opencv core module build reproducibly. | ||
| 6 | |||
| 7 | https://salsa.debian.org/science-team/opencv/-/raw/master/debian/patches/0008-Do-not-embed-build-directory-in-binaries.patch | ||
| 8 | Upstream-Status: Backport | ||
| 9 | Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> | ||
| 10 | --- | ||
| 11 | modules/core/CMakeLists.txt | 10 ------ | ||
| 12 | modules/core/include/opencv2/core/private.hpp | 4 +-- | ||
| 13 | modules/core/include/opencv2/core/utility.hpp | 4 +-- | ||
| 14 | modules/core/src/utils/datafile.cpp | 48 +-------------------------- | ||
| 15 | 4 files changed, 5 insertions(+), 61 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt | ||
| 18 | index b78bb98..d96b669 100644 | ||
| 19 | --- a/modules/core/CMakeLists.txt | ||
| 20 | +++ b/modules/core/CMakeLists.txt | ||
| 21 | @@ -188,16 +188,6 @@ if(OPENCV_OTHER_INSTALL_PATH) | ||
| 22 | ") | ||
| 23 | endif() | ||
| 24 | |||
| 25 | -set(OPENCV_DATA_CONFIG_STR "${OPENCV_DATA_CONFIG_STR} | ||
| 26 | -#define OPENCV_BUILD_DIR \"${CMAKE_BINARY_DIR}\" | ||
| 27 | -") | ||
| 28 | - | ||
| 29 | -file(RELATIVE_PATH SOURCE_DIR_RELATIVE ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}) | ||
| 30 | -set(OPENCV_DATA_CONFIG_STR "${OPENCV_DATA_CONFIG_STR} | ||
| 31 | -#define OPENCV_DATA_BUILD_DIR_SEARCH_PATHS \\ | ||
| 32 | - \"${SOURCE_DIR_RELATIVE}/\" | ||
| 33 | -") | ||
| 34 | - | ||
| 35 | if(WIN32) | ||
| 36 | file(RELATIVE_PATH INSTALL_DATA_DIR_RELATIVE "${CMAKE_INSTALL_PREFIX}/${OPENCV_BIN_INSTALL_PATH}" "${CMAKE_INSTALL_PREFIX}/${OPENCV_OTHER_INSTALL_PATH}") | ||
| 37 | else() | ||
| 38 | diff --git a/modules/core/include/opencv2/core/private.hpp b/modules/core/include/opencv2/core/private.hpp | ||
| 39 | index 146d37f..dd675bc 100644 | ||
| 40 | --- a/modules/core/include/opencv2/core/private.hpp | ||
| 41 | +++ b/modules/core/include/opencv2/core/private.hpp | ||
| 42 | @@ -818,10 +818,10 @@ Search directories: | ||
| 43 | 2. Check path specified by configuration parameter with "_HINT" suffix (name of environment variable). | ||
| 44 | 3. Check path specified by configuration parameter (name of environment variable). | ||
| 45 | If parameter value is not empty and nothing is found then stop searching. | ||
| 46 | -4. Detects build/install path based on: | ||
| 47 | +4. Detects install path based on: | ||
| 48 | a. current working directory (CWD) | ||
| 49 | b. and/or binary module location (opencv_core/opencv_world, doesn't work with static linkage) | ||
| 50 | -5. Scan `<source>/{,data}` directories if build directory is detected or the current directory is in source tree. | ||
| 51 | +5. Scan `<source>/{,data}` directories if the current directory is in source tree. | ||
| 52 | 6. Scan `<install>/share/OpenCV` directory if install directory is detected. | ||
| 53 | |||
| 54 | @param relative_path Relative path to data file | ||
| 55 | diff --git a/modules/core/include/opencv2/core/utility.hpp b/modules/core/include/opencv2/core/utility.hpp | ||
| 56 | index 108c0d9..f15d9ea 100644 | ||
| 57 | --- a/modules/core/include/opencv2/core/utility.hpp | ||
| 58 | +++ b/modules/core/include/opencv2/core/utility.hpp | ||
| 59 | @@ -1163,10 +1163,10 @@ Search directories: | ||
| 60 | 2. OPENCV_SAMPLES_DATA_PATH_HINT environment variable | ||
| 61 | 3. OPENCV_SAMPLES_DATA_PATH environment variable | ||
| 62 | If parameter value is not empty and nothing is found then stop searching. | ||
| 63 | -4. Detects build/install path based on: | ||
| 64 | +4. Detects install path based on: | ||
| 65 | a. current working directory (CWD) | ||
| 66 | b. and/or binary module location (opencv_core/opencv_world, doesn't work with static linkage) | ||
| 67 | -5. Scan `<source>/{,data,samples/data}` directories if build directory is detected or the current directory is in source tree. | ||
| 68 | +5. Scan `<source>/{,data,samples/data}` directories if the current directory is in source tree. | ||
| 69 | 6. Scan `<install>/share/OpenCV` directory if install directory is detected. | ||
| 70 | |||
| 71 | @see cv::utils::findDataFile | ||
| 72 | diff --git a/modules/core/src/utils/datafile.cpp b/modules/core/src/utils/datafile.cpp | ||
| 73 | index 3af83a5..6bda857 100644 | ||
| 74 | --- a/modules/core/src/utils/datafile.cpp | ||
| 75 | +++ b/modules/core/src/utils/datafile.cpp | ||
| 76 | @@ -280,32 +280,8 @@ cv::String findDataFile(const cv::String& relative_path, | ||
| 77 | |||
| 78 | |||
| 79 | // Steps: 4, 5, 6 | ||
| 80 | - cv::String cwd = utils::fs::getcwd(); | ||
| 81 | - cv::String build_dir(OPENCV_BUILD_DIR); | ||
| 82 | - bool has_tested_build_directory = false; | ||
| 83 | - if (isSubDirectory(build_dir, cwd) || isSubDirectory(utils::fs::canonical(build_dir), utils::fs::canonical(cwd))) | ||
| 84 | - { | ||
| 85 | - CV_LOG_DEBUG(NULL, "utils::findDataFile(): the current directory is build sub-directory: " << cwd); | ||
| 86 | - const char* build_subdirs[] = { OPENCV_DATA_BUILD_DIR_SEARCH_PATHS }; | ||
| 87 | - for (size_t k = 0; k < sizeof(build_subdirs)/sizeof(build_subdirs[0]); k++) | ||
| 88 | - { | ||
| 89 | - CV_LOG_DEBUG(NULL, "utils::findDataFile(): <build>/" << build_subdirs[k]); | ||
| 90 | - cv::String datapath = utils::fs::join(build_dir, build_subdirs[k]); | ||
| 91 | - if (utils::fs::isDirectory(datapath)) | ||
| 92 | - { | ||
| 93 | - for(size_t i = search_subdir.size(); i > 0; i--) | ||
| 94 | - { | ||
| 95 | - const cv::String& subdir = search_subdir[i - 1]; | ||
| 96 | - cv::String prefix = utils::fs::join(datapath, subdir); | ||
| 97 | - TRY_FILE_WITH_PREFIX(prefix); | ||
| 98 | - } | ||
| 99 | - } | ||
| 100 | - } | ||
| 101 | - has_tested_build_directory = true; | ||
| 102 | - } | ||
| 103 | - | ||
| 104 | cv::String source_dir; | ||
| 105 | - cv::String try_source_dir = cwd; | ||
| 106 | + cv::String try_source_dir = utils::fs::getcwd(); | ||
| 107 | for (int levels = 0; levels < 3; ++levels) | ||
| 108 | { | ||
| 109 | if (utils::fs::exists(utils::fs::join(try_source_dir, "modules/core/include/opencv2/core/version.hpp"))) | ||
| 110 | @@ -341,28 +317,6 @@ cv::String findDataFile(const cv::String& relative_path, | ||
| 111 | CV_LOG_INFO(NULL, "Can't detect module binaries location"); | ||
| 112 | } | ||
| 113 | |||
| 114 | - if (!has_tested_build_directory && | ||
| 115 | - (isSubDirectory(build_dir, module_path) || isSubDirectory(utils::fs::canonical(build_dir), utils::fs::canonical(module_path))) | ||
| 116 | - ) | ||
| 117 | - { | ||
| 118 | - CV_LOG_DEBUG(NULL, "utils::findDataFile(): the binary module directory is build sub-directory: " << module_path); | ||
| 119 | - const char* build_subdirs[] = { OPENCV_DATA_BUILD_DIR_SEARCH_PATHS }; | ||
| 120 | - for (size_t k = 0; k < sizeof(build_subdirs)/sizeof(build_subdirs[0]); k++) | ||
| 121 | - { | ||
| 122 | - CV_LOG_DEBUG(NULL, "utils::findDataFile(): <build>/" << build_subdirs[k]); | ||
| 123 | - cv::String datapath = utils::fs::join(build_dir, build_subdirs[k]); | ||
| 124 | - if (utils::fs::isDirectory(datapath)) | ||
| 125 | - { | ||
| 126 | - for(size_t i = search_subdir.size(); i > 0; i--) | ||
| 127 | - { | ||
| 128 | - const cv::String& subdir = search_subdir[i - 1]; | ||
| 129 | - cv::String prefix = utils::fs::join(datapath, subdir); | ||
| 130 | - TRY_FILE_WITH_PREFIX(prefix); | ||
| 131 | - } | ||
| 132 | - } | ||
| 133 | - } | ||
| 134 | - } | ||
| 135 | - | ||
| 136 | #if defined OPENCV_INSTALL_DATA_DIR_RELATIVE | ||
| 137 | if (!module_path.empty()) // require module path | ||
| 138 | { | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0101-MGS-6470-ccc-Modify-host-ptr-alignment-size-in-UMAT.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0101-MGS-6470-ccc-Modify-host-ptr-alignment-size-in-UMAT.patch new file mode 100644 index 000000000..82afd5c72 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0101-MGS-6470-ccc-Modify-host-ptr-alignment-size-in-UMAT.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | From 0a1c77e4c810999632d648f63775b7ea265bc25c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Eric Guo <eric.guo@nxp.com> | ||
| 3 | Date: Tue, 9 Nov 2021 14:38:00 +0800 | ||
| 4 | Subject: [PATCH 1/4] MGS-6470 [#ccc] Modify host ptr alignment size in UMAT | ||
| 5 | |||
| 6 | change CV_OPENCL_ALIGNMENT_MEM_USE_HOST_PTR from 4 to 64 | ||
| 7 | |||
| 8 | Upstream-Status: Inappropriate [i.MX specific] | ||
| 9 | Signed-off-by: Eric Guo <eric.guo@nxp.com> | ||
| 10 | --- | ||
| 11 | modules/core/src/ocl.cpp | 2 +- | ||
| 12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 13 | |||
| 14 | diff --git a/modules/core/src/ocl.cpp b/modules/core/src/ocl.cpp | ||
| 15 | index 8479667fd7..6eb7b5e425 100644 | ||
| 16 | --- a/modules/core/src/ocl.cpp | ||
| 17 | +++ b/modules/core/src/ocl.cpp | ||
| 18 | @@ -245,7 +245,7 @@ static String getBuildExtraOptions() | ||
| 19 | } | ||
| 20 | |||
| 21 | static const bool CV_OPENCL_ENABLE_MEM_USE_HOST_PTR = utils::getConfigurationParameterBool("OPENCV_OPENCL_ENABLE_MEM_USE_HOST_PTR", true); | ||
| 22 | -static const size_t CV_OPENCL_ALIGNMENT_MEM_USE_HOST_PTR = utils::getConfigurationParameterSizeT("OPENCV_OPENCL_ALIGNMENT_MEM_USE_HOST_PTR", 4); | ||
| 23 | +static const size_t CV_OPENCL_ALIGNMENT_MEM_USE_HOST_PTR = utils::getConfigurationParameterSizeT("OPENCV_OPENCL_ALIGNMENT_MEM_USE_HOST_PTR", 64); | ||
| 24 | |||
| 25 | |||
| 26 | struct UMat2D | ||
| 27 | -- | ||
| 28 | 2.34.1 | ||
| 29 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0102-MGS-6470-ccc-Add-configuration-parameter-to-force-en.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0102-MGS-6470-ccc-Add-configuration-parameter-to-force-en.patch new file mode 100644 index 000000000..50240093c --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0102-MGS-6470-ccc-Add-configuration-parameter-to-force-en.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | From 965365fff0815b8afc9833102d8e4e6c4ee1dda3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Eric Guo <eric.guo@nxp.com> | ||
| 3 | Date: Wed, 17 Nov 2021 15:04:23 +0800 | ||
| 4 | Subject: [PATCH 2/4] MGS-6470 [#ccc] Add configuration parameter to force | ||
| 5 | enable hostptr in OpenCL | ||
| 6 | |||
| 7 | USAGE: `set OPENCV_OPENCL_ALIGNMENT_MEM_ALLOC_HOST_PTR=true` | ||
| 8 | |||
| 9 | Upstream-Status: Inappropriate [i.MX specific] | ||
| 10 | Signed-off-by: Eric Guo <eric.guo@nxp.com> | ||
| 11 | --- | ||
| 12 | modules/core/src/ocl.cpp | 4 +++- | ||
| 13 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/modules/core/src/ocl.cpp b/modules/core/src/ocl.cpp | ||
| 16 | index 6eb7b5e425..5c50b06865 100644 | ||
| 17 | --- a/modules/core/src/ocl.cpp | ||
| 18 | +++ b/modules/core/src/ocl.cpp | ||
| 19 | @@ -5416,7 +5416,9 @@ public: | ||
| 20 | { | ||
| 21 | const Device& dev = ctx.device(0); | ||
| 22 | createFlags = 0; | ||
| 23 | - if ((usageFlags & USAGE_ALLOCATE_HOST_MEMORY) != 0) | ||
| 24 | + bool allocHostPtr = utils::getConfigurationParameterBool("OPENCV_OPENCL_ALIGNMENT_MEM_ALLOC_HOST_PTR", false); | ||
| 25 | + | ||
| 26 | + if ((usageFlags & USAGE_ALLOCATE_HOST_MEMORY) != 0 || allocHostPtr) | ||
| 27 | createFlags |= CL_MEM_ALLOC_HOST_PTR; | ||
| 28 | |||
| 29 | if (!isOpenCLCopyingForced() && | ||
| 30 | -- | ||
| 31 | 2.34.1 | ||
| 32 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0103-MGS-6470-ccc-Change-configuration-to-enable-hostptr-.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0103-MGS-6470-ccc-Change-configuration-to-enable-hostptr-.patch new file mode 100644 index 000000000..3b429b383 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0103-MGS-6470-ccc-Change-configuration-to-enable-hostptr-.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | From 352b992c7daeeede261cf52e06b5beac485df897 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Eric Guo <eric.guo@nxp.com> | ||
| 3 | Date: Thu, 9 Dec 2021 15:25:42 +0800 | ||
| 4 | Subject: [PATCH 3/4] MGS-6470 [#ccc] Change configuration to enable hostptr in | ||
| 5 | OpenCL by default. | ||
| 6 | |||
| 7 | Upstream-Status: Inappropriate [i.MX specific] | ||
| 8 | Signed-off-by: Eric Guo <eric.guo@nxp.com> | ||
| 9 | --- | ||
| 10 | modules/core/src/ocl.cpp | 2 +- | ||
| 11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 12 | |||
| 13 | diff --git a/modules/core/src/ocl.cpp b/modules/core/src/ocl.cpp | ||
| 14 | index 5c50b06865..db75190f13 100644 | ||
| 15 | --- a/modules/core/src/ocl.cpp | ||
| 16 | +++ b/modules/core/src/ocl.cpp | ||
| 17 | @@ -5416,7 +5416,7 @@ public: | ||
| 18 | { | ||
| 19 | const Device& dev = ctx.device(0); | ||
| 20 | createFlags = 0; | ||
| 21 | - bool allocHostPtr = utils::getConfigurationParameterBool("OPENCV_OPENCL_ALIGNMENT_MEM_ALLOC_HOST_PTR", false); | ||
| 22 | + bool allocHostPtr = utils::getConfigurationParameterBool("OPENCV_OPENCL_ALIGNMENT_MEM_ALLOC_HOST_PTR", true); | ||
| 23 | |||
| 24 | if ((usageFlags & USAGE_ALLOCATE_HOST_MEMORY) != 0 || allocHostPtr) | ||
| 25 | createFlags |= CL_MEM_ALLOC_HOST_PTR; | ||
| 26 | -- | ||
| 27 | 2.34.1 | ||
| 28 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0104-MGS-8011-ccc-Fix-the-problem-of-syntax-error-at-doub.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0104-MGS-8011-ccc-Fix-the-problem-of-syntax-error-at-doub.patch new file mode 100644 index 000000000..ebca4ce35 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0104-MGS-8011-ccc-Fix-the-problem-of-syntax-error-at-doub.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | From 2766330540d5106e1cc5c44ab14f021e306859cb Mon Sep 17 00:00:00 2001 | ||
| 2 | From: jiajia Qian <jiajia.qian@nxp.com> | ||
| 3 | Date: Tue, 7 Jan 2025 16:42:34 +0800 | ||
| 4 | Subject: [PATCH 4/4] MGS-8011 [#ccc] Fix the problem of syntax error at | ||
| 5 | 'double4' in opencv_test_imgproc. | ||
| 6 | |||
| 7 | Since our driver does not support cl_khr_fp64 format data, | ||
| 8 | |||
| 9 | disabled the related ocl function in opencv_test_imgproc to avoid the following error log: | ||
| 10 | |||
| 11 | error: syntax error at 'double4' | ||
| 12 | |||
| 13 | Upstream-Status: Inappropriate [i.MX specific] | ||
| 14 | Signed-off-by: jiajia Qian <jiajia.qian@nxp.com> | ||
| 15 | --- | ||
| 16 | modules/imgproc/src/imgwarp.cpp | 4 ++++ | ||
| 17 | 1 file changed, 4 insertions(+) | ||
| 18 | |||
| 19 | diff --git a/modules/imgproc/src/imgwarp.cpp b/modules/imgproc/src/imgwarp.cpp | ||
| 20 | index dfc718bf87..0e8b9ce142 100644 | ||
| 21 | --- a/modules/imgproc/src/imgwarp.cpp | ||
| 22 | +++ b/modules/imgproc/src/imgwarp.cpp | ||
| 23 | @@ -1349,6 +1349,7 @@ static bool ocl_remap(InputArray _src, OutputArray _dst, InputArray _map1, Input | ||
| 24 | interpolation &= ~WARP_RELATIVE_MAP; | ||
| 25 | |||
| 26 | const ocl::Device & dev = ocl::Device::getDefault(); | ||
| 27 | + bool doubleSupport = dev.doubleFPConfig() > 0; | ||
| 28 | int cn = _src.channels(), type = _src.type(), depth = _src.depth(), | ||
| 29 | rowsPerWI = dev.isIntel() ? 4 : 1; | ||
| 30 | |||
| 31 | @@ -1356,6 +1357,9 @@ static bool ocl_remap(InputArray _src, OutputArray _dst, InputArray _map1, Input | ||
| 32 | || _map1.type() == CV_16SC1 || _map2.type() == CV_16SC1) | ||
| 33 | return false; | ||
| 34 | |||
| 35 | + if (!doubleSupport && depth == CV_64F ) | ||
| 36 | + return false; | ||
| 37 | + | ||
| 38 | UMat src = _src.getUMat(), map1 = _map1.getUMat(), map2 = _map2.getUMat(); | ||
| 39 | |||
| 40 | if( (map1.type() == CV_16SC2 && (map2.type() == CV_16UC1 || map2.empty())) || | ||
| 41 | -- | ||
| 42 | 2.34.1 | ||
| 43 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0105-MGS-8318-ccc-Fix-error-implicit-declaration-of-funct.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0105-MGS-8318-ccc-Fix-error-implicit-declaration-of-funct.patch new file mode 100644 index 000000000..d742b9123 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0105-MGS-8318-ccc-Fix-error-implicit-declaration-of-funct.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | From e5d7ecd9acd3805e90f5d491044813c034d3b014 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: jiajia Qian <jiajia.qian@nxp.com> | ||
| 3 | Date: Fri, 8 Aug 2025 14:19:57 +0800 | ||
| 4 | Subject: [PATCH] MGS-8318 [#ccc] Fix error:implicit declaration of function | ||
| 5 | 'sub_group_reduce_add' is invalid in OpenCL. | ||
| 6 | |||
| 7 | The OpenCL extension cl_khr_subgroups is not supported in OpenCL 1.2. | ||
| 8 | |||
| 9 | This feature requires at least OpenCL 2.0 or higher. By default, the C++ C language standard used | ||
| 10 | |||
| 11 | is C++ C 1.2. Therefore, specify OpenCL version to 3.0 in the build-options. | ||
| 12 | |||
| 13 | Upstream-Status: Inappropriate [i.MX specific] | ||
| 14 | Signed-off-by: jiajia Qian <jiajia.qian@nxp.com> | ||
| 15 | --- | ||
| 16 | modules/video/src/dis_flow.cpp | 2 +- | ||
| 17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 18 | |||
| 19 | diff --git a/modules/video/src/dis_flow.cpp b/modules/video/src/dis_flow.cpp | ||
| 20 | index 75090d093d..9954645ca7 100644 | ||
| 21 | --- a/modules/video/src/dis_flow.cpp | ||
| 22 | +++ b/modules/video/src/dis_flow.cpp | ||
| 23 | @@ -1101,7 +1101,7 @@ bool DISOpticalFlowImpl::ocl_PatchInverseSearch(UMat &src_U, | ||
| 24 | subgroups_build_options = " -DCV_USE_SUBGROUPS=1"; | ||
| 25 | |||
| 26 | String build_options = cv::format( | ||
| 27 | - "-DDIS_BORDER_SIZE=%d -DDIS_PATCH_SIZE=%d -DDIS_PATCH_STRIDE=%d", | ||
| 28 | + "-cl-std=CL3.0 -DDIS_BORDER_SIZE=%d -DDIS_PATCH_SIZE=%d -DDIS_PATCH_STRIDE=%d", | ||
| 29 | border_size, patch_size, patch_stride | ||
| 30 | ) + subgroups_build_options; | ||
| 31 | |||
| 32 | -- | ||
| 33 | 2.34.1 | ||
| 34 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0106-core-opencl-fix-inplace-transpose-race-by-enforcing-.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0106-core-opencl-fix-inplace-transpose-race-by-enforcing-.patch new file mode 100644 index 000000000..c061342ef --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0106-core-opencl-fix-inplace-transpose-race-by-enforcing-.patch | |||
| @@ -0,0 +1,152 @@ | |||
| 1 | From 504144ee0a126e7a11a5b1751b7dc0a80ed1cd0f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: jiajia Qian <jiajia.qian@nxp.com> | ||
| 3 | Date: Tue, 17 Mar 2026 14:19:35 +0800 | ||
| 4 | Subject: [PATCH] core(opencl): fix inplace transpose race by enforcing LLSS | ||
| 5 | ordering via local barrier | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=UTF-8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | The former inplace transpose implementation allowed a reordering of | ||
| 11 | global-memory operations across work-items. Specifically, the intended | ||
| 12 | LLSS (Load–Load–Store–Store) access pattern could be reordered by the | ||
| 13 | GPU into LSLS (Load–Store–Load–Store), causing partially written tiles | ||
| 14 | to be observed by other work-items and producing incorrect output. | ||
| 15 | |||
| 16 | This patch introduces a tiled LDS-based algorithm and adds an explicit: | ||
| 17 | |||
| 18 | barrier(CLK_LOCAL_MEM_FENCE); | ||
| 19 | |||
| 20 | between the load and store phases. | ||
| 21 | |||
| 22 | Upstream-Status: Backport | ||
| 23 | [commit a3e129aad85abcd2b61f071796ff80f9ca215619] | ||
| 24 | |||
| 25 | Signed-off-by: jiajia Qian <jiajia.qian@nxp.com> | ||
| 26 | --- | ||
| 27 | modules/core/src/matrix_transform.cpp | 10 +++- | ||
| 28 | modules/core/src/opencl/transpose.cl | 69 ++++++++++++++++++++++++++- | ||
| 29 | 2 files changed, 75 insertions(+), 4 deletions(-) | ||
| 30 | |||
| 31 | diff --git a/modules/core/src/matrix_transform.cpp b/modules/core/src/matrix_transform.cpp | ||
| 32 | index c52fcc1e4f..84aa5ca778 100644 | ||
| 33 | --- a/modules/core/src/matrix_transform.cpp | ||
| 34 | +++ b/modules/core/src/matrix_transform.cpp | ||
| 35 | @@ -146,10 +146,16 @@ static bool ocl_transpose( InputArray _src, OutputArray _dst ) | ||
| 36 | return false; | ||
| 37 | } | ||
| 38 | |||
| 39 | + String deviceMacro; | ||
| 40 | + if (dev.isIntel()) | ||
| 41 | + deviceMacro = " -D INTEL_GPU"; | ||
| 42 | + else | ||
| 43 | + deviceMacro = ""; | ||
| 44 | + | ||
| 45 | ocl::Kernel k(kernelName.c_str(), ocl::core::transpose_oclsrc, | ||
| 46 | - format("-D T=%s -D T1=%s -D cn=%d -D TILE_DIM=%d -D BLOCK_ROWS=%d -D rowsPerWI=%d%s", | ||
| 47 | + format("-D T=%s -D T1=%s -D cn=%d -D TILE_DIM=%d -D BLOCK_ROWS=%d -D rowsPerWI=%d%s%s", | ||
| 48 | ocl::memopTypeToStr(type), ocl::memopTypeToStr(depth), | ||
| 49 | - cn, TILE_DIM, BLOCK_ROWS, rowsPerWI, inplace ? " -D INPLACE" : "")); | ||
| 50 | + cn, TILE_DIM, BLOCK_ROWS, rowsPerWI, inplace ? " -D INPLACE" : "", deviceMacro.c_str())); | ||
| 51 | if (k.empty()) | ||
| 52 | return false; | ||
| 53 | |||
| 54 | diff --git a/modules/core/src/opencl/transpose.cl b/modules/core/src/opencl/transpose.cl | ||
| 55 | index 01ea7dd9d5..ae4d7f08d3 100644 | ||
| 56 | --- a/modules/core/src/opencl/transpose.cl | ||
| 57 | +++ b/modules/core/src/opencl/transpose.cl | ||
| 58 | @@ -53,10 +53,10 @@ | ||
| 59 | #define TSIZE ((int)sizeof(T1)*3) | ||
| 60 | #endif | ||
| 61 | |||
| 62 | -#ifndef INPLACE | ||
| 63 | - | ||
| 64 | #define LDS_STEP (TILE_DIM + 1) | ||
| 65 | |||
| 66 | +#ifndef INPLACE | ||
| 67 | + | ||
| 68 | __kernel void transpose(__global const uchar * srcptr, int src_step, int src_offset, int src_rows, int src_cols, | ||
| 69 | __global uchar * dstptr, int dst_step, int dst_offset) | ||
| 70 | { | ||
| 71 | @@ -120,6 +120,7 @@ __kernel void transpose(__global const uchar * srcptr, int src_step, int src_off | ||
| 72 | |||
| 73 | __kernel void transpose_inplace(__global uchar * srcptr, int src_step, int src_offset, int src_rows) | ||
| 74 | { | ||
| 75 | +#ifdef INTEL_GPU | ||
| 76 | int x = get_global_id(0); | ||
| 77 | int y = get_global_id(1) * rowsPerWI; | ||
| 78 | |||
| 79 | @@ -141,6 +142,70 @@ __kernel void transpose_inplace(__global uchar * srcptr, int src_step, int src_o | ||
| 80 | storepix(tmp, src); | ||
| 81 | } | ||
| 82 | } | ||
| 83 | +#else | ||
| 84 | + int gp_x = get_group_id(0); | ||
| 85 | + int gp_y = get_group_id(1); | ||
| 86 | + int lx = get_local_id(0); | ||
| 87 | + int ly = get_local_id(1); | ||
| 88 | + | ||
| 89 | + __local T tile_a[TILE_DIM * LDS_STEP]; | ||
| 90 | + __local T tile_b[TILE_DIM * LDS_STEP]; | ||
| 91 | + | ||
| 92 | + if (gp_x > gp_y) | ||
| 93 | + { | ||
| 94 | + int x_a = gp_x * TILE_DIM + lx; | ||
| 95 | + int y_a = gp_y * TILE_DIM + ly; | ||
| 96 | + int x_b = gp_y * TILE_DIM + lx; | ||
| 97 | + int y_b = gp_x * TILE_DIM + ly; | ||
| 98 | + | ||
| 99 | + // Load | ||
| 100 | + #pragma unroll | ||
| 101 | + for (int i = 0; i < TILE_DIM; i += BLOCK_ROWS) | ||
| 102 | + { | ||
| 103 | + if (y_a + i < src_rows && x_a < src_rows) | ||
| 104 | + tile_a[mad24(ly + i, LDS_STEP, lx)] = | ||
| 105 | + loadpix(srcptr + mad24(y_a + i, src_step, mad24(x_a, TSIZE, src_offset))); | ||
| 106 | + | ||
| 107 | + if (y_b + i < src_rows && x_b < src_rows) | ||
| 108 | + tile_b[mad24(ly + i, LDS_STEP, lx)] = | ||
| 109 | + loadpix(srcptr + mad24(y_b + i, src_step, mad24(x_b, TSIZE, src_offset))); | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + barrier(CLK_LOCAL_MEM_FENCE); | ||
| 113 | + | ||
| 114 | + // Store (transposed) | ||
| 115 | + #pragma unroll | ||
| 116 | + for (int i = 0; i < TILE_DIM; i += BLOCK_ROWS) | ||
| 117 | + { | ||
| 118 | + if (y_b + i < src_rows && x_b < src_rows) | ||
| 119 | + storepix(tile_a[mad24(lx, LDS_STEP, ly + i)], | ||
| 120 | + srcptr + mad24(y_b + i, src_step, mad24(x_b, TSIZE, src_offset))); | ||
| 121 | + | ||
| 122 | + if (y_a + i < src_rows && x_a < src_rows) | ||
| 123 | + storepix(tile_b[mad24(lx, LDS_STEP, ly + i)], | ||
| 124 | + srcptr + mad24(y_a + i, src_step, mad24(x_a, TSIZE, src_offset))); | ||
| 125 | + } | ||
| 126 | + } | ||
| 127 | + else if (gp_x == gp_y) | ||
| 128 | + { | ||
| 129 | + int x = gp_x * TILE_DIM + lx; | ||
| 130 | + int y = gp_y * TILE_DIM + ly; | ||
| 131 | + | ||
| 132 | + #pragma unroll | ||
| 133 | + for (int i = 0; i < TILE_DIM; i += BLOCK_ROWS) | ||
| 134 | + if (y + i < src_rows && x < src_rows) | ||
| 135 | + tile_a[mad24(ly + i, LDS_STEP, lx)] = | ||
| 136 | + loadpix(srcptr + mad24(y + i, src_step, mad24(x, TSIZE, src_offset))); | ||
| 137 | + | ||
| 138 | + barrier(CLK_LOCAL_MEM_FENCE); | ||
| 139 | + | ||
| 140 | + #pragma unroll | ||
| 141 | + for (int i = 0; i < TILE_DIM; i += BLOCK_ROWS) | ||
| 142 | + if (y + i < src_rows && x < src_rows) | ||
| 143 | + storepix(tile_a[mad24(lx, LDS_STEP, ly + i)], | ||
| 144 | + srcptr + mad24(y + i, src_step, mad24(x, TSIZE, src_offset))); | ||
| 145 | + } | ||
| 146 | +#endif | ||
| 147 | } | ||
| 148 | |||
| 149 | #endif // INPLACE | ||
| 150 | -- | ||
| 151 | 2.34.1 | ||
| 152 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0107-imgproc-perf-HoughLines-Fix-test-tolerance-and-compa.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0107-imgproc-perf-HoughLines-Fix-test-tolerance-and-compa.patch new file mode 100644 index 000000000..de128954a --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0107-imgproc-perf-HoughLines-Fix-test-tolerance-and-compa.patch | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | From fa4b11750cfb19ccbe21a2f8d1801ba014e8b401 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Samaresh Kumar Singh <ssam3003@gmail.com> | ||
| 3 | Date: Wed, 4 Mar 2026 13:13:52 -0600 | ||
| 4 | Subject: [PATCH 1/2] [imgproc][perf][HoughLines] Fix test tolerance and | ||
| 5 | comparator for cross-backend stability | ||
| 6 | |||
| 7 | Upstream-Status: Submitted [under review] | ||
| 8 | |||
| 9 | --- | ||
| 10 | modules/imgproc/perf/opencl/perf_houghlines.cpp | 9 ++++++--- | ||
| 11 | 1 file changed, 6 insertions(+), 3 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/modules/imgproc/perf/opencl/perf_houghlines.cpp b/modules/imgproc/perf/opencl/perf_houghlines.cpp | ||
| 14 | index 0a5f3ae561..bffd895f2b 100644 | ||
| 15 | --- a/modules/imgproc/perf/opencl/perf_houghlines.cpp | ||
| 16 | +++ b/modules/imgproc/perf/opencl/perf_houghlines.cpp | ||
| 17 | @@ -19,7 +19,7 @@ struct Vec2fComparator | ||
| 18 | { | ||
| 19 | bool operator()(const Vec2f& a, const Vec2f b) const | ||
| 20 | { | ||
| 21 | - if(a[0] != b[0]) return a[0] < b[0]; | ||
| 22 | + if(std::abs(a[0] - b[0]) > 1e-3f) return a[0] < b[0]; | ||
| 23 | else return a[1] < b[1]; | ||
| 24 | } | ||
| 25 | }; | ||
| 26 | @@ -55,7 +55,10 @@ OCL_PERF_TEST_P(HoughLinesFixture, HoughLines, Combine(OCL_TEST_SIZES, | ||
| 27 | lines.copyTo(result); | ||
| 28 | std::sort(result.begin<Vec2f>(), result.end<Vec2f>(), Vec2fComparator()); | ||
| 29 | |||
| 30 | - SANITY_CHECK(result, 1e-6); | ||
| 31 | + EXPECT_GE((size_t)result.total(), 6u); | ||
| 32 | + EXPECT_LT((size_t)result.total(), 50u); | ||
| 33 | + | ||
| 34 | + SANITY_CHECK_NOTHING(); | ||
| 35 | } | ||
| 36 | |||
| 37 | ///////////// HoughLinesP ///////////////////// | ||
| 38 | @@ -88,4 +91,4 @@ OCL_PERF_TEST_P(HoughLinesPFixture, HoughLinesP, Combine(Values("cv/shared/pic5. | ||
| 39 | |||
| 40 | } } // namespace opencv_test::ocl | ||
| 41 | |||
| 42 | -#endif // HAVE_OPENCL | ||
| 43 | \ No newline at end of file | ||
| 44 | +#endif // HAVE_OPENCL | ||
| 45 | -- | ||
| 46 | 2.34.1 | ||
| 47 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0108-imgproc-perf-HoughLines-Fix-lower-bound-for-line-cou.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0108-imgproc-perf-HoughLines-Fix-lower-bound-for-line-cou.patch new file mode 100644 index 000000000..bc7013481 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0108-imgproc-perf-HoughLines-Fix-lower-bound-for-line-cou.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | From 2751419022d65b7d9260c87c7806db0f32a1c359 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Samaresh Kumar Singh <ssam3003@gmail.com> | ||
| 3 | Date: Thu, 5 Mar 2026 19:21:36 -0600 | ||
| 4 | Subject: [PATCH 2/2] [imgproc][perf][HoughLines] Fix lower bound for line | ||
| 5 | count check | ||
| 6 | |||
| 7 | With thetaStep=0.1 rad, theta=PI/2 is not a sampled accumulator bin, so horizontal lines fall below the vote threshold and are not detected. | ||
| 8 | Only the 3 vertical lines (at theta=0, always an exact bin) are reliably found in that case. Lower the EXPECT_GE bound from 6 to 3 to reflect the worst-case guarantee across all thetaStep values and backends. | ||
| 9 | |||
| 10 | Fixes regression introduced in fa4b117. | ||
| 11 | Upstream-Status: Submitted [under review] | ||
| 12 | --- | ||
| 13 | modules/imgproc/perf/opencl/perf_houghlines.cpp | 2 +- | ||
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/modules/imgproc/perf/opencl/perf_houghlines.cpp b/modules/imgproc/perf/opencl/perf_houghlines.cpp | ||
| 17 | index bffd895f2b..95c61667fc 100644 | ||
| 18 | --- a/modules/imgproc/perf/opencl/perf_houghlines.cpp | ||
| 19 | +++ b/modules/imgproc/perf/opencl/perf_houghlines.cpp | ||
| 20 | @@ -55,7 +55,7 @@ OCL_PERF_TEST_P(HoughLinesFixture, HoughLines, Combine(OCL_TEST_SIZES, | ||
| 21 | lines.copyTo(result); | ||
| 22 | std::sort(result.begin<Vec2f>(), result.end<Vec2f>(), Vec2fComparator()); | ||
| 23 | |||
| 24 | - EXPECT_GE((size_t)result.total(), 6u); | ||
| 25 | + EXPECT_GE((size_t)result.total(), 3u); | ||
| 26 | EXPECT_LT((size_t)result.total(), 50u); | ||
| 27 | |||
| 28 | SANITY_CHECK_NOTHING(); | ||
| 29 | -- | ||
| 30 | 2.34.1 | ||
| 31 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0109-core-ocl-fix-incorrect-results-for-in-place-flip-on-.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0109-core-ocl-fix-incorrect-results-for-in-place-flip-on-.patch new file mode 100644 index 000000000..5a6d8891f --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/0109-core-ocl-fix-incorrect-results-for-in-place-flip-on-.patch | |||
| @@ -0,0 +1,352 @@ | |||
| 1 | From ba879cd60f505c3239a6bc5c4b8eb6ca87d143c2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: jiajia Qian <jiajia.qian@nxp.com> | ||
| 3 | Date: Thu, 16 Apr 2026 10:14:05 +0800 | ||
| 4 | Subject: [PATCH] core/ocl: fix incorrect results for in-place flip on strict | ||
| 5 | OpenCL implementations | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=UTF-8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | Previously, OpenCL in-place flip kernels (rows/cols/both) could produce | ||
| 11 | incorrect results compared to the CPU implementation on strict OpenCL | ||
| 12 | drivers such as Mesa. The kernels relied on implicit load–load–store–store | ||
| 13 | (LLSS) ordering when src and dst alias, which is not guaranteed by the | ||
| 14 | OpenCL memory model and may be reordered. | ||
| 15 | |||
| 16 | Some vendor drivers happened to preserve the expected ordering, masking | ||
| 17 | the issue, but Mesa correctly exposes the undefined behavior. | ||
| 18 | |||
| 19 | This change introduces dedicated in-place flip kernels that: | ||
| 20 | - Explicitly detect in-place execution (src == dst) | ||
| 21 | - Stage data through local memory tiles | ||
| 22 | - Enforce correct ordering with work-group barriers | ||
| 23 | - Avoid global memory read/write aliasing hazards | ||
| 24 | |||
| 25 | The non in-place path is unchanged. | ||
| 26 | |||
| 27 | With this fix, OpenCL in-place flip produces correct and consistent results | ||
| 28 | across drivers, matches CPU behavior, and complies with the OpenCL memory | ||
| 29 | model. | ||
| 30 | |||
| 31 | Upstream-Status: Backport [ba879cd60f505c3239a6bc5c4b8eb6ca87d143c2] | ||
| 32 | Signed-off-by: jiajia Qian <jiajia.qian@nxp.com> | ||
| 33 | --- | ||
| 34 | modules/core/src/matrix_transform.cpp | 71 +++++++--- | ||
| 35 | modules/core/src/opencl/flip.cl | 196 ++++++++++++++++++++++++++ | ||
| 36 | 2 files changed, 250 insertions(+), 17 deletions(-) | ||
| 37 | |||
| 38 | diff --git a/modules/core/src/matrix_transform.cpp b/modules/core/src/matrix_transform.cpp | ||
| 39 | index ce859e8eb8..245cd89843 100644 | ||
| 40 | --- a/modules/core/src/matrix_transform.cpp | ||
| 41 | +++ b/modules/core/src/matrix_transform.cpp | ||
| 42 | @@ -973,7 +973,12 @@ static bool ocl_flip(InputArray _src, OutputArray _dst, int flipCode ) | ||
| 43 | if (cn > 4) | ||
| 44 | return false; | ||
| 45 | |||
| 46 | - const char * kernelName; | ||
| 47 | + Size size = _src.size(); | ||
| 48 | + _dst.create(size, type); | ||
| 49 | + UMat src = _src.getUMat(), dst = _dst.getUMat(); | ||
| 50 | + bool inplace = (dst.u == src.u); | ||
| 51 | + | ||
| 52 | + String kernelName; | ||
| 53 | if (flipCode == 0) | ||
| 54 | kernelName = "arithm_flip_rows", flipType = FLIP_ROWS; | ||
| 55 | else if (flipCode > 0) | ||
| 56 | @@ -981,33 +986,65 @@ static bool ocl_flip(InputArray _src, OutputArray _dst, int flipCode ) | ||
| 57 | else | ||
| 58 | kernelName = "arithm_flip_rows_cols", flipType = FLIP_BOTH; | ||
| 59 | |||
| 60 | + if(inplace) | ||
| 61 | + kernelName += "_inplace"; | ||
| 62 | + | ||
| 63 | int pxPerWIy = (dev.isIntel() && (dev.type() & ocl::Device::TYPE_GPU)) ? 4 : 1; | ||
| 64 | kercn = (cn!=3 || flipType == FLIP_ROWS) ? std::max(kercn, cn) : cn; | ||
| 65 | + const int TILE_SIZE = 32, BLOCK_ROWS = 8; | ||
| 66 | |||
| 67 | - ocl::Kernel k(kernelName, ocl::core::flip_oclsrc, | ||
| 68 | - format( "-D T=%s -D T1=%s -D DEPTH=%d -D cn=%d -D PIX_PER_WI_Y=%d -D kercn=%d", | ||
| 69 | + ocl::Kernel k(kernelName.c_str(), ocl::core::flip_oclsrc, | ||
| 70 | + format( "-D T=%s -D T1=%s -D DEPTH=%d -D cn=%d -D PIX_PER_WI_Y=%d -D kercn=%d -D TILE_SIZE=%d -D BLOCK_ROWS=%d%s", | ||
| 71 | kercn != cn ? ocl::typeToStr(CV_MAKE_TYPE(depth, kercn)) : ocl::vecopTypeToStr(CV_MAKE_TYPE(depth, kercn)), | ||
| 72 | - kercn != cn ? ocl::typeToStr(depth) : ocl::vecopTypeToStr(depth), depth, cn, pxPerWIy, kercn)); | ||
| 73 | + kercn != cn ? ocl::typeToStr(depth) : ocl::vecopTypeToStr(depth), depth, cn, pxPerWIy, kercn, TILE_SIZE, BLOCK_ROWS, | ||
| 74 | + inplace ? " -D INPLACE" : "")); | ||
| 75 | if (k.empty()) | ||
| 76 | return false; | ||
| 77 | |||
| 78 | - Size size = _src.size(); | ||
| 79 | - _dst.create(size, type); | ||
| 80 | - UMat src = _src.getUMat(), dst = _dst.getUMat(); | ||
| 81 | - | ||
| 82 | int cols = size.width * cn / kercn, rows = size.height; | ||
| 83 | - cols = flipType == FLIP_COLS ? (cols + 1) >> 1 : cols; | ||
| 84 | - rows = flipType & FLIP_ROWS ? (rows + 1) >> 1 : rows; | ||
| 85 | + int work_cols = flipType == FLIP_COLS ? (cols + 1) >> 1 : cols; | ||
| 86 | + int work_rows = flipType & FLIP_ROWS ? (rows + 1) >> 1 : rows; | ||
| 87 | + | ||
| 88 | + if (inplace) | ||
| 89 | + { | ||
| 90 | + k.args(ocl::KernelArg::ReadWriteNoSize(dst), rows, cols); | ||
| 91 | + | ||
| 92 | + int gs_cols, gs_rows; | ||
| 93 | + if (flipType == FLIP_COLS) | ||
| 94 | + { | ||
| 95 | + gs_cols = work_cols; | ||
| 96 | + gs_rows = rows; | ||
| 97 | + } | ||
| 98 | + else if (flipType == FLIP_ROWS) | ||
| 99 | + { | ||
| 100 | + gs_cols = cols; | ||
| 101 | + gs_rows = work_rows; | ||
| 102 | + } | ||
| 103 | + else // FLIP_BOTH | ||
| 104 | + { | ||
| 105 | + gs_cols = cols; | ||
| 106 | + gs_rows = rows; | ||
| 107 | + } | ||
| 108 | |||
| 109 | - k.args(ocl::KernelArg::ReadOnlyNoSize(src), | ||
| 110 | - ocl::KernelArg::WriteOnly(dst, cn, kercn), rows, cols); | ||
| 111 | + size_t globalsize[2] = { | ||
| 112 | + (size_t)divUp(gs_cols, TILE_SIZE) * TILE_SIZE, | ||
| 113 | + (size_t)divUp(gs_rows, TILE_SIZE) * BLOCK_ROWS | ||
| 114 | + }; | ||
| 115 | + size_t localsize[2] = { TILE_SIZE, BLOCK_ROWS }; | ||
| 116 | + return k.run(2, globalsize, localsize, false); | ||
| 117 | + } | ||
| 118 | + else | ||
| 119 | + { | ||
| 120 | + k.args(ocl::KernelArg::ReadOnlyNoSize(src), | ||
| 121 | + ocl::KernelArg::WriteOnly(dst, cn, kercn), work_rows, work_cols); | ||
| 122 | |||
| 123 | - size_t maxWorkGroupSize = dev.maxWorkGroupSize(); | ||
| 124 | - CV_Assert(maxWorkGroupSize % 4 == 0); | ||
| 125 | + size_t maxWorkGroupSize = dev.maxWorkGroupSize(); | ||
| 126 | + CV_Assert(maxWorkGroupSize % 4 == 0); | ||
| 127 | |||
| 128 | - size_t globalsize[2] = { (size_t)cols, ((size_t)rows + pxPerWIy - 1) / pxPerWIy }, | ||
| 129 | - localsize[2] = { maxWorkGroupSize / 4, 4 }; | ||
| 130 | - return k.run(2, globalsize, (flipType == FLIP_COLS) && !dev.isIntel() ? localsize : NULL, false); | ||
| 131 | + size_t globalsize[2] = { (size_t)work_cols, ((size_t)work_rows + pxPerWIy - 1) / pxPerWIy }; | ||
| 132 | + size_t localsize[2] = { maxWorkGroupSize / 4, 4 }; | ||
| 133 | + return k.run(2, globalsize, (flipType == FLIP_COLS) && !dev.isIntel() ? localsize : NULL, false); | ||
| 134 | + } | ||
| 135 | } | ||
| 136 | |||
| 137 | #endif | ||
| 138 | diff --git a/modules/core/src/opencl/flip.cl b/modules/core/src/opencl/flip.cl | ||
| 139 | index afd14e4e1f..dbe23c73a4 100644 | ||
| 140 | --- a/modules/core/src/opencl/flip.cl | ||
| 141 | +++ b/modules/core/src/opencl/flip.cl | ||
| 142 | @@ -63,6 +63,9 @@ | ||
| 143 | #endif | ||
| 144 | #define TSIZE ((int)sizeof(T1)*3) | ||
| 145 | #endif | ||
| 146 | +#define LDS_STEP (TILE_SIZE + 1) | ||
| 147 | + | ||
| 148 | +#ifndef INPLACE | ||
| 149 | |||
| 150 | __kernel void arithm_flip_rows(__global const uchar * srcptr, int src_step, int src_offset, | ||
| 151 | __global uchar * dstptr, int dst_step, int dst_offset, | ||
| 152 | @@ -183,3 +186,196 @@ __kernel void arithm_flip_cols(__global const uchar * srcptr, int src_step, int | ||
| 153 | } | ||
| 154 | } | ||
| 155 | } | ||
| 156 | + | ||
| 157 | +#else | ||
| 158 | + | ||
| 159 | +__kernel void arithm_flip_rows_inplace(__global uchar * srcptr, int src_step, int src_offset, | ||
| 160 | + int rows, int cols) | ||
| 161 | +{ | ||
| 162 | + int gp_x = get_group_id(0); | ||
| 163 | + int gp_y = get_group_id(1); | ||
| 164 | + int lx = get_local_id(0); | ||
| 165 | + int ly = get_local_id(1); | ||
| 166 | + | ||
| 167 | + __local T tile_top[TILE_SIZE * LDS_STEP]; | ||
| 168 | + __local T tile_bottom[TILE_SIZE * LDS_STEP]; | ||
| 169 | + | ||
| 170 | + int half_rows = (rows + 1) / 2; | ||
| 171 | + | ||
| 172 | + int x = gp_x * TILE_SIZE + lx; | ||
| 173 | + int y_top = gp_y * TILE_SIZE + ly; | ||
| 174 | + int y_bottom = rows - 1 - y_top; | ||
| 175 | + | ||
| 176 | + #pragma unroll | ||
| 177 | + for (int i = 0; i < TILE_SIZE; i += BLOCK_ROWS) | ||
| 178 | + { | ||
| 179 | + if (x < cols && y_top + i < half_rows) | ||
| 180 | + { | ||
| 181 | + int curr_y_top = y_top + i; | ||
| 182 | + int curr_y_bottom = rows - 1 - curr_y_top; | ||
| 183 | + | ||
| 184 | + T val_top = loadpix(srcptr + mad24(curr_y_top, src_step, mad24(x, TSIZE, src_offset))); | ||
| 185 | + T val_bottom = loadpix(srcptr + mad24(curr_y_bottom, src_step, mad24(x, TSIZE, src_offset))); | ||
| 186 | + | ||
| 187 | + tile_top[mad24(ly + i, LDS_STEP, lx)] = val_top; | ||
| 188 | + tile_bottom[mad24(ly + i, LDS_STEP, lx)] = val_bottom; | ||
| 189 | + } | ||
| 190 | + } | ||
| 191 | + barrier(CLK_LOCAL_MEM_FENCE); | ||
| 192 | + | ||
| 193 | + #pragma unroll | ||
| 194 | + for (int i = 0; i < TILE_SIZE; i += BLOCK_ROWS) | ||
| 195 | + { | ||
| 196 | + if (x < cols && y_top + i < half_rows) | ||
| 197 | + { | ||
| 198 | + int curr_y_top = y_top + i; | ||
| 199 | + int curr_y_bottom = rows - 1 - curr_y_top; | ||
| 200 | + | ||
| 201 | + storepix(tile_bottom[mad24(ly + i, LDS_STEP, lx)], | ||
| 202 | + srcptr + mad24(curr_y_top, src_step, mad24(x, TSIZE, src_offset))); | ||
| 203 | + | ||
| 204 | + if (curr_y_top != curr_y_bottom) | ||
| 205 | + { | ||
| 206 | + storepix(tile_top[mad24(ly + i, LDS_STEP, lx)], | ||
| 207 | + srcptr + mad24(curr_y_bottom, src_step, mad24(x, TSIZE, src_offset))); | ||
| 208 | + } | ||
| 209 | + } | ||
| 210 | + } | ||
| 211 | +} | ||
| 212 | + | ||
| 213 | +__kernel void arithm_flip_rows_cols_inplace(__global uchar * srcptr, int src_step, int src_offset, | ||
| 214 | + int rows, int cols) | ||
| 215 | +{ | ||
| 216 | + int gp_x = get_group_id(0); | ||
| 217 | + int gp_y = get_group_id(1); | ||
| 218 | + int lx = get_local_id(0); | ||
| 219 | + int ly = get_local_id(1); | ||
| 220 | + | ||
| 221 | + __local T tile_first[TILE_SIZE * LDS_STEP]; | ||
| 222 | + __local T tile_second[TILE_SIZE * LDS_STEP]; | ||
| 223 | + | ||
| 224 | + int total_pixels = rows * cols; | ||
| 225 | + int half_pixels = (total_pixels + 1) / 2; | ||
| 226 | + | ||
| 227 | + int x_first = gp_x * TILE_SIZE + lx; | ||
| 228 | + int y_first = gp_y * TILE_SIZE + ly; | ||
| 229 | + | ||
| 230 | + int x_second = cols - 1 - x_first; | ||
| 231 | + int y_second = rows - 1 - y_first; | ||
| 232 | + | ||
| 233 | + #pragma unroll | ||
| 234 | + for (int i = 0; i < TILE_SIZE; i += BLOCK_ROWS) | ||
| 235 | + { | ||
| 236 | + int curr_y_first = y_first + i; | ||
| 237 | + int curr_y_second = rows - 1 - curr_y_first; | ||
| 238 | + int linear_idx = curr_y_first * cols + x_first; | ||
| 239 | + | ||
| 240 | + if (x_first < cols && curr_y_first < rows && linear_idx < half_pixels) | ||
| 241 | + { | ||
| 242 | + T val_first = loadpix(srcptr + mad24(curr_y_first, src_step, mad24(x_first, TSIZE, src_offset))); | ||
| 243 | + T val_second = loadpix(srcptr + mad24(curr_y_second, src_step, mad24(x_second, TSIZE, src_offset))); | ||
| 244 | + | ||
| 245 | +#if kercn == 2 | ||
| 246 | +#if cn == 1 | ||
| 247 | + val_first = val_first.s10; | ||
| 248 | + val_second = val_second.s10; | ||
| 249 | +#endif | ||
| 250 | +#elif kercn == 4 | ||
| 251 | +#if cn == 1 | ||
| 252 | + val_first = val_first.s3210; | ||
| 253 | + val_second = val_second.s3210; | ||
| 254 | +#elif cn == 2 | ||
| 255 | + val_first = val_first.s2301; | ||
| 256 | + val_second = val_second.s2301; | ||
| 257 | +#endif | ||
| 258 | +#endif | ||
| 259 | + tile_first[mad24(ly + i, LDS_STEP, lx)] = val_first; | ||
| 260 | + tile_second[mad24(ly + i, LDS_STEP, lx)] = val_second; | ||
| 261 | + } | ||
| 262 | + } | ||
| 263 | + barrier(CLK_LOCAL_MEM_FENCE); | ||
| 264 | + | ||
| 265 | + #pragma unroll | ||
| 266 | + for (int i = 0; i < TILE_SIZE; i += BLOCK_ROWS) | ||
| 267 | + { | ||
| 268 | + int curr_y_first = y_first + i; | ||
| 269 | + int curr_y_second = rows - 1 - curr_y_first; | ||
| 270 | + int linear_idx = curr_y_first * cols + x_first; | ||
| 271 | + | ||
| 272 | + if (x_first < cols && curr_y_first < rows && linear_idx < half_pixels) | ||
| 273 | + { | ||
| 274 | + storepix(tile_second[mad24(ly + i, LDS_STEP, lx)], | ||
| 275 | + srcptr + mad24(curr_y_first, src_step, mad24(x_first, TSIZE, src_offset))); | ||
| 276 | + | ||
| 277 | + if (linear_idx != total_pixels - 1 - linear_idx) | ||
| 278 | + { | ||
| 279 | + storepix(tile_first[mad24(ly + i, LDS_STEP, lx)], | ||
| 280 | + srcptr + mad24(curr_y_second, src_step, mad24(x_second, TSIZE, src_offset))); | ||
| 281 | + } | ||
| 282 | + } | ||
| 283 | + } | ||
| 284 | +} | ||
| 285 | + | ||
| 286 | +__kernel void arithm_flip_cols_inplace(__global uchar * srcptr, int src_step, int src_offset, | ||
| 287 | + int rows, int cols) | ||
| 288 | +{ | ||
| 289 | + int gp_x = get_group_id(0); | ||
| 290 | + int gp_y = get_group_id(1); | ||
| 291 | + int lx = get_local_id(0); | ||
| 292 | + int ly = get_local_id(1); | ||
| 293 | + | ||
| 294 | + __local T tile_left[TILE_SIZE * LDS_STEP]; | ||
| 295 | + __local T tile_right[TILE_SIZE * LDS_STEP]; | ||
| 296 | + | ||
| 297 | + int half_cols = (cols + 1) / 2; | ||
| 298 | + | ||
| 299 | + int x_left = gp_x * TILE_SIZE + lx; | ||
| 300 | + int y = gp_y * TILE_SIZE + ly; | ||
| 301 | + int x_right = cols - 1 - x_left; | ||
| 302 | + | ||
| 303 | + #pragma unroll | ||
| 304 | + for (int i = 0; i < TILE_SIZE; i += BLOCK_ROWS) | ||
| 305 | + { | ||
| 306 | + if (y + i < rows && x_left < half_cols) | ||
| 307 | + { | ||
| 308 | + T val_left = loadpix(srcptr + mad24(y + i, src_step, mad24(x_left, TSIZE, src_offset))); | ||
| 309 | + T val_right = loadpix(srcptr + mad24(y + i, src_step, mad24(x_right, TSIZE, src_offset))); | ||
| 310 | + | ||
| 311 | +#if kercn == 2 | ||
| 312 | +#if cn == 1 | ||
| 313 | + val_left = val_left.s10; | ||
| 314 | + val_right = val_right.s10; | ||
| 315 | +#endif | ||
| 316 | +#elif kercn == 4 | ||
| 317 | +#if cn == 1 | ||
| 318 | + val_left = val_left.s3210; | ||
| 319 | + val_right = val_right.s3210; | ||
| 320 | +#elif cn == 2 | ||
| 321 | + val_left = val_left.s2301; | ||
| 322 | + val_right = val_right.s2301; | ||
| 323 | +#endif | ||
| 324 | +#endif | ||
| 325 | + tile_left[mad24(ly + i, LDS_STEP, lx)] = val_left; | ||
| 326 | + tile_right[mad24(ly + i, LDS_STEP, lx)] = val_right; | ||
| 327 | + } | ||
| 328 | + } | ||
| 329 | + barrier(CLK_LOCAL_MEM_FENCE); | ||
| 330 | + | ||
| 331 | + #pragma unroll | ||
| 332 | + for (int i = 0; i < TILE_SIZE; i += BLOCK_ROWS) | ||
| 333 | + { | ||
| 334 | + if (y + i < rows && x_left < half_cols) | ||
| 335 | + { | ||
| 336 | + storepix(tile_right[mad24(ly + i, LDS_STEP, lx)], | ||
| 337 | + srcptr + mad24(y + i, src_step, mad24(x_left, TSIZE, src_offset))); | ||
| 338 | + | ||
| 339 | + if (x_left != x_right) | ||
| 340 | + { | ||
| 341 | + storepix(tile_left[mad24(ly + i, LDS_STEP, lx)], | ||
| 342 | + srcptr + mad24(y + i, src_step, mad24(x_right, TSIZE, src_offset))); | ||
| 343 | + } | ||
| 344 | + } | ||
| 345 | + } | ||
| 346 | +} | ||
| 347 | + | ||
| 348 | +#endif // INPLACE | ||
| 349 | \ No newline at end of file | ||
| 350 | -- | ||
| 351 | 2.34.1 | ||
| 352 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/27691.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/27691.patch new file mode 100644 index 000000000..c8c23c93a --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv/27691.patch | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | From 90c444abd387ffa70b2e72a34922903a2f0f4f5a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexander Smorkalov <alexander.smorkalov@opencv.ai> | ||
| 3 | Date: Wed, 20 Aug 2025 10:53:51 +0300 | ||
| 4 | Subject: [PATCH] FFmpeg 8.0 support. | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://github.com/opencv/opencv/commit/86df53155411b3ade57d0213bf8dd63006bf248f] | ||
| 7 | --- | ||
| 8 | modules/videoio/src/cap_ffmpeg_impl.hpp | 14 ++++++++++++++ | ||
| 9 | 1 file changed, 14 insertions(+) | ||
| 10 | |||
| 11 | diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp | ||
| 12 | index 489dbe565d3d..5780b4c11361 100644 | ||
| 13 | --- a/modules/videoio/src/cap_ffmpeg_impl.hpp | ||
| 14 | +++ b/modules/videoio/src/cap_ffmpeg_impl.hpp | ||
| 15 | @@ -685,7 +685,10 @@ void CvCapture_FFMPEG::close() | ||
| 16 | if( video_st ) | ||
| 17 | { | ||
| 18 | #ifdef CV_FFMPEG_CODECPAR | ||
| 19 | +// avcodec_close removed in FFmpeg release 8.0 | ||
| 20 | +# if (LIBAVCODEC_BUILD < CALC_FFMPEG_VERSION(62, 11, 100)) | ||
| 21 | avcodec_close( context ); | ||
| 22 | +# endif | ||
| 23 | #endif | ||
| 24 | video_st = NULL; | ||
| 25 | } | ||
| 26 | @@ -2005,7 +2008,18 @@ void CvCapture_FFMPEG::get_rotation_angle() | ||
| 27 | rotation_angle = 0; | ||
| 28 | #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(57, 68, 100) | ||
| 29 | const uint8_t *data = 0; | ||
| 30 | + // av_stream_get_side_data removed in FFmpeg release 8.0 | ||
| 31 | +# if (LIBAVCODEC_BUILD < CALC_FFMPEG_VERSION(62, 11, 100)) | ||
| 32 | data = av_stream_get_side_data(video_st, AV_PKT_DATA_DISPLAYMATRIX, NULL); | ||
| 33 | +# else | ||
| 34 | + AVPacketSideData* sd = video_st->codecpar->coded_side_data; | ||
| 35 | + int nb_sd = video_st->codecpar->nb_coded_side_data; | ||
| 36 | + if (sd && nb_sd > 0) | ||
| 37 | + { | ||
| 38 | + const AVPacketSideData* mtx = av_packet_side_data_get(sd, nb_sd, AV_PKT_DATA_DISPLAYMATRIX); | ||
| 39 | + data = mtx->data; | ||
| 40 | + } | ||
| 41 | +# endif | ||
| 42 | if (data) | ||
| 43 | { | ||
| 44 | rotation_angle = -cvRound(av_display_rotation_get((const int32_t*)data)); | ||
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 index ef7831a5f..9aee21c4d 100644 --- 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 | |||
| @@ -1,17 +1,19 @@ | |||
| 1 | From 3c4daafb54f961e376104a461ca7ec114ff0331a Mon Sep 17 00:00:00 2001 | 1 | From c0e12bef26b4e4f10eb541c26f7fd7400addb67e Mon Sep 17 00:00:00 2001 |
| 2 | From: Ludek Slosarcik <ludek.slosarcik@nxp.com> | 2 | From: Ludek Slosarcik <ludek.slosarcik@nxp.com> |
| 3 | Date: Fri, 14 Feb 2020 15:46:50 +0100 | 3 | Date: Fri, 14 Feb 2020 15:46:50 +0100 |
| 4 | Subject: [PATCH] opencv_dnn: added video device for 2 examples, and change text labels | 4 | Subject: [PATCH] opencv_dnn: added video device for 2 examples, and change |
| 5 | text labels | ||
| 5 | 6 | ||
| 6 | Signed-off-by: Ludek Slosarcik <ludek.slosarcik@nxp.com> | 7 | Signed-off-by: Ludek Slosarcik <ludek.slosarcik@nxp.com> |
| 7 | 8 | ||
| 8 | Upstream-Status: Pending | 9 | Upstream-Status: Pending |
| 10 | |||
| 9 | --- | 11 | --- |
| 10 | samples/cpp/logistic_regression.cpp | 2 +- | 12 | samples/cpp/logistic_regression.cpp | 2 +- |
| 11 | samples/dnn/classification.cpp | 7 ++++--- | 13 | samples/dnn/classification.cpp | 9 +++++---- |
| 12 | samples/dnn/object_detection.cpp | 10 +++++----- | 14 | samples/dnn/object_detection.cpp | 10 +++++----- |
| 13 | samples/dnn/segmentation.cpp | 2 +- | 15 | samples/dnn/segmentation.cpp | 2 +- |
| 14 | samples/dnn/text_detection.cpp | 5 +++-- | 16 | samples/dnn/text_detection.cpp | 3 ++- |
| 15 | 5 files changed, 14 insertions(+), 12 deletions(-) | 17 | 5 files changed, 14 insertions(+), 12 deletions(-) |
| 16 | 18 | ||
| 17 | Index: git/samples/cpp/logistic_regression.cpp | 19 | Index: git/samples/cpp/logistic_regression.cpp |
| @@ -128,8 +130,8 @@ Index: git/samples/dnn/text_detection.cpp | |||
| 128 | "{ input i | | Path to input image or video file. Skip this argument to capture frames from a camera.}" | 130 | "{ input i | | Path to input image or video file. Skip this argument to capture frames from a camera.}" |
| 129 | + "{ device | 0 | camera device number. }" | 131 | + "{ device | 0 | camera device number. }" |
| 130 | "{ detModel dmp | | Path to a binary .pb file contains trained detector network.}" | 132 | "{ detModel dmp | | Path to a binary .pb file contains trained detector network.}" |
| 131 | "{ width | 320 | Preprocess input image by resizing to a specific width. It should be multiple by 32. }" | 133 | "{ width | 320 | Preprocess input image by resizing to a specific width. It should be a multiple of 32. }" |
| 132 | "{ height | 320 | Preprocess input image by resizing to a specific height. It should be multiple by 32. }" | 134 | "{ height | 320 | Preprocess input image by resizing to a specific height. It should be a multiple of 32. }" |
| 133 | @@ -106,7 +107,7 @@ int main(int argc, char** argv) | 135 | @@ -106,7 +107,7 @@ int main(int argc, char** argv) |
| 134 | 136 | ||
| 135 | // Open a video file or an image file or a camera stream. | 137 | // Open a video file or an image file or a camera stream. |
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 index 3538f24b3..265d723c6 100644 --- 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 | |||
| @@ -1,19 +1,60 @@ | |||
| 1 | From 5e4150826fea6f37276f348c65d94ce4847d1211 Mon Sep 17 00:00:00 2001 | 1 | From 75f7475fcfb35cbe4d8f5ccf5c4ac8bc78f2dc30 Mon Sep 17 00:00:00 2001 |
| 2 | From: Kumataro <Kumataro@users.noreply.github.com> | 2 | From: Kumataro <Kumataro@users.noreply.github.com> |
| 3 | Date: Sat, 7 Oct 2023 10:11:25 +0900 | 3 | Date: Thu, 19 Oct 2023 14:45:08 +0900 |
| 4 | Subject: [PATCH] 3rdparty: supporting protobuf v22 and later | 4 | Subject: [PATCH] Merge pull request #24372 from Kumataro:fix24369 |
| 5 | 5 | ||
| 6 | Upstream-Status: Submitted [https://github.com/opencv/opencv/pull/24372] | 6 | Supporting protobuf v22 and later(with abseil-cpp/C++17) #24372 |
| 7 | |||
| 8 | fix https://github.com/opencv/opencv/issues/24369 | ||
| 9 | related https://github.com/opencv/opencv/issues/23791 | ||
| 10 | |||
| 11 | 1. This patch supports external protobuf v22 and later, it required abseil-cpp and c++17. | ||
| 12 | Even if the built-in protobuf is upgraded to v22 or later, | ||
| 13 | the dependency on abseil-cpp and the requirement for C++17 will continue. | ||
| 14 | 2. Some test for caffe required patched protobuf, so this patch disable them. | ||
| 15 | |||
| 16 | This patch is tested by following libraries. | ||
| 17 | - Protobuf: /usr/local/lib/libprotobuf.so (4.24.4) | ||
| 18 | - abseil-cpp: YES (20230125) | ||
| 19 | |||
| 20 | See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request | ||
| 21 | |||
| 22 | - [x] I agree to contribute to the project under Apache 2 License. | ||
| 23 | - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV | ||
| 24 | - [x] The PR is proposed to the proper branch | ||
| 25 | - [x] There is a reference to the original bug report and related work | ||
| 26 | - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable | ||
| 27 | Patch to opencv_extra has the same branch name. | ||
| 28 | - [x] The feature is well documented and sample code can be built with the project CMake | ||
| 29 | |||
| 30 | Upstream-Status: Backport [https://github.com/opencv/opencv/commit/6e4280ea81b59c6dca45bb9801b758377beead55] | ||
| 7 | --- | 31 | --- |
| 8 | cmake/OpenCVFindProtobuf.cmake | 37 ++++++++++++++++++++++++++++++++++ | 32 | cmake/OpenCVFindProtobuf.cmake | 35 +++++++++++++++++++++++++++----- |
| 9 | modules/dnn/CMakeLists.txt | 9 +++++++++ | 33 | modules/dnn/CMakeLists.txt | 6 ++++++ |
| 10 | 2 files changed, 46 insertions(+) | 34 | modules/dnn/test/test_layers.cpp | 24 ++++++++++++++++++---- |
| 35 | 3 files changed, 56 insertions(+), 9 deletions(-) | ||
| 11 | 36 | ||
| 12 | diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake | 37 | diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake |
| 13 | index 8835347d1d..9bd5c28db8 100644 | 38 | index 8835347d1d..5b1e17529f 100644 |
| 14 | --- a/cmake/OpenCVFindProtobuf.cmake | 39 | --- a/cmake/OpenCVFindProtobuf.cmake |
| 15 | +++ b/cmake/OpenCVFindProtobuf.cmake | 40 | +++ b/cmake/OpenCVFindProtobuf.cmake |
| 16 | @@ -67,6 +67,38 @@ else() | 41 | @@ -30,8 +30,14 @@ if(BUILD_PROTOBUF) |
| 42 | set(Protobuf_LIBRARIES "libprotobuf") | ||
| 43 | set(HAVE_PROTOBUF TRUE) | ||
| 44 | else() | ||
| 45 | + # we still need this for command PROTOBUF_GENERATE_CPP. | ||
| 46 | + set(protobuf_MODULE_COMPATIBLE ON) | ||
| 47 | + | ||
| 48 | unset(Protobuf_VERSION CACHE) | ||
| 49 | - find_package(Protobuf QUIET) | ||
| 50 | + find_package(Protobuf QUIET CONFIG) | ||
| 51 | + if(NOT Protobuf_FOUND) | ||
| 52 | + find_package(Protobuf QUIET) | ||
| 53 | + endif() | ||
| 54 | |||
| 55 | # Backwards compatibility | ||
| 56 | # Define camel case versions of input variables | ||
| 57 | @@ -67,6 +73,20 @@ else() | ||
| 17 | endif() | 58 | endif() |
| 18 | endif() | 59 | endif() |
| 19 | 60 | ||
| @@ -21,82 +62,49 @@ index 8835347d1d..9bd5c28db8 100644 | |||
| 21 | +# In Protocol Buffers v22.0 and later drops C++11 support and depends abseil-cpp. | 62 | +# In Protocol Buffers v22.0 and later drops C++11 support and depends abseil-cpp. |
| 22 | +# Details: https://protobuf.dev/news/2022-08-03/ | 63 | +# Details: https://protobuf.dev/news/2022-08-03/ |
| 23 | +# And if std::text_view is in abseil-cpp requests C++17 and later. | 64 | +# And if std::text_view is in abseil-cpp requests C++17 and later. |
| 24 | +if(HAVE_PROTOBUF) | ||
| 25 | + if("${Protobuf_VERSION}" MATCHES [[[0-9]+.([0-9]+).[0-9]+]]) | ||
| 26 | + string(COMPARE GREATER_EQUAL "${CMAKE_MATCH_1}" "22" REQUEST_ABSL) | ||
| 27 | + | ||
| 28 | + if(REQUEST_ABSL) | ||
| 29 | + string(COMPARE GREATER_EQUAL "${CMAKE_CXX_STANDARD}" "17" USED_AFTER_CXX17) | ||
| 30 | + if(NOT USED_AFTER_CXX17) | ||
| 31 | + message("CMAKE_CXX_STANDARD : ${CMAKE_CXX_STANDARD}") | ||
| 32 | + message("protobuf : ${Protobuf_VERSION}") | ||
| 33 | + message(FATAL_ERROR "protobuf(v22 and later) and abseil-cpp request CMAKE_CXX_STANDARD=17 and later.") | ||
| 34 | + endif() | ||
| 35 | + | ||
| 36 | + ocv_check_modules(ABSL_STRINGS absl_strings) | ||
| 37 | + if(NOT ABSL_STRINGS_FOUND) | ||
| 38 | + message(FATAL_ERROR "protobuf(v22 and later) requests abseil-cpp(strings), but missing.") | ||
| 39 | + endif() | ||
| 40 | + | 65 | + |
| 41 | + ocv_check_modules(ABSL_LOG absl_log) | 66 | +if(HAVE_PROTOBUF) |
| 42 | + if(NOT ABSL_LOG_FOUND) | 67 | + if(NOT (Protobuf_VERSION VERSION_LESS 22)) |
| 43 | + message(FATAL_ERROR "protobuf(v22 and later) requests abseil-cpp(log), but missing.") | 68 | + if((CMAKE_CXX_STANDARD EQUAL 98) OR (CMAKE_CXX_STANDARD LESS 17)) |
| 44 | + endif() | 69 | + message(STATUS "CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} is too old to support protobuf(${Protobuf_VERSION}) and/or abseil-cpp. Use C++17 or later. Turning HAVE_PROTOBUF off") |
| 45 | + | 70 | + set(HAVE_PROTOBUF FALSE) |
| 46 | + endif() | ||
| 47 | + else() | ||
| 48 | + message(FATAL_ERROR "Protobuf version(${Protobuf_VERSION}) is unexpected to split.") | ||
| 49 | + endif() | 71 | + endif() |
| 72 | + endif() | ||
| 50 | +endif() | 73 | +endif() |
| 51 | + | 74 | + |
| 52 | if(HAVE_PROTOBUF AND PROTOBUF_UPDATE_FILES AND NOT COMMAND PROTOBUF_GENERATE_CPP) | 75 | if(HAVE_PROTOBUF AND PROTOBUF_UPDATE_FILES AND NOT COMMAND PROTOBUF_GENERATE_CPP) |
| 53 | message(FATAL_ERROR "Can't configure protobuf dependency (BUILD_PROTOBUF=${BUILD_PROTOBUF} PROTOBUF_UPDATE_FILES=${PROTOBUF_UPDATE_FILES})") | 76 | message(FATAL_ERROR "Can't configure protobuf dependency (BUILD_PROTOBUF=${BUILD_PROTOBUF} PROTOBUF_UPDATE_FILES=${PROTOBUF_UPDATE_FILES})") |
| 54 | endif() | 77 | endif() |
| 55 | @@ -89,3 +121,8 @@ if(HAVE_PROTOBUF) | 78 | @@ -74,15 +94,20 @@ endif() |
| 56 | BUILD_PROTOBUF THEN "build (${Protobuf_VERSION})" | 79 | if(HAVE_PROTOBUF) |
| 57 | ELSE "${__location} (${Protobuf_VERSION})") | 80 | list(APPEND CUSTOM_STATUS protobuf) |
| 58 | endif() | 81 | if(NOT BUILD_PROTOBUF) |
| 59 | + | 82 | + unset( __location) |
| 60 | +if(HAVE_ABSL_STRINGS AND HAVE_ABSL_LOG) | 83 | if(TARGET "${Protobuf_LIBRARIES}") |
| 61 | + list(APPEND CUSTOM_STATUS absl) | 84 | get_target_property(__location "${Protobuf_LIBRARIES}" IMPORTED_LOCATION_RELEASE) |
| 62 | + list(APPEND CUSTOM_STATUS_absl " abseil-cpp:" "YES (${ABSL_STRINGS_VERSION})" ) | 85 | if(NOT __location) |
| 63 | +endif() | 86 | get_target_property(__location "${Protobuf_LIBRARIES}" IMPORTED_LOCATION) |
| 64 | diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt | 87 | endif() |
| 65 | index 804b78ead2..d32007b37e 100644 | 88 | - elseif(Protobuf_LIBRARY) |
| 66 | --- a/modules/dnn/CMakeLists.txt | 89 | - set(__location "${Protobuf_LIBRARY}") |
| 67 | +++ b/modules/dnn/CMakeLists.txt | 90 | - else() |
| 68 | @@ -149,6 +149,15 @@ if(NOT BUILD_PROTOBUF) | 91 | - set(__location "${Protobuf_LIBRARIES}") |
| 69 | list(APPEND include_dirs ${Protobuf_INCLUDE_DIRS}) | 92 | + endif() |
| 70 | endif() | ||
| 71 | |||
| 72 | +if(HAVE_ABSL_STRINGS) | ||
| 73 | + list(APPEND libs ${ABSL_STRINGS_LIBRARIES}) | ||
| 74 | + list(APPEND include_dirs ${ABSL_STRTRINGS_INCLUDE_DIRS}) | ||
| 75 | +endif() | ||
| 76 | +if(HAVE_ABSL_LOG) | ||
| 77 | + list(APPEND libs ${ABSL_LOG_LIBRARIES}) | ||
| 78 | + list(APPEND include_dirs ${ABSL_LOG_INCLUDE_DIRS}) | ||
| 79 | +endif() | ||
| 80 | + | 93 | + |
| 81 | set(sources_options "") | 94 | + if(NOT __location) |
| 82 | 95 | + if(Protobuf_LIBRARY) | |
| 83 | list(APPEND libs ${LAPACK_LIBRARIES}) | 96 | + set(__location "${Protobuf_LIBRARY}") |
| 84 | From 06a7669521d205f647d3e718322ccd153cdbbb77 Mon Sep 17 00:00:00 2001 | 97 | + else() |
| 85 | From: Kumataro <Kumataro@users.noreply.github.com> | 98 | + set(__location "${Protobuf_LIBRARIES}") |
| 86 | Date: Sun, 8 Oct 2023 09:39:35 +0900 | 99 | + endif() |
| 87 | Subject: [PATCH] dnn: disable some tests for external protobuf | 100 | endif() |
| 88 | 101 | endif() | |
| 89 | --- | 102 | list(APPEND CUSTOM_STATUS_protobuf " Protobuf:" |
| 90 | modules/dnn/CMakeLists.txt | 5 +++++ | ||
| 91 | modules/dnn/src/caffe/caffe_io.cpp | 24 ++++++++++++++++++++++-- | ||
| 92 | modules/dnn/test/test_layers.cpp | 16 ++++++++++++++++ | ||
| 93 | 3 files changed, 43 insertions(+), 2 deletions(-) | ||
| 94 | |||
| 95 | diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt | 103 | diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt |
| 96 | index d32007b37e..face38465f 100644 | 104 | index 804b78ead2..9fcc460909 100644 |
| 97 | --- a/modules/dnn/CMakeLists.txt | 105 | --- a/modules/dnn/CMakeLists.txt |
| 98 | +++ b/modules/dnn/CMakeLists.txt | 106 | +++ b/modules/dnn/CMakeLists.txt |
| 99 | @@ -254,6 +254,12 @@ ocv_create_module(${libs} ${dnn_runtime_libs}) | 107 | @@ -245,6 +245,12 @@ ocv_create_module(${libs} ${dnn_runtime_libs}) |
| 100 | ocv_add_samples() | 108 | ocv_add_samples() |
| 101 | ocv_add_accuracy_tests(${dnn_runtime_libs}) | 109 | ocv_add_accuracy_tests(${dnn_runtime_libs}) |
| 102 | 110 | ||
| @@ -109,211 +117,13 @@ index d32007b37e..face38465f 100644 | |||
| 109 | set(perf_path "${CMAKE_CURRENT_LIST_DIR}/perf") | 117 | set(perf_path "${CMAKE_CURRENT_LIST_DIR}/perf") |
| 110 | file(GLOB_RECURSE perf_srcs "${perf_path}/*.cpp") | 118 | file(GLOB_RECURSE perf_srcs "${perf_path}/*.cpp") |
| 111 | file(GLOB_RECURSE perf_hdrs "${perf_path}/*.hpp" "${perf_path}/*.h") | 119 | file(GLOB_RECURSE perf_hdrs "${perf_path}/*.hpp" "${perf_path}/*.h") |
| 112 | |||
| 113 | diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp | ||
| 114 | index ebecf95eea..ebceca84cf 100644 | ||
| 115 | --- a/modules/dnn/src/caffe/caffe_io.cpp | ||
| 116 | +++ b/modules/dnn/src/caffe/caffe_io.cpp | ||
| 117 | @@ -1130,7 +1130,17 @@ bool ReadProtoFromTextFile(const char* filename, Message* proto) { | ||
| 118 | parser.AllowUnknownField(true); | ||
| 119 | parser.SetRecursionLimit(1000); | ||
| 120 | #endif | ||
| 121 | - return parser.Parse(&input, proto); | ||
| 122 | + const bool ret = parser.Parse(&input, proto); | ||
| 123 | + | ||
| 124 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
| 125 | + if(!ret) | ||
| 126 | + { | ||
| 127 | + LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; | ||
| 128 | + CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); | ||
| 129 | + } | ||
| 130 | +#endif | ||
| 131 | + | ||
| 132 | + return ret; | ||
| 133 | } | ||
| 134 | |||
| 135 | bool ReadProtoFromBinaryFile(const char* filename, Message* proto) { | ||
| 136 | @@ -1148,7 +1158,17 @@ bool ReadProtoFromTextBuffer(const char* data, size_t len, Message* proto) { | ||
| 137 | parser.AllowUnknownField(true); | ||
| 138 | parser.SetRecursionLimit(1000); | ||
| 139 | #endif | ||
| 140 | - return parser.Parse(&input, proto); | ||
| 141 | + const bool ret = parser.Parse(&input, proto); | ||
| 142 | + | ||
| 143 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
| 144 | + if(!ret) | ||
| 145 | + { | ||
| 146 | + LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; | ||
| 147 | + CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); | ||
| 148 | + } | ||
| 149 | +#endif | ||
| 150 | + | ||
| 151 | + return ret; | ||
| 152 | } | ||
| 153 | |||
| 154 | |||
| 155 | diff --git a/modules/dnn/test/test_layers.cpp b/modules/dnn/test/test_layers.cpp | 120 | diff --git a/modules/dnn/test/test_layers.cpp b/modules/dnn/test/test_layers.cpp |
| 156 | index 763d94b99c..a07d442d76 100644 | 121 | index 763d94b99c..6cb6d54b3f 100644 |
| 157 | --- a/modules/dnn/test/test_layers.cpp | 122 | --- a/modules/dnn/test/test_layers.cpp |
| 158 | +++ b/modules/dnn/test/test_layers.cpp | 123 | +++ b/modules/dnn/test/test_layers.cpp |
| 159 | @@ -754,7 +754,11 @@ TEST_F(Layer_RNN_Test, get_set_test) | 124 | @@ -756,11 +756,15 @@ TEST_F(Layer_RNN_Test, get_set_test) |
| 160 | EXPECT_EQ(shape(outputs[1]), shape(nT, nS, nH)); | ||
| 161 | } | ||
| 162 | 125 | ||
| 163 | +#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
| 164 | TEST_P(Test_Caffe_layers, Accum) | 126 | TEST_P(Test_Caffe_layers, Accum) |
| 165 | +#else | ||
| 166 | +TEST_P(Test_Caffe_layers, DISABLED_Accum) // requires patched protobuf (available in OpenCV source tree only) | ||
| 167 | +#endif | ||
| 168 | { | ||
| 169 | if (backend == DNN_BACKEND_OPENCV && target != DNN_TARGET_CPU) | ||
| 170 | applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL, CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); | ||
| 171 | @@ -778,7 +782,11 @@ TEST_P(Test_Caffe_layers, ChannelNorm) | ||
| 172 | testLayerUsingCaffeModels("channel_norm", false, false); | ||
| 173 | } | ||
| 174 | |||
| 175 | +#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
| 176 | TEST_P(Test_Caffe_layers, DataAugmentation) | ||
| 177 | +#else | ||
| 178 | +TEST_P(Test_Caffe_layers, DISABLED_DataAugmentation) // requires patched protobuf (available in OpenCV source tree only) | ||
| 179 | +#endif | ||
| 180 | { | ||
| 181 | if (backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16) | ||
| 182 | applyTestTag(CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); | ||
| 183 | @@ -787,7 +795,11 @@ TEST_P(Test_Caffe_layers, DataAugmentation) | ||
| 184 | testLayerUsingCaffeModels("data_augmentation_8x6", true, false); | ||
| 185 | } | ||
| 186 | |||
| 187 | +#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
| 188 | TEST_P(Test_Caffe_layers, Resample) | ||
| 189 | +#else | ||
| 190 | +TEST_P(Test_Caffe_layers, DISABLED_Resample) // requires patched protobuf (available in OpenCV source tree only) | ||
| 191 | +#endif | ||
| 192 | { | ||
| 193 | if (backend != DNN_BACKEND_OPENCV) | ||
| 194 | applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH); | ||
| 195 | @@ -795,7 +807,11 @@ TEST_P(Test_Caffe_layers, Resample) | ||
| 196 | testLayerUsingCaffeModels("nearest", false, false); | ||
| 197 | } | ||
| 198 | |||
| 199 | +#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
| 200 | TEST_P(Test_Caffe_layers, Correlation) | ||
| 201 | +#else | ||
| 202 | +TEST_P(Test_Caffe_layers, DISABLED_Correlation) // requires patched protobuf (available in OpenCV source tree only) | ||
| 203 | +#endif | ||
| 204 | { | ||
| 205 | if (backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16) | ||
| 206 | applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, | ||
| 207 | From 2c33798f41942aefc203183d673ce4846f32dba4 Mon Sep 17 00:00:00 2001 | ||
| 208 | From: Kumataro <Kumataro@users.noreply.github.com> | ||
| 209 | Date: Sun, 8 Oct 2023 13:28:40 +0900 | ||
| 210 | Subject: [PATCH] use GREATER instead of GREATER_EQUAL and remove new blank | ||
| 211 | line at EOF | ||
| 212 | |||
| 213 | --- | ||
| 214 | cmake/OpenCVFindProtobuf.cmake | 6 ++++-- | ||
| 215 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
| 216 | |||
| 217 | diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake | ||
| 218 | index 9bd5c28db8..ba147526d6 100644 | ||
| 219 | --- a/cmake/OpenCVFindProtobuf.cmake | ||
| 220 | +++ b/cmake/OpenCVFindProtobuf.cmake | ||
| 221 | @@ -71,12 +71,14 @@ endif() | ||
| 222 | # In Protocol Buffers v22.0 and later drops C++11 support and depends abseil-cpp. | ||
| 223 | # Details: https://protobuf.dev/news/2022-08-03/ | ||
| 224 | # And if std::text_view is in abseil-cpp requests C++17 and later. | ||
| 225 | + | ||
| 226 | if(HAVE_PROTOBUF) | ||
| 227 | if("${Protobuf_VERSION}" MATCHES [[[0-9]+.([0-9]+).[0-9]+]]) | ||
| 228 | - string(COMPARE GREATER_EQUAL "${CMAKE_MATCH_1}" "22" REQUEST_ABSL) | ||
| 229 | + string(COMPARE GREATER "${CMAKE_MATCH_1}" "21" REQUEST_ABSL) # >=22 | ||
| 230 | |||
| 231 | if(REQUEST_ABSL) | ||
| 232 | - string(COMPARE GREATER_EQUAL "${CMAKE_CXX_STANDARD}" "17" USED_AFTER_CXX17) | ||
| 233 | + string(COMPARE GREATER "${CMAKE_CXX_STANDARD}" "16" USED_AFTER_CXX17) # >=17 | ||
| 234 | + | ||
| 235 | if(NOT USED_AFTER_CXX17) | ||
| 236 | message("CMAKE_CXX_STANDARD : ${CMAKE_CXX_STANDARD}") | ||
| 237 | message("protobuf : ${Protobuf_VERSION}") | ||
| 238 | From cd709eefbeedd116bf3495b42280323b932791ff Mon Sep 17 00:00:00 2001 | ||
| 239 | From: Kumataro <Kumataro@users.noreply.github.com> | ||
| 240 | Date: Mon, 9 Oct 2023 21:51:04 +0900 | ||
| 241 | Subject: [PATCH] fix for review | ||
| 242 | |||
| 243 | --- | ||
| 244 | cmake/OpenCVFindProtobuf.cmake | 5 ---- | ||
| 245 | modules/dnn/src/caffe/caffe_io.cpp | 24 ++---------------- | ||
| 246 | modules/dnn/test/test_layers.cpp | 40 +++++++++++++++--------------- | ||
| 247 | 3 files changed, 22 insertions(+), 47 deletions(-) | ||
| 248 | |||
| 249 | diff --git a/cmake/OpenCVFindProtobuf.cmake b/cmake/OpenCVFindProtobuf.cmake | ||
| 250 | index ba147526d6..2faf1010bf 100644 | ||
| 251 | --- a/cmake/OpenCVFindProtobuf.cmake | ||
| 252 | +++ b/cmake/OpenCVFindProtobuf.cmake | ||
| 253 | @@ -123,8 +123,3 @@ if(HAVE_PROTOBUF) | ||
| 254 | BUILD_PROTOBUF THEN "build (${Protobuf_VERSION})" | ||
| 255 | ELSE "${__location} (${Protobuf_VERSION})") | ||
| 256 | endif() | ||
| 257 | - | ||
| 258 | -if(HAVE_ABSL_STRINGS AND HAVE_ABSL_LOG) | ||
| 259 | - list(APPEND CUSTOM_STATUS absl) | ||
| 260 | - list(APPEND CUSTOM_STATUS_absl " abseil-cpp:" "YES (${ABSL_STRINGS_VERSION})" ) | ||
| 261 | -endif() | ||
| 262 | diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp | ||
| 263 | index ebceca84cf..ebecf95eea 100644 | ||
| 264 | --- a/modules/dnn/src/caffe/caffe_io.cpp | ||
| 265 | +++ b/modules/dnn/src/caffe/caffe_io.cpp | ||
| 266 | @@ -1130,17 +1130,7 @@ bool ReadProtoFromTextFile(const char* filename, Message* proto) { | ||
| 267 | parser.AllowUnknownField(true); | ||
| 268 | parser.SetRecursionLimit(1000); | ||
| 269 | #endif | ||
| 270 | - const bool ret = parser.Parse(&input, proto); | ||
| 271 | - | ||
| 272 | -#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
| 273 | - if(!ret) | ||
| 274 | - { | ||
| 275 | - LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; | ||
| 276 | - CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); | ||
| 277 | - } | ||
| 278 | -#endif | ||
| 279 | - | ||
| 280 | - return ret; | ||
| 281 | + return parser.Parse(&input, proto); | ||
| 282 | } | ||
| 283 | |||
| 284 | bool ReadProtoFromBinaryFile(const char* filename, Message* proto) { | ||
| 285 | @@ -1158,17 +1148,7 @@ bool ReadProtoFromTextBuffer(const char* data, size_t len, Message* proto) { | ||
| 286 | parser.AllowUnknownField(true); | ||
| 287 | parser.SetRecursionLimit(1000); | ||
| 288 | #endif | ||
| 289 | - const bool ret = parser.Parse(&input, proto); | ||
| 290 | - | ||
| 291 | -#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
| 292 | - if(!ret) | ||
| 293 | - { | ||
| 294 | - LOG(ERROR) << "Some data requires patched protobuf (available in OpenCV source tree only)."; | ||
| 295 | - CV_Error_(Error::StsError,("Some data requires patched protobuf (available in OpenCV source tree only).")); | ||
| 296 | - } | ||
| 297 | -#endif | ||
| 298 | - | ||
| 299 | - return ret; | ||
| 300 | + return parser.Parse(&input, proto); | ||
| 301 | } | ||
| 302 | |||
| 303 | |||
| 304 | diff --git a/modules/dnn/test/test_layers.cpp b/modules/dnn/test/test_layers.cpp | ||
| 305 | index a07d442d76..5c6fc541d7 100644 | ||
| 306 | --- a/modules/dnn/test/test_layers.cpp | ||
| 307 | +++ b/modules/dnn/test/test_layers.cpp | ||
| 308 | @@ -754,17 +754,17 @@ TEST_F(Layer_RNN_Test, get_set_test) | ||
| 309 | EXPECT_EQ(shape(outputs[1]), shape(nT, nS, nH)); | ||
| 310 | } | ||
| 311 | |||
| 312 | -#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
| 313 | TEST_P(Test_Caffe_layers, Accum) | ||
| 314 | -#else | ||
| 315 | -TEST_P(Test_Caffe_layers, DISABLED_Accum) // requires patched protobuf (available in OpenCV source tree only) | ||
| 316 | -#endif | ||
| 317 | { | 127 | { |
| 318 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | 128 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF |
| 319 | + throw SkipTestException("Requires patched protobuf"); | 129 | + throw SkipTestException("Requires patched protobuf"); |
| @@ -327,15 +137,9 @@ index a07d442d76..5c6fc541d7 100644 | |||
| 327 | } | 137 | } |
| 328 | 138 | ||
| 329 | TEST_P(Test_Caffe_layers, FlowWarp) | 139 | TEST_P(Test_Caffe_layers, FlowWarp) |
| 330 | @@ -782,42 +782,42 @@ TEST_P(Test_Caffe_layers, ChannelNorm) | 140 | @@ -780,27 +784,39 @@ TEST_P(Test_Caffe_layers, ChannelNorm) |
| 331 | testLayerUsingCaffeModels("channel_norm", false, false); | ||
| 332 | } | ||
| 333 | 141 | ||
| 334 | -#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
| 335 | TEST_P(Test_Caffe_layers, DataAugmentation) | 142 | TEST_P(Test_Caffe_layers, DataAugmentation) |
| 336 | -#else | ||
| 337 | -TEST_P(Test_Caffe_layers, DISABLED_DataAugmentation) // requires patched protobuf (available in OpenCV source tree only) | ||
| 338 | -#endif | ||
| 339 | { | 143 | { |
| 340 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | 144 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF |
| 341 | + throw SkipTestException("Requires patched protobuf"); | 145 | + throw SkipTestException("Requires patched protobuf"); |
| @@ -348,11 +152,7 @@ index a07d442d76..5c6fc541d7 100644 | |||
| 348 | +#endif | 152 | +#endif |
| 349 | } | 153 | } |
| 350 | 154 | ||
| 351 | -#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
| 352 | TEST_P(Test_Caffe_layers, Resample) | 155 | TEST_P(Test_Caffe_layers, Resample) |
| 353 | -#else | ||
| 354 | -TEST_P(Test_Caffe_layers, DISABLED_Resample) // requires patched protobuf (available in OpenCV source tree only) | ||
| 355 | -#endif | ||
| 356 | { | 156 | { |
| 357 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | 157 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF |
| 358 | + throw SkipTestException("Requires patched protobuf"); | 158 | + throw SkipTestException("Requires patched protobuf"); |
| @@ -364,11 +164,7 @@ index a07d442d76..5c6fc541d7 100644 | |||
| 364 | +#endif | 164 | +#endif |
| 365 | } | 165 | } |
| 366 | 166 | ||
| 367 | -#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF | ||
| 368 | TEST_P(Test_Caffe_layers, Correlation) | 167 | TEST_P(Test_Caffe_layers, Correlation) |
| 369 | -#else | ||
| 370 | -TEST_P(Test_Caffe_layers, DISABLED_Correlation) // requires patched protobuf (available in OpenCV source tree only) | ||
| 371 | -#endif | ||
| 372 | { | 168 | { |
| 373 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | 169 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF |
| 374 | + throw SkipTestException("Requires patched protobuf"); | 170 | + throw SkipTestException("Requires patched protobuf"); |
| @@ -377,12 +173,11 @@ index a07d442d76..5c6fc541d7 100644 | |||
| 377 | applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, | 173 | applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER, |
| 378 | CV_TEST_TAG_DNN_SKIP_OPENCL, CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); | 174 | CV_TEST_TAG_DNN_SKIP_OPENCL, CV_TEST_TAG_DNN_SKIP_OPENCL_FP16); |
| 379 | testLayerUsingCaffeModels("correlation", false, false, 0.0, 0.0, 2); | 175 | testLayerUsingCaffeModels("correlation", false, false, 0.0, 0.0, 2); |
| 380 | } | ||
| 381 | +#endif | 176 | +#endif |
| 177 | } | ||
| 382 | 178 | ||
| 383 | TEST_P(Test_Caffe_layers, Convolution2Inputs) | 179 | TEST_P(Test_Caffe_layers, Convolution2Inputs) |
| 384 | { | 180 | @@ -1641,12 +1657,11 @@ private: |
| 385 | @@ -1644,12 +1644,11 @@ private: | ||
| 386 | int outWidth, outHeight, zoomFactor; | 181 | int outWidth, outHeight, zoomFactor; |
| 387 | }; | 182 | }; |
| 388 | 183 | ||
| @@ -395,10 +190,10 @@ index a07d442d76..5c6fc541d7 100644 | |||
| 395 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF | 190 | +#ifdef OPENCV_DNN_EXTERNAL_PROTOBUF |
| 396 | + throw SkipTestException("Requires patched protobuf"); | 191 | + throw SkipTestException("Requires patched protobuf"); |
| 397 | +#else | 192 | +#else |
| 398 | #if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2022010000) | 193 | #if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2021030000) |
| 399 | // Cannot get memory! | 194 | if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target == DNN_TARGET_MYRIAD) |
| 400 | if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target == DNN_TARGET_CPU) | 195 | applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH); // exception |
| 401 | @@ -1686,6 +1685,7 @@ TEST_P(Test_Caffe_layers, DISABLED_Interp) // requires patched protobuf (availa | 196 | @@ -1670,6 +1685,7 @@ TEST_P(Test_Caffe_layers, DISABLED_Interp) // requires patched protobuf (availa |
| 402 | 197 | ||
| 403 | // Test an implemented layer. | 198 | // Test an implemented layer. |
| 404 | testLayerUsingCaffeModels("layer_interp", false, false); | 199 | testLayerUsingCaffeModels("layer_interp", false, false); |
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.13.0.imx.bb index 4b5786309..ff6982d2f 100644 --- a/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv_4.6.0.imx.bb +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/opencv_4.13.0.imx.bb | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | # This recipe is for the i.MX fork of opencv. For ease of | 1 | # This recipe is modified for i.MX. |
| 2 | # maintenance, the top section is a verbatim copy of an OE-core | 2 | # For ease of maintenance, the top section is a verbatim copy |
| 3 | # recipe. The second section customizes the recipe for i.MX. | 3 | # of an OE-core recipe, and the second section customizes the |
| 4 | # recipe for i.MX. | ||
| 4 | 5 | ||
| 5 | ########## meta-openembedded copy ########### | 6 | ########## meta-openembedded copy ########### |
| 6 | # Upstream hash: 72dc42966be7da07f9553f75b825123b81704f0b | 7 | # Upstream hash: 9b77eae6988e98adbec5323d2491afc6b327c91a |
| 7 | # Commit https://github.com/openembedded/meta-openembedded/commit/225ce6a14a8110ab6b573b4dc9f5297a03d17e0f added | ||
| 8 | 8 | ||
| 9 | SUMMARY = "Opencv : The Open Computer Vision Library" | 9 | SUMMARY = "Opencv : The Open Computer Vision Library" |
| 10 | HOMEPAGE = "http://opencv.org/" | 10 | HOMEPAGE = "http://opencv.org/" |
| @@ -18,58 +18,39 @@ ARM_INSTRUCTION_SET:armv5 = "arm" | |||
| 18 | 18 | ||
| 19 | DEPENDS = "bzip2 glib-2.0 libtool libwebp swig-native zlib" | 19 | DEPENDS = "bzip2 glib-2.0 libtool libwebp swig-native zlib" |
| 20 | 20 | ||
| 21 | SRCREV_opencv = "b0dc474160e389b9c9045da5db49d03ae17c6a6b" | 21 | SRCREV_opencv = "fe38fc608f6acb8b68953438a62305d8318f4fcd" |
| 22 | SRCREV_contrib = "7b77c355a8fdc97667b3fa1e7a0d37e4973fc868" | 22 | SRCREV_contrib = "d99ad2a188210cc35067c2e60076eed7c2442bc3" |
| 23 | SRCREV_ipp = "a56b6ac6f030c312b2dce17430eef13aed9af274" | ||
| 24 | SRCREV_boostdesc = "34e4206aef44d50e6bbcd0ab06354b52e7466d26" | 23 | SRCREV_boostdesc = "34e4206aef44d50e6bbcd0ab06354b52e7466d26" |
| 25 | SRCREV_vgg = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d" | 24 | SRCREV_vgg = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d" |
| 26 | SRCREV_face = "8afa57abc8229d611c4937165d20e2a2d9fc5a12" | 25 | SRCREV_face = "8afa57abc8229d611c4937165d20e2a2d9fc5a12" |
| 27 | SRCREV_wechat-qrcode = "a8b69ccc738421293254aec5ddb38bd523503252" | 26 | SRCREV_wechat-qrcode = "a8b69ccc738421293254aec5ddb38bd523503252" |
| 27 | SRCREV_fastcv = "9e8d42b6d7e769548d70b2e5674e263b056de8b4" | ||
| 28 | # kleidicv must match version of OpenCV | ||
| 29 | SRCREV_kleidicv = "1e8fe7008c2292657b9689d70ea5d30db0e57767" | ||
| 28 | 30 | ||
| 29 | def ipp_filename(d): | 31 | SRCREV_FORMAT = "opencv_contrib_ipp_boostdesc_vgg_fastcv_kleidicv" |
| 30 | import re | 32 | SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=4.x;protocol=https;tag=${PV} \ |
| 31 | arch = d.getVar('TARGET_ARCH') | 33 | git://github.com/opencv/opencv_contrib.git;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/contrib;name=contrib;branch=4.x;protocol=https;tag=${PV} \ |
| 32 | if re.match("i.86$", arch): | ||
| 33 | return "ippicv_2020_lnx_ia32_20191018_general.tgz" | ||
| 34 | else: | ||
| 35 | return "ippicv_2020_lnx_intel64_20191018_general.tgz" | ||
| 36 | |||
| 37 | def ipp_md5sum(d): | ||
| 38 | import re | ||
| 39 | arch = d.getVar('TARGET_ARCH') | ||
| 40 | if re.match("i.86$", arch): | ||
| 41 | return "ad189a940fb60eb71f291321322fe3e8" | ||
| 42 | else: | ||
| 43 | return "7421de0095c7a39162ae13a6098782f9" | ||
| 44 | |||
| 45 | IPP_FILENAME = "${@ipp_filename(d)}" | ||
| 46 | IPP_MD5 = "${@ipp_md5sum(d)}" | ||
| 47 | |||
| 48 | SRCREV_FORMAT = "opencv_contrib_ipp_boostdesc_vgg" | ||
| 49 | SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=master;protocol=https \ | ||
| 50 | git://github.com/opencv/opencv_contrib.git;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/contrib;name=contrib;branch=master;protocol=https \ | ||
| 51 | git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20191018;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/ipp;name=ipp;protocol=https \ | ||
| 52 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/boostdesc;name=boostdesc;protocol=https \ | 34 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/boostdesc;name=boostdesc;protocol=https \ |
| 53 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/vgg;name=vgg;protocol=https \ | 35 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/vgg;name=vgg;protocol=https \ |
| 54 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/face;name=face;protocol=https \ | 36 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/face;name=face;protocol=https \ |
| 55 | git://github.com/WeChatCV/opencv_3rdparty.git;branch=wechat_qrcode;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/wechat_qrcode;name=wechat-qrcode;protocol=https \ | 37 | git://github.com/WeChatCV/opencv_3rdparty.git;branch=wechat_qrcode;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/wechat_qrcode;name=wechat-qrcode;protocol=https \ |
| 56 | file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \ | 38 | git://github.com/opencv/opencv_3rdparty.git;branch=fastcv/4.x_20250715;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/fastcv;name=fastcv;protocol=https \ |
| 57 | file://0003-To-fix-errors-as-following.patch \ | 39 | file://0003-To-fix-errors-as-following.patch \ |
| 58 | file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \ | 40 | file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \ |
| 59 | file://0001-Dont-use-isystem.patch \ | 41 | file://0001-Dont-use-isystem.patch \ |
| 60 | file://download.patch \ | 42 | file://download.patch \ |
| 61 | file://0001-Make-ts-module-external.patch \ | 43 | file://0001-Make-ts-module-external.patch \ |
| 62 | file://0001-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch \ | 44 | file://0008-Do-not-embed-build-directory-in-binaries.patch \ |
| 63 | file://fix-build-with-protobuf-v22.patch \ | ||
| 64 | " | 45 | " |
| 65 | SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=contrib" | 46 | SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=contrib" |
| 47 | SRC_URI:append:aarch64 = " git://gitlab.arm.com/kleidi/kleidicv;branch=main;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/3rdparty/kleidicv;name=kleidicv;protocol=https" | ||
| 66 | 48 | ||
| 67 | # OpenCV wants to download more files during configure. We download these in | 49 | # OpenCV wants to download more files during configure. We download these in |
| 68 | # do_fetch and construct a source cache in the format it expects | 50 | # do_fetch and construct a source cache in the format it expects |
| 69 | OPENCV_DLDIR = "${UNPACKDIR}/downloads" | 51 | OPENCV_DLDIR = "${WORKDIR}/downloads" |
| 70 | 52 | ||
| 71 | do_unpack_extra() { | 53 | do_unpack_extra() { |
| 72 | tar xzf ${S}/ipp/ippicv/${IPP_FILENAME} -C ${S} | ||
| 73 | 54 | ||
| 74 | md5() { | 55 | md5() { |
| 75 | # Return the MD5 of $1 | 56 | # Return the MD5 of $1 |
| @@ -89,6 +70,7 @@ do_unpack_extra() { | |||
| 89 | cache data ${S}/face/*.dat | 70 | cache data ${S}/face/*.dat |
| 90 | cache wechat_qrcode ${S}/wechat_qrcode/*.caffemodel | 71 | cache wechat_qrcode ${S}/wechat_qrcode/*.caffemodel |
| 91 | cache wechat_qrcode ${S}/wechat_qrcode/*.prototxt | 72 | cache wechat_qrcode ${S}/wechat_qrcode/*.prototxt |
| 73 | cache fastcv ${S}/fastcv/fastcv/*.tgz | ||
| 92 | } | 74 | } |
| 93 | addtask unpack_extra after do_unpack before do_patch | 75 | addtask unpack_extra after do_unpack before do_patch |
| 94 | 76 | ||
| @@ -98,8 +80,7 @@ EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${S}/contrib/modules \ | |||
| 98 | -DWITH_1394=OFF \ | 80 | -DWITH_1394=OFF \ |
| 99 | -DENABLE_PRECOMPILED_HEADERS=OFF \ | 81 | -DENABLE_PRECOMPILED_HEADERS=OFF \ |
| 100 | -DCMAKE_SKIP_RPATH=ON \ | 82 | -DCMAKE_SKIP_RPATH=ON \ |
| 101 | -DOPENCV_ICV_HASH=${IPP_MD5} \ | 83 | -DWITH_IPP=OFF \ |
| 102 | -DIPPROOT=${S}/ippicv_lnx \ | ||
| 103 | -DOPENCV_GENERATE_PKGCONFIG=ON \ | 84 | -DOPENCV_GENERATE_PKGCONFIG=ON \ |
| 104 | -DOPENCV_DOWNLOAD_PATH=${OPENCV_DLDIR} \ | 85 | -DOPENCV_DOWNLOAD_PATH=${OPENCV_DLDIR} \ |
| 105 | -DOPENCV_ALLOW_DOWNLOADS=OFF \ | 86 | -DOPENCV_ALLOW_DOWNLOADS=OFF \ |
| @@ -107,6 +88,7 @@ EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${S}/contrib/modules \ | |||
| 107 | ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \ | 88 | ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \ |
| 108 | ${@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)} \ | 89 | ${@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)} \ |
| 109 | " | 90 | " |
| 91 | |||
| 110 | LDFLAGS:append:mips = " -Wl,--no-as-needed -latomic -Wl,--as-needed" | 92 | LDFLAGS:append:mips = " -Wl,--no-as-needed -latomic -Wl,--as-needed" |
| 111 | LDFLAGS:append:riscv32 = " -Wl,--no-as-needed -latomic -Wl,--as-needed" | 93 | LDFLAGS:append:riscv32 = " -Wl,--no-as-needed -latomic -Wl,--as-needed" |
| 112 | 94 | ||
| @@ -115,8 +97,9 @@ EXTRA_OECMAKE:append:x86 = " -DX86=ON" | |||
| 115 | # https://github.com/opencv/opencv/issues/21597 | 97 | # https://github.com/opencv/opencv/issues/21597 |
| 116 | EXTRA_OECMAKE:remove:x86 = "-DENABLE_SSE41=1 -DENABLE_SSE42=1" | 98 | EXTRA_OECMAKE:remove:x86 = "-DENABLE_SSE41=1 -DENABLE_SSE42=1" |
| 117 | 99 | ||
| 118 | PACKAGECONFIG ??= "gapi python3 eigen jpeg png tiff v4l libv4l gstreamer samples tbb gphoto2 \ | 100 | PACKAGECONFIG ??= "python3 eigen jpeg png tiff v4l libv4l samples tbb \ |
| 119 | ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \ | 101 | ${@bb.utils.contains_any('DISTRO_FEATURES', '${GTK3DISTROFEATURES}', 'gtk', '', d)}" |
| 102 | PACKAGECONFIG:append:class-target = " gapi gstreamer gphoto2 \ | ||
| 120 | ${@bb.utils.contains_any("LICENSE_FLAGS_ACCEPTED", "commercial_ffmpeg commercial", "libav", "", d)}" | 103 | ${@bb.utils.contains_any("LICENSE_FLAGS_ACCEPTED", "commercial_ffmpeg commercial", "libav", "", d)}" |
| 121 | 104 | ||
| 122 | # TBB does not build for powerpc so disable that package config | 105 | # TBB does not build for powerpc so disable that package config |
| @@ -137,27 +120,24 @@ PACKAGECONFIG[gtk] = "-DWITH_GTK=ON,-DWITH_GTK=OFF,gtk+3," | |||
| 137 | PACKAGECONFIG[jasper] = "-DWITH_JASPER=ON,-DWITH_JASPER=OFF,jasper," | 120 | PACKAGECONFIG[jasper] = "-DWITH_JASPER=ON,-DWITH_JASPER=OFF,jasper," |
| 138 | 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," | 121 | 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," |
| 139 | PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON,-DWITH_JPEG=OFF,jpeg," | 122 | PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON,-DWITH_JPEG=OFF,jpeg," |
| 140 | PACKAGECONFIG[libav] = "-DWITH_FFMPEG=ON,-DWITH_FFMPEG=OFF,libav," | 123 | PACKAGECONFIG[libav] = "-DWITH_FFMPEG=ON,-DWITH_FFMPEG=OFF,ffmpeg," |
| 141 | PACKAGECONFIG[libv4l] = "-DWITH_LIBV4L=ON,-DWITH_LIBV4L=OFF,v4l-utils," | 124 | PACKAGECONFIG[libv4l] = "-DWITH_LIBV4L=ON,-DWITH_LIBV4L=OFF,v4l-utils," |
| 142 | PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,opencl-headers virtual/libopencl1," | 125 | PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,opencl-headers virtual/libopencl1," |
| 126 | PACKAGECONFIG[openvino] = "-DWITH_OPENVINO=ON,-DWITH_OPENVINO=OFF,openvino-inference-engine,openvino-inference-engine" | ||
| 143 | 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," | 127 | 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," |
| 144 | PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng," | 128 | PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng," |
| 145 | PACKAGECONFIG[python2] = "-DPYTHON2_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python-numpy," | 129 | PACKAGECONFIG[python3] = "-DPYTHON3_INCLUDE_PATH=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} -DPYTHON3_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/_core/include,,python3-numpy," |
| 146 | PACKAGECONFIG[python3] = "-DPYTHON3_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/_core/include,,python3-numpy," | 130 | PACKAGECONFIG[samples] = "-DBUILD_EXAMPLES=ON -DINSTALL_BIN_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON,-DBUILD_EXAMPLES=OFF,," |
| 147 | PACKAGECONFIG[samples] = "-DBUILD_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON,-DBUILD_EXAMPLES=OFF,," | ||
| 148 | PACKAGECONFIG[tbb] = "-DWITH_TBB=ON,-DWITH_TBB=OFF,tbb," | 131 | PACKAGECONFIG[tbb] = "-DWITH_TBB=ON,-DWITH_TBB=OFF,tbb," |
| 149 | PACKAGECONFIG[tests] = "-DBUILD_TESTS=ON,-DBUILD_TESTS=OFF,," | 132 | PACKAGECONFIG[tests] = "-DBUILD_TESTS=ON -DINSTALL_TESTS=ON,-DBUILD_TESTS=OFF,," |
| 150 | PACKAGECONFIG[text] = "-DBUILD_opencv_text=ON,-DBUILD_opencv_text=OFF,tesseract," | 133 | PACKAGECONFIG[text] = "-DBUILD_opencv_text=ON,-DBUILD_opencv_text=OFF,tesseract," |
| 151 | PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff," | 134 | PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff," |
| 152 | PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils," | 135 | PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils," |
| 136 | PACKAGECONFIG[fastcv] = "-DWITH_FASTCV=ON ,-DWITH_FASTCV=OFF,qcom-fastcv-binaries," | ||
| 153 | 137 | ||
| 154 | inherit pkgconfig cmake | 138 | inherit pkgconfig cmake setuptools3-base python3native |
| 155 | |||
| 156 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'setuptools3-base', '', d)} | ||
| 157 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'distutils-base', '', d)} | ||
| 158 | 139 | ||
| 159 | export PYTHON_CSPEC = "-I${STAGING_INCDIR}/${PYTHON_DIR}" | 140 | export PYTHON_CSPEC = "-I${STAGING_INCDIR}/${PYTHON_DIR}" |
| 160 | export PYTHON = "${STAGING_BINDIR_NATIVE}/${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3', 'python', d)}" | ||
| 161 | export ORACLE_JAVA_HOME = "${STAGING_DIR_NATIVE}/usr/bin/java" | 141 | export ORACLE_JAVA_HOME = "${STAGING_DIR_NATIVE}/usr/bin/java" |
| 162 | export JAVA_HOME = "${STAGING_DIR_NATIVE}/usr/lib/jvm/openjdk-8-native" | 142 | export JAVA_HOME = "${STAGING_DIR_NATIVE}/usr/lib/jvm/openjdk-8-native" |
| 163 | export ANT_DIR = "${STAGING_DIR_NATIVE}/usr/share/ant/" | 143 | export ANT_DIR = "${STAGING_DIR_NATIVE}/usr/share/ant/" |
| @@ -167,7 +147,6 @@ TARGET_CC_ARCH += "-I${S}/include " | |||
| 167 | PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'samples', '${PN}-samples', '', d)} \ | 147 | PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'samples', '${PN}-samples', '', d)} \ |
| 168 | ${@bb.utils.contains('PACKAGECONFIG', 'oracle-java', '${PN}-java', '', d)} \ | 148 | ${@bb.utils.contains('PACKAGECONFIG', 'oracle-java', '${PN}-java', '', d)} \ |
| 169 | ${@bb.utils.contains('PACKAGECONFIG', 'java', '${PN}-java', '', d)} \ | 149 | ${@bb.utils.contains('PACKAGECONFIG', 'java', '${PN}-java', '', d)} \ |
| 170 | ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'python-${BPN}', '', d)} \ | ||
| 171 | ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-${BPN}', '', d)} \ | 150 | ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-${BPN}', '', d)} \ |
| 172 | ${PN}-apps" | 151 | ${PN}-apps" |
| 173 | 152 | ||
| @@ -191,12 +170,17 @@ python populate_packages:prepend () { | |||
| 191 | 170 | ||
| 192 | metapkg = pn | 171 | metapkg = pn |
| 193 | d.setVar('ALLOW_EMPTY:' + metapkg, "1") | 172 | d.setVar('ALLOW_EMPTY:' + metapkg, "1") |
| 194 | blacklist = [ metapkg, "libopencv-ts" ] | 173 | blacklist = [ metapkg ] |
| 195 | metapkg_rdepends = [ ] | 174 | metapkg_rdepends = [ ] |
| 196 | for pkg in packages[1:]: | 175 | for pkg in packages[1:]: |
| 197 | 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'): | 176 | 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'): |
| 198 | metapkg_rdepends.append(pkg) | 177 | metapkg_rdepends.append(pkg) |
| 199 | d.setVar('RDEPENDS:' + metapkg, ' '.join(metapkg_rdepends)) | 178 | d.setVar('RDEPENDS:' + metapkg, ' '.join(metapkg_rdepends)) |
| 179 | |||
| 180 | fastcv_pkgs = ["libopencv-core", "libopencv-fastcv", "libopencv-imgproc"] | ||
| 181 | if bb.utils.contains('PACKAGECONFIG', 'fastcv', True, False, d): | ||
| 182 | for pkg in fastcv_pkgs: | ||
| 183 | d.appendVar('RDEPENDS:' + pkg, " qcom-fastcv-binaries") | ||
| 200 | } | 184 | } |
| 201 | 185 | ||
| 202 | PACKAGES_DYNAMIC += "^libopencv-.*" | 186 | PACKAGES_DYNAMIC += "^libopencv-.*" |
| @@ -214,10 +198,6 @@ INSANE_SKIP:${PN}-dbg = "libdir" | |||
| 214 | 198 | ||
| 215 | ALLOW_EMPTY:${PN} = "1" | 199 | ALLOW_EMPTY:${PN} = "1" |
| 216 | 200 | ||
| 217 | SUMMARY:python-opencv = "Python bindings to opencv" | ||
| 218 | FILES:python-opencv = "${PYTHON_SITEPACKAGES_DIR}/*" | ||
| 219 | RDEPENDS:python-opencv = "python-core python-numpy" | ||
| 220 | |||
| 221 | SUMMARY:python3-opencv = "Python bindings to opencv" | 201 | SUMMARY:python3-opencv = "Python bindings to opencv" |
| 222 | FILES:python3-opencv = "${PYTHON_SITEPACKAGES_DIR}/*" | 202 | FILES:python3-opencv = "${PYTHON_SITEPACKAGES_DIR}/*" |
| 223 | RDEPENDS:python3-opencv = "python3-core python3-numpy" | 203 | RDEPENDS:python3-opencv = "python3-core python3-numpy" |
| @@ -237,39 +217,69 @@ do_install:append() { | |||
| 237 | mv ${D}/usr/lib/* ${D}/${libdir}/ | 217 | mv ${D}/usr/lib/* ${D}/${libdir}/ |
| 238 | rm -rf ${D}/usr/lib | 218 | rm -rf ${D}/usr/lib |
| 239 | fi | 219 | fi |
| 220 | # remove setup_vars_opencv4.sh as its content is confusing and useless | ||
| 221 | if [ -f ${D}${bindir}/setup_vars_opencv4.sh ]; then | ||
| 222 | rm -rf ${D}${bindir}/setup_vars_opencv4.sh | ||
| 223 | fi | ||
| 224 | |||
| 225 | for fn in arithm.vsx3.cpp convert.vsx3.cpp; do | ||
| 226 | if [ -f ${B}/modules/core/$fn ]; then | ||
| 227 | sed -i -e 's,${S},/usr/src/debug/${PN}/${PV},g' ${B}/modules/core/$fn | ||
| 228 | fi | ||
| 229 | done | ||
| 230 | |||
| 231 | if [ -d ${D}/${bindir}/shape ]; then | ||
| 232 | # rename shape dir to avoid rootfs conflict with | ||
| 233 | # mesa-demos /usr/bin/shape file. | ||
| 234 | mv ${D}/${bindir}/shape ${D}/${bindir}/opencv_shape | ||
| 235 | fi | ||
| 236 | } | ||
| 237 | |||
| 238 | do_install:append:class-target() { | ||
| 240 | # remove build host path to improve reproducibility | 239 | # remove build host path to improve reproducibility |
| 241 | if [ -f ${D}${libdir}/cmake/opencv4/OpenCVModules.cmake ]; then | 240 | if [ -f ${D}${libdir}/cmake/opencv4/OpenCVModules.cmake ]; then |
| 242 | sed -e 's@${STAGING_DIR_HOST}@@g' \ | 241 | sed -e 's@${STAGING_DIR_HOST}@@g' \ |
| 243 | -i ${D}${libdir}/cmake/opencv4/OpenCVModules.cmake | 242 | -i ${D}${libdir}/cmake/opencv4/OpenCVModules.cmake |
| 244 | fi | 243 | fi |
| 245 | # remove setup_vars_opencv4.sh as its content is confusing and useless | ||
| 246 | if [ -f ${D}${bindir}/setup_vars_opencv4.sh ]; then | ||
| 247 | rm -rf ${D}${bindir}/setup_vars_opencv4.sh | ||
| 248 | fi | ||
| 249 | } | 244 | } |
| 250 | 245 | ||
| 246 | BBCLASSEXTEND = "native" | ||
| 247 | |||
| 251 | ########## End of meta-openembedded copy ########## | 248 | ########## End of meta-openembedded copy ########## |
| 252 | 249 | ||
| 253 | ########## i.MX overrides ########## | 250 | ########## i.MX overrides ########## |
| 254 | 251 | ||
| 255 | SUMMARY = "Opencv : The Open Computer Vision Library, i.MX Fork" | ||
| 256 | |||
| 257 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" | 252 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" |
| 258 | 253 | ||
| 259 | # Replace the opencv URL with the fork | 254 | # Need to override opencv and contrib URL because they include PV |
| 260 | SRC_URI:remove = "git://github.com/opencv/opencv.git;name=opencv;branch=master;protocol=https" | 255 | IMX_BASE_VERSION = "${@'.'.join((d.getVar('PV') or '').split('.')[:3])}" |
| 261 | SRC_URI =+ "${OPENCV_SRC};branch=${SRCBRANCH};name=opencv" | 256 | SRC_URI:remove = " \ |
| 262 | OPENCV_SRC ?= "git://github.com/nxp-imx/opencv-imx.git;protocol=https;branch=master" | 257 | git://github.com/opencv/opencv.git;name=opencv;branch=4.x;protocol=https;tag=${PV} \ |
| 263 | SRCBRANCH = "4.6.0_imx" | 258 | git://github.com/opencv/opencv_contrib.git;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/contrib;name=contrib;branch=4.x;protocol=https;tag=${PV}" |
| 264 | SRCREV_opencv = "d3440df40a6e90cd1d2a1b729bcbc16aa4d42f5d" | 259 | SRC_URI:prepend = " \ |
| 260 | git://github.com/opencv/opencv.git;name=opencv;branch=4.x;protocol=https;tag=${IMX_BASE_VERSION} \ | ||
| 261 | git://github.com/opencv/opencv_contrib.git;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/contrib;name=contrib;branch=4.x;protocol=https;tag=${IMX_BASE_VERSION} " | ||
| 262 | |||
| 263 | # i.MX patches | ||
| 264 | SRC_URI += " \ | ||
| 265 | file://0101-MGS-6470-ccc-Modify-host-ptr-alignment-size-in-UMAT.patch \ | ||
| 266 | file://0102-MGS-6470-ccc-Add-configuration-parameter-to-force-en.patch \ | ||
| 267 | file://0103-MGS-6470-ccc-Change-configuration-to-enable-hostptr-.patch \ | ||
| 268 | file://0104-MGS-8011-ccc-Fix-the-problem-of-syntax-error-at-doub.patch \ | ||
| 269 | file://0105-MGS-8318-ccc-Fix-error-implicit-declaration-of-funct.patch \ | ||
| 270 | file://0106-core-opencl-fix-inplace-transpose-race-by-enforcing-.patch \ | ||
| 271 | file://0107-imgproc-perf-HoughLines-Fix-test-tolerance-and-compa.patch \ | ||
| 272 | file://0108-imgproc-perf-HoughLines-Fix-lower-bound-for-line-cou.patch \ | ||
| 273 | file://0109-core-ocl-fix-incorrect-results-for-in-place-flip-on-.patch \ | ||
| 274 | " | ||
| 265 | 275 | ||
| 266 | # Add opencv_extra | 276 | # Add opencv_extra |
| 267 | SRC_URI += "\ | 277 | SRC_URI += "\ |
| 268 | git://github.com/opencv/opencv_extra.git;destsuffix=extra;name=extra;branch=master;protocol=https \ | 278 | git://github.com/opencv/opencv_extra.git;destsuffix=extra;name=extra;branch=4.x;protocol=https \ |
| 269 | file://0001-Add-smaller-version-of-download_models.py.patch;patchdir=${UNPACKDIR}/extra \ | 279 | file://0001-Add-smaller-version-of-download_models.py.patch;patchdir=${UNPACKDIR}/extra \ |
| 270 | " | 280 | " |
| 271 | SRCREV_FORMAT:append = "_extra" | 281 | SRCREV_FORMAT:append = "_extra" |
| 272 | SRCREV_extra = "936854e2b666853d6d0732a8eabc2d699f4fa3d8" | 282 | SRCREV_extra = "b6db059e9b80072d80d009d2ab344f8606a8e964" |
| 273 | 283 | ||
| 274 | # Patch DNN example | 284 | # Patch DNN example |
| 275 | SRC_URI += "\ | 285 | SRC_URI += "\ |
| @@ -278,40 +288,37 @@ SRC_URI += "\ | |||
| 278 | 288 | ||
| 279 | PACKAGECONFIG:remove = "eigen" | 289 | PACKAGECONFIG:remove = "eigen" |
| 280 | 290 | ||
| 281 | PACKAGECONFIG:append:mx8-nxp-bsp = " dnn text" | 291 | PACKAGECONFIG:append = " \ |
| 282 | PACKAGECONFIG:append:mx9-nxp-bsp = " dnn text" | 292 | dnn \ |
| 293 | text \ | ||
| 294 | ${@bb.utils.contains('BBFILE_COLLECTIONS', 'qt6-layer', 'qt6', '', d)} \ | ||
| 295 | ${PACKAGECONFIG_OPENCL} \ | ||
| 296 | " | ||
| 283 | 297 | ||
| 284 | PACKAGECONFIG:append = " ${PACKAGECONFIG_OPENCL}" | ||
| 285 | PACKAGECONFIG_OPENCL = "" | 298 | PACKAGECONFIG_OPENCL = "" |
| 286 | PACKAGECONFIG_OPENCL:mx8-nxp-bsp = "opencl" | 299 | PACKAGECONFIG_OPENCL:imxgpu = "opencl" |
| 287 | PACKAGECONFIG_OPENCL:mx8dxl-nxp-bsp = "" | ||
| 288 | PACKAGECONFIG_OPENCL:mx8mm-nxp-bsp = "" | 300 | PACKAGECONFIG_OPENCL:mx8mm-nxp-bsp = "" |
| 289 | PACKAGECONFIG_OPENCL:mx8mnul-nxp-bsp = "" | ||
| 290 | 301 | ||
| 291 | PACKAGECONFIG[openvx] = "-DWITH_OPENVX=ON -DOPENVX_ROOT=${STAGING_LIBDIR} -DOPENVX_LIB_CANDIDATES='OpenVX;OpenVXU',-DWITH_OPENVX=OFF,virtual/libopenvx," | 302 | PACKAGECONFIG[openvx] = "-DWITH_OPENVX=ON -DOPENVX_ROOT=${STAGING_LIBDIR} -DOPENVX_LIB_CANDIDATES='OpenVX;OpenVXU',-DWITH_OPENVX=OFF,virtual/libopenvx," |
| 292 | 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," | 303 | 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," |
| 293 | PACKAGECONFIG[qt6] = "-DWITH_QT=ON -DQT_HOST_PATH=${RECIPE_SYSROOT_NATIVE}${prefix_native},-DWITH_QT=OFF,qtbase qtbase-native," | 304 | PACKAGECONFIG[qt6] = "-DWITH_QT=ON -DQT_HOST_PATH=${RECIPE_SYSROOT_NATIVE}${prefix_native},-DWITH_QT=OFF,qtbase qtbase-native qt5compat," |
| 294 | PACKAGECONFIG[tests-imx] = "-DINSTALL_TESTS=ON -DOPENCV_TEST_DATA_PATH=${UNPACKDIR}/extra/testdata, -DINSTALL_TESTS=OFF," | 305 | PACKAGECONFIG[tests-imx] = "-DINSTALL_TESTS=ON -DOPENCV_TEST_DATA_PATH=${UNPACKDIR}/extra/testdata, -DINSTALL_TESTS=OFF," |
| 295 | PACKAGECONFIG[tim-vx] = "-DWITH_TIMVX=ON -DTIMVX_INSTALL_DIR=${STAGING_DIR_HOST}${libdir},-DWITH_TIMVX=OFF,tim-vx" | 306 | PACKAGECONFIG[tim-vx] = "-DWITH_TIMVX=ON -DTIMVX_INSTALL_DIR=${STAGING_DIR_HOST}${libdir},-DWITH_TIMVX=OFF,tim-vx" |
| 296 | 307 | ||
| 297 | # Disable cvv module in opencv_contrib as it is not yet suppported for Qt6 | ||
| 298 | # (opencv debug framework) | ||
| 299 | EXTRA_OECMAKE:append = " -DBUILD_opencv_cvv=OFF" | ||
| 300 | |||
| 301 | do_install:append() { | 308 | do_install:append() { |
| 302 | ln -sf opencv4/opencv2 ${D}${includedir}/opencv2 | 309 | ln -sf opencv4/opencv2 ${D}${includedir}/opencv2 |
| 303 | if ${@bb.utils.contains('PACKAGECONFIG', 'samples', 'true', 'false', d)}; then | 310 | install -d ${D}${datadir}/opencv4/samples/data |
| 304 | install -d ${D}${datadir}/OpenCV/samples/data | 311 | cp -r ${S}/samples/data/* ${D}${datadir}/opencv4/samples/data |
| 305 | cp -r ${S}/samples/data/* ${D}${datadir}/OpenCV/samples/data | 312 | install -d ${D}${datadir}/opencv4/samples/bin/ |
| 306 | install -d ${D}${datadir}/OpenCV/samples/bin/ | 313 | cp -f bin/example_* ${D}${datadir}/opencv4/samples/bin/ |
| 307 | cp -f bin/example_* ${D}${datadir}/OpenCV/samples/bin/ | ||
| 308 | fi | ||
| 309 | if ${@bb.utils.contains('PACKAGECONFIG', 'tests-imx', 'true', 'false', d)}; then | 314 | if ${@bb.utils.contains('PACKAGECONFIG', 'tests-imx', 'true', 'false', d)}; then |
| 310 | cp -r share/opencv4/testdata/cv/face/* ${D}${datadir}/opencv4/testdata/cv/face/ | 315 | cp -r share/opencv4/testdata/cv/face/* ${D}${datadir}/opencv4/testdata/cv/face/ |
| 311 | fi | 316 | fi |
| 317 | # Rename cpp folder to avoid collision with GCC /usr/bin/cpp. | ||
| 318 | mv ${D}${bindir}/cpp ${D}${bindir}/opencv_cpp | ||
| 312 | } | 319 | } |
| 313 | 320 | ||
| 314 | FILES:${PN}-samples += "${datadir}/OpenCV/samples" | 321 | PACKAGE_ARCH = "${MACHINE_SOCARCH}" |
| 315 | 322 | ||
| 316 | COMPATIBLE_MACHINE = "(mx8-nxp-bsp|mx9-nxp-bsp)" | 323 | COMPATIBLE_MACHINE = "(mx8-nxp-bsp|mx9-nxp-bsp)" |
| 317 | 324 | ||
