From c0bd349874cba5877b7707b99916c6d4d928dc7d Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 5 Nov 2024 14:27:45 +0100 Subject: [PATCH] opencv: upgrade to version 4.10.0.imx This is the fork that NXP utilizes for release version 6.6.36_2.1.0. https://onedigi.atlassian.net/browse/DEL-9257 Signed-off-by: Javier Viguera --- .../conf/machine/include/imx-digi-base.inc | 4 +- .../opencv/opencv/OpenCV_DNN_examples.patch | 48 +++++++++---------- ...encv_4.9.0.imx.bb => opencv_4.10.0.imx.bb} | 18 ++++--- 3 files changed, 37 insertions(+), 33 deletions(-) rename meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/{opencv_4.9.0.imx.bb => opencv_4.10.0.imx.bb} (97%) diff --git a/meta-digi-arm/conf/machine/include/imx-digi-base.inc b/meta-digi-arm/conf/machine/include/imx-digi-base.inc index eb4571afa..c5627a7c7 100644 --- a/meta-digi-arm/conf/machine/include/imx-digi-base.inc +++ b/meta-digi-arm/conf/machine/include/imx-digi-base.inc @@ -313,8 +313,8 @@ PREFERRED_VERSION_optee-test:mx9-nxp-bsp ??= "4.2.0.imx" OPTEE_PKGS ??= "optee-client optee-os" # Use i.MX opencv Version -PREFERRED_VERSION_opencv:mx8-nxp-bsp ??= "4.9.0.imx" -PREFERRED_VERSION_opencv:mx9-nxp-bsp ??= "4.9.0.imx" +PREFERRED_VERSION_opencv:mx8-nxp-bsp ??= "4.10.0.imx" +PREFERRED_VERSION_opencv:mx9-nxp-bsp ??= "4.10.0.imx" EXTRA_IMAGEDEPENDS += "u-boot" diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch index 8dc1b6472..9aee21c4d 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv/OpenCV_DNN_examples.patch @@ -16,11 +16,11 @@ Upstream-Status: Pending samples/dnn/text_detection.cpp | 3 ++- 5 files changed, 14 insertions(+), 12 deletions(-) -diff --git a/samples/cpp/logistic_regression.cpp b/samples/cpp/logistic_regression.cpp -index 1bc2bf9711..ab5eebcbab 100644 ---- a/samples/cpp/logistic_regression.cpp -+++ b/samples/cpp/logistic_regression.cpp -@@ -28,7 +28,7 @@ static float calculateAccuracyPercent(const Mat &original, const Mat &predicted) +Index: git/samples/cpp/logistic_regression.cpp +=================================================================== +--- git.orig/samples/cpp/logistic_regression.cpp ++++ git/samples/cpp/logistic_regression.cpp +@@ -28,7 +28,7 @@ static float calculateAccuracyPercent(co int main() { @@ -29,10 +29,10 @@ index 1bc2bf9711..ab5eebcbab 100644 cout << "**********************************************************************" << endl; cout << filename << " contains digits 0 and 1 of 20 samples each, collected on an Android device" << endl; -diff --git a/samples/dnn/classification.cpp b/samples/dnn/classification.cpp -index 51893666ab..187a7807cd 100644 ---- a/samples/dnn/classification.cpp -+++ b/samples/dnn/classification.cpp +Index: git/samples/dnn/classification.cpp +=================================================================== +--- git.orig/samples/dnn/classification.cpp ++++ git/samples/dnn/classification.cpp @@ -12,6 +12,7 @@ std::string keys = "{ help h | | Print help message. }" "{ @alias | | An alias name of model to extract preprocessing parameters from models.yml file. }" @@ -68,10 +68,10 @@ index 51893666ab..187a7807cd 100644 imshow(kWinName, frame); } -diff --git a/samples/dnn/object_detection.cpp b/samples/dnn/object_detection.cpp -index 6fc8b2ab61..b299a22912 100644 ---- a/samples/dnn/object_detection.cpp -+++ b/samples/dnn/object_detection.cpp +Index: git/samples/dnn/object_detection.cpp +=================================================================== +--- git.orig/samples/dnn/object_detection.cpp ++++ git/samples/dnn/object_detection.cpp @@ -260,13 +260,13 @@ int main(int argc, char** argv) if (predictionsQueue.counter > 1) { @@ -98,7 +98,7 @@ index 6fc8b2ab61..b299a22912 100644 imshow(kWinName, frame); } -@@ -471,7 +471,7 @@ void drawPred(int classId, float conf, int left, int top, int right, int bottom, +@@ -471,7 +471,7 @@ void drawPred(int classId, float conf, i top = max(top, labelSize.height); rectangle(frame, Point(left, top - labelSize.height), Point(left + labelSize.width, top + baseLine), Scalar::all(255), FILLED); @@ -107,10 +107,10 @@ index 6fc8b2ab61..b299a22912 100644 } void callback(int pos, void*) -diff --git a/samples/dnn/segmentation.cpp b/samples/dnn/segmentation.cpp -index 777badf51e..e8d821b485 100644 ---- a/samples/dnn/segmentation.cpp -+++ b/samples/dnn/segmentation.cpp +Index: git/samples/dnn/segmentation.cpp +=================================================================== +--- git.orig/samples/dnn/segmentation.cpp ++++ git/samples/dnn/segmentation.cpp @@ -162,7 +162,7 @@ int main(int argc, char** argv) double freq = getTickFrequency() / 1000; double t = net.getPerfProfile(layersTimes) / freq; @@ -120,18 +120,18 @@ index 777badf51e..e8d821b485 100644 imshow(kWinName, frame); if (!classes.empty()) -diff --git a/samples/dnn/text_detection.cpp b/samples/dnn/text_detection.cpp -index 24902abfd7..a4ab162763 100644 ---- a/samples/dnn/text_detection.cpp -+++ b/samples/dnn/text_detection.cpp +Index: git/samples/dnn/text_detection.cpp +=================================================================== +--- git.orig/samples/dnn/text_detection.cpp ++++ git/samples/dnn/text_detection.cpp @@ -30,6 +30,7 @@ using namespace cv::dnn; const char* keys = "{ help h | | Print help message. }" "{ input i | | Path to input image or video file. Skip this argument to capture frames from a camera.}" + "{ device | 0 | camera device number. }" "{ detModel dmp | | Path to a binary .pb file contains trained detector network.}" - "{ width | 320 | Preprocess input image by resizing to a specific width. It should be multiple by 32. }" - "{ height | 320 | Preprocess input image by resizing to a specific height. It should be multiple by 32. }" + "{ width | 320 | Preprocess input image by resizing to a specific width. It should be a multiple of 32. }" + "{ height | 320 | Preprocess input image by resizing to a specific height. It should be a multiple of 32. }" @@ -106,7 +107,7 @@ int main(int argc, char** argv) // Open a video file or an image file or a camera stream. diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv_4.9.0.imx.bb b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv_4.10.0.imx.bb similarity index 97% rename from meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv_4.9.0.imx.bb rename to meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv_4.10.0.imx.bb index 2124de021..1f7649f28 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv_4.9.0.imx.bb +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-support/opencv/opencv_4.10.0.imx.bb @@ -17,7 +17,7 @@ ARM_INSTRUCTION_SET:armv5 = "arm" DEPENDS = "libtool swig-native bzip2 zlib glib-2.0 libwebp" -SRCREV_opencv = "1ea4cc711b46ebd5e676515b5372ab4659c987ea" +SRCREV_opencv = "93bb210db7cb5ae3dcd80dd6e3f8e5cfb42aa5fa" SRCREV_contrib = "c7602a8f74205e44389bd6a4e8d727d32e7e27b4" SRCREV_boostdesc = "34e4206aef44d50e6bbcd0ab06354b52e7466d26" SRCREV_vgg = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d" @@ -228,8 +228,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" SRC_URI:remove = "git://github.com/opencv/opencv.git;name=opencv;branch=4.x;protocol=https" SRC_URI =+ "${OPENCV_SRC};branch=${SRCBRANCH_opencv};name=opencv" OPENCV_SRC ?= "git://github.com/nxp-imx/opencv-imx.git;protocol=https;branch=master" -SRCBRANCH_opencv = "4.9.0_imx" -SRCREV_opencv = "1ea4cc711b46ebd5e676515b5372ab4659c987ea" +SRCBRANCH_opencv = "4.10.0_imx" +SRCREV_opencv = "93bb210db7cb5ae3dcd80dd6e3f8e5cfb42aa5fa" +SRCREV_contrib = "1ed3dd2c53888e3289afdb22ec4e9ebbff3dba87" # Add opencv_extra SRC_URI += " \ @@ -237,7 +238,7 @@ SRC_URI += " \ file://0001-Add-smaller-version-of-download_models.py.patch;patchdir=../extra \ " SRCREV_FORMAT:append = "_extra" -SRCREV_extra = "7f0ba7adefcbbbe3df7d939f5246ba0382c7c629" +SRCREV_extra = "dd1fbd0717ef4d83f86899b4144fdd9bc0364a5f" # Patch DNN example SRC_URI += " \ @@ -246,10 +247,13 @@ SRC_URI += " \ PACKAGECONFIG:remove = "eigen" -PACKAGECONFIG:append:mx8-nxp-bsp = " dnn text" -PACKAGECONFIG:append:mx9-nxp-bsp = " dnn text" +PACKAGECONFIG:append = " \ + dnn \ + text \ + ${@bb.utils.contains('BBFILE_COLLECTIONS', 'qt6-layer', 'qt6', '', d)} \ + ${PACKAGECONFIG_OPENCL} \ +" -PACKAGECONFIG:append = " ${PACKAGECONFIG_OPENCL}" PACKAGECONFIG_OPENCL = "" PACKAGECONFIG_OPENCL:mx8-nxp-bsp = "opencl" PACKAGECONFIG_OPENCL:mx8dxl-nxp-bsp = ""