Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update opencv 4.11.0 #181

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,760 changes: 1,760 additions & 0 deletions .github/workflows/build.yml

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
zip -9 -r opencv-mobile-${{ env.opencv-version }}.zip opencv-mobile-${{ env.opencv-version }}
- name: opencv4-source
env:
opencv-version: 4.10.0
opencv-version: 4.11.0
run: |
wget -q https://github.com/opencv/opencv/archive/${{ env.opencv-version }}.zip -O opencv-${{ env.opencv-version }}.zip
unzip -q opencv-${{ env.opencv-version }}.zip
Expand Down Expand Up @@ -241,15 +241,15 @@ jobs:
- name: upload-opencv4-source
uses: actions/upload-artifact@v4
with:
name: opencv-mobile-4.10.0-source
path: opencv-mobile-4.10.0.zip
name: opencv-mobile-4.11.0-source
path: opencv-mobile-4.11.0.zip

android:
needs: [setup]
runs-on: ubuntu-latest
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
env:
COMMON_CMAKE_OPTIONS: |
-DCMAKE_POLICY_DEFAULT_CMP0057=NEW \
Expand Down Expand Up @@ -351,7 +351,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
env:
OHOS_NDK_CMAKE: $GITHUB_WORKSPACE/ohos-sdk/linux/native/build-tools/cmake/bin/cmake
COMMON_CMAKE_OPTIONS: |
Expand Down Expand Up @@ -412,7 +412,7 @@ jobs:
if: matrix.opencv-version == '2.4.13.7' || matrix.opencv-version == '3.4.20'
run: echo "OPENCV_SUBDIR=share/OpenCV" >> $GITHUB_ENV
- name: set-opencv-dir
if: matrix.opencv-version == '4.10.0'
if: matrix.opencv-version == '4.11.0'
run: echo "OPENCV_SUBDIR=lib/cmake/opencv4" >> $GITHUB_ENV
- name: test-armeabi-v7a
run: |
Expand Down Expand Up @@ -446,7 +446,7 @@ jobs:
runs-on: macos-13
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
env:
COMMON_CMAKE_OPTIONS: |
-DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake \
Expand Down Expand Up @@ -518,7 +518,7 @@ jobs:
runs-on: macos-13
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
env:
COMMON_CMAKE_OPTIONS: |
-DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake \
Expand Down Expand Up @@ -600,7 +600,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
env:
COMMON_CMAKE_OPTIONS: |
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" \
Expand Down Expand Up @@ -660,7 +660,7 @@ jobs:
if: matrix.opencv-version == '2.4.13.7' || matrix.opencv-version == '3.4.20'
run: echo "OPENCV_SUBDIR=share/OpenCV" >> $GITHUB_ENV
- name: set-opencv-dir
if: matrix.opencv-version == '4.10.0'
if: matrix.opencv-version == '4.11.0'
run: echo "OPENCV_SUBDIR=lib/cmake/opencv4" >> $GITHUB_ENV
- name: test-arm-linux-gnueabi
run: |
Expand Down Expand Up @@ -694,7 +694,7 @@ jobs:
runs-on: macos-13
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
env:
COMMON_CMAKE_OPTIONS: |
-DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake \
Expand Down Expand Up @@ -780,7 +780,7 @@ jobs:
runs-on: macos-13
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
env:
COMMON_CMAKE_OPTIONS: |
-DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake \
Expand Down Expand Up @@ -862,7 +862,7 @@ jobs:
runs-on: macos-13
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
env:
COMMON_CMAKE_OPTIONS: |
-DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake \
Expand Down Expand Up @@ -944,7 +944,7 @@ jobs:
runs-on: macos-13
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
env:
COMMON_CMAKE_OPTIONS: |
-DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake \
Expand Down Expand Up @@ -1026,7 +1026,7 @@ jobs:
runs-on: macos-13
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
env:
COMMON_CMAKE_OPTIONS: |
-DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake \
Expand Down Expand Up @@ -1108,7 +1108,7 @@ jobs:
runs-on: macos-13
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
env:
COMMON_CMAKE_OPTIONS: |
-DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake \
Expand Down Expand Up @@ -1190,7 +1190,7 @@ jobs:
runs-on: macos-13
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
env:
COMMON_CMAKE_OPTIONS: |
-DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake \
Expand Down Expand Up @@ -1262,7 +1262,7 @@ jobs:
runs-on: macos-13
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
env:
COMMON_CMAKE_OPTIONS: |
-DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake \
Expand Down Expand Up @@ -1343,7 +1343,7 @@ jobs:
needs: [setup]
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
os-compiler:
- { msvc-version: vs2015, windows-version: 2019, toolset-version: v140 }
- { msvc-version: vs2017, windows-version: 2019, toolset-version: v141 }
Expand Down Expand Up @@ -1434,7 +1434,7 @@ jobs:
needs: [setup]
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
os-ubuntu:
- { ubuntu-id: 2004, ubuntu-version: 20.04 }
- { ubuntu-id: 2204, ubuntu-version: 22.04 }
Expand Down Expand Up @@ -1469,7 +1469,7 @@ jobs:
if: matrix.opencv-version == '2.4.13.7' || matrix.opencv-version == '3.4.20'
run: echo "OPENCV_SUBDIR=share/OpenCV" >> $GITHUB_ENV
- name: set-opencv-dir
if: matrix.opencv-version == '4.10.0'
if: matrix.opencv-version == '4.11.0'
run: echo "OPENCV_SUBDIR=lib/cmake/opencv4" >> $GITHUB_ENV
- name: test
run: |
Expand All @@ -1488,7 +1488,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
env:
COMMON_CMAKE_OPTIONS: |
-DCMAKE_TOOLCHAIN_FILE=../emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
Expand Down Expand Up @@ -1574,7 +1574,7 @@ jobs:
if: matrix.opencv-version == '2.4.13.7' || matrix.opencv-version == '3.4.20'
run: echo "OPENCV_SUBDIR=share/OpenCV" >> $GITHUB_ENV
- name: set-opencv-dir
if: matrix.opencv-version == '4.10.0'
if: matrix.opencv-version == '4.11.0'
run: echo "OPENCV_SUBDIR=lib/cmake/opencv4" >> $GITHUB_ENV
- name: test
run: |
Expand Down Expand Up @@ -1623,7 +1623,7 @@ jobs:
runs-on: macos-13
strategy:
matrix:
opencv-version: [2.4.13.7, 3.4.20, 4.10.0]
opencv-version: [2.4.13.7, 3.4.20, 4.11.0]
steps:
- run: sudo xcode-select --switch /Applications/Xcode_15.2.app
- uses: actions/checkout@v4
Expand Down Expand Up @@ -1841,20 +1841,20 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: opencv-mobile-4.10.0-source
name: opencv-mobile-4.11.0-source
- name: setup-opencv-source
run: |
unzip -q opencv-mobile-4.10.0.zip
echo "SOURCE_DIR=opencv-mobile-4.10.0" >> $GITHUB_ENV
echo "PACKAGE_NAME=opencv-mobile-4.10.0-${{ matrix.name }}" >> $GITHUB_ENV
unzip -q opencv-mobile-4.11.0.zip
echo "SOURCE_DIR=opencv-mobile-4.11.0" >> $GITHUB_ENV
echo "PACKAGE_NAME=opencv-mobile-4.11.0-${{ matrix.name }}" >> $GITHUB_ENV
- name: setup-toolchain
run: ${{ matrix.setup-toolchain-cmd }}

- name: build-disable-thread
if: ${{ matrix.single-core }}
run: |
cd ${{ env.SOURCE_DIR }}
patch -p1 -i ../patches/opencv-4.10.0-no-atomic.patch
patch -p1 -i ../patches/opencv-4.11.0-no-atomic.patch
mkdir build && cd build
${{ matrix.setup-env-cmd }}
cmake ${{ env.COMMON_CMAKE_OPTIONS }} ${{ matrix.cmake-options }} \
Expand Down
12 changes: 0 additions & 12 deletions patches/opencv-4.10.0-no-zlib.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff -Nuarp opencv-4.10.0.orig/modules/imgproc/include/opencv2/imgproc.hpp opencv-4.10.0/modules/imgproc/include/opencv2/imgproc.hpp
--- opencv-4.10.0.orig/modules/imgproc/include/opencv2/imgproc.hpp 2024-08-03 13:16:17.646944880 +0800
+++ opencv-4.10.0/modules/imgproc/include/opencv2/imgproc.hpp 2024-08-01 23:08:51.014584430 +0800
@@ -4898,6 +4898,37 @@ CV_EXPORTS_W double getFontScaleFromHeig
diff -Nuarp opencv-4.11.0.orig/modules/imgproc/include/opencv2/imgproc.hpp opencv-4.11.0/modules/imgproc/include/opencv2/imgproc.hpp
--- opencv-4.11.0.orig/modules/imgproc/include/opencv2/imgproc.hpp 2025-01-19 00:07:25.706895750 +0800
+++ opencv-4.11.0/modules/imgproc/include/opencv2/imgproc.hpp 2025-01-19 00:19:27.955301521 +0800
@@ -4929,6 +4929,37 @@ CV_EXPORTS_W double getFontScaleFromHeig
const int pixelHeight,
const int thickness = 1);

Expand Down Expand Up @@ -39,9 +39,9 @@ diff -Nuarp opencv-4.10.0.orig/modules/imgproc/include/opencv2/imgproc.hpp openc
/** @brief Class for iterating over all pixels on a raster line segment.

The class LineIterator is used to get each pixel of a raster line connecting
diff -Nuarp opencv-4.10.0.orig/modules/imgproc/src/drawing.cpp opencv-4.10.0/modules/imgproc/src/drawing.cpp
--- opencv-4.10.0.orig/modules/imgproc/src/drawing.cpp 2024-08-03 13:16:17.650944867 +0800
+++ opencv-4.10.0/modules/imgproc/src/drawing.cpp 2024-08-01 23:09:27.473433279 +0800
diff -Nuarp opencv-4.11.0.orig/modules/imgproc/src/drawing.cpp opencv-4.11.0/modules/imgproc/src/drawing.cpp
--- opencv-4.11.0.orig/modules/imgproc/src/drawing.cpp 2025-01-19 00:07:25.768896509 +0800
+++ opencv-4.11.0/modules/imgproc/src/drawing.cpp 2025-01-19 00:24:39.379680129 +0800
@@ -43,6 +43,25 @@ using namespace cv;

namespace cv
Expand All @@ -65,26 +65,26 @@ diff -Nuarp opencv-4.10.0.orig/modules/imgproc/src/drawing.cpp opencv-4.10.0/mod
+
+namespace cv
+{

enum { XY_SHIFT = 16, XY_ONE = 1 << XY_SHIFT, DRAWING_STORAGE_BLOCK = (1<<12) - 256 };

@@ -2076,6 +2095,7 @@ void polylines( InputOutputArray _img, c
static const int MAX_THICKNESS = 32767;
@@ -2069,6 +2088,7 @@ void polylines( InputOutputArray _img, c
}


+#if 0
enum { FONT_SIZE_SHIFT=8, FONT_ITALIC_ALPHA=(1 << 8),
FONT_ITALIC_DIGIT=(2 << 8), FONT_ITALIC_PUNCT=(4 << 8),
FONT_ITALIC_BRACES=(8 << 8), FONT_HAVE_GREEK=(16 << 8),
@@ -2290,6 +2310,7 @@ inline void readCheck(int &c, int &i, co
@@ -2283,6 +2303,7 @@ inline void readCheck(int &c, int &i, co
}

extern const char* g_HersheyGlyphs[];
+#endif

void putText( InputOutputArray _img, const String& text, Point org,
int fontFace, double fontScale, Scalar color,
@@ -2303,6 +2324,35 @@ void putText( InputOutputArray _img, con
@@ -2296,6 +2317,35 @@ void putText( InputOutputArray _img, con
return;
}
Mat img = _img.getMat();
Expand Down Expand Up @@ -120,7 +120,7 @@ diff -Nuarp opencv-4.10.0.orig/modules/imgproc/src/drawing.cpp opencv-4.10.0/mod
const int* ascii = getFontData(fontFace);

double buf[4];
@@ -2357,10 +2407,21 @@ void putText( InputOutputArray _img, con
@@ -2350,10 +2400,21 @@ void putText( InputOutputArray _img, con
}
view_x += dx;
}
Expand All @@ -142,7 +142,7 @@ diff -Nuarp opencv-4.10.0.orig/modules/imgproc/src/drawing.cpp opencv-4.10.0/mod
Size size;
double view_x = 0;
const char **faces = cv::g_HersheyGlyphs;
@@ -2387,10 +2448,13 @@ Size getTextSize( const String& text, in
@@ -2380,10 +2441,13 @@ Size getTextSize( const String& text, in
if( _base_line )
*_base_line = cvRound(base_line*fontScale + thickness*0.5);
return size;
Expand All @@ -156,7 +156,7 @@ diff -Nuarp opencv-4.10.0.orig/modules/imgproc/src/drawing.cpp opencv-4.10.0/mod
// By https://stackoverflow.com/a/27898487/1531708
const int* ascii = getFontData(fontFace);

@@ -2398,6 +2462,96 @@ double getFontScaleFromHeight(const int
@@ -2391,6 +2455,96 @@ double getFontScaleFromHeight(const int
int cap_line = (ascii[0] >> 4) & 15;

return static_cast<double>(pixelHeight - static_cast<double>((thickness + 1)) / 2.0) / static_cast<double>(cap_line + base_line);
Expand Down Expand Up @@ -253,7 +253,7 @@ diff -Nuarp opencv-4.10.0.orig/modules/imgproc/src/drawing.cpp opencv-4.10.0/mod
}

}
@@ -2883,7 +3037,7 @@ cvInitFont( CvFont *font, int font_face,
@@ -2870,7 +3024,7 @@ cvInitFont( CvFont *font, int font_face,
{
CV_Assert( font != 0 && hscale > 0 && vscale > 0 && thickness >= 0 );

Expand All @@ -262,9 +262,9 @@ diff -Nuarp opencv-4.10.0.orig/modules/imgproc/src/drawing.cpp opencv-4.10.0/mod
font->font_face = font_face;
font->hscale = (float)hscale;
font->vscale = (float)vscale;
diff -Nuarp opencv-4.10.0.orig/modules/imgproc/src/hershey_fonts.cpp opencv-4.10.0/modules/imgproc/src/hershey_fonts.cpp
--- opencv-4.10.0.orig/modules/imgproc/src/hershey_fonts.cpp 2024-08-03 13:16:17.651944863 +0800
+++ opencv-4.10.0/modules/imgproc/src/hershey_fonts.cpp 2024-08-03 13:16:57.200812630 +0800
diff -Nuarp opencv-4.11.0.orig/modules/imgproc/src/hershey_fonts.cpp opencv-4.11.0/modules/imgproc/src/hershey_fonts.cpp
--- opencv-4.11.0.orig/modules/imgproc/src/hershey_fonts.cpp 2025-01-19 00:07:25.781896668 +0800
+++ opencv-4.11.0/modules/imgproc/src/hershey_fonts.cpp 2025-01-19 00:19:27.956301532 +0800
@@ -51,6 +51,7 @@
namespace cv
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff -Nuarp opencv-4.10.0.orig/cmake/OpenCVDetectCXXCompiler.cmake opencv-4.10.0/cmake/OpenCVDetectCXXCompiler.cmake
--- opencv-4.10.0.orig/cmake/OpenCVDetectCXXCompiler.cmake 2024-06-02 19:41:07.000000000 +0800
+++ opencv-4.10.0/cmake/OpenCVDetectCXXCompiler.cmake 2024-06-10 14:58:22.061466618 +0800
@@ -150,9 +150,9 @@ elseif(MSVC)
diff -Nuarp opencv-4.11.0.orig/cmake/OpenCVDetectCXXCompiler.cmake opencv-4.11.0/cmake/OpenCVDetectCXXCompiler.cmake
--- opencv-4.11.0.orig/cmake/OpenCVDetectCXXCompiler.cmake 2025-01-18 23:31:52.784608127 +0800
+++ opencv-4.11.0/cmake/OpenCVDetectCXXCompiler.cmake 2025-01-18 23:48:03.298849297 +0800
@@ -154,9 +154,9 @@ elseif(MSVC)
# see Modules/CMakeGenericSystem.cmake
if("${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
set(OpenCV_ARCH "x64")
Expand All @@ -13,9 +13,9 @@ diff -Nuarp opencv-4.10.0.orig/cmake/OpenCVDetectCXXCompiler.cmake opencv-4.10.0
set(OpenCV_ARCH "ARM")
elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
set(OpenCV_ARCH "x64")
diff -Nuarp opencv-4.10.0.orig/cmake/templates/OpenCVConfig.root-WIN32.cmake.in opencv-4.10.0/cmake/templates/OpenCVConfig.root-WIN32.cmake.in
--- opencv-4.10.0.orig/cmake/templates/OpenCVConfig.root-WIN32.cmake.in 2024-06-02 19:41:07.000000000 +0800
+++ opencv-4.10.0/cmake/templates/OpenCVConfig.root-WIN32.cmake.in 2024-06-10 14:58:43.470327117 +0800
diff -Nuarp opencv-4.11.0.orig/cmake/templates/OpenCVConfig.root-WIN32.cmake.in opencv-4.11.0/cmake/templates/OpenCVConfig.root-WIN32.cmake.in
--- opencv-4.11.0.orig/cmake/templates/OpenCVConfig.root-WIN32.cmake.in 2025-01-18 23:31:52.785608139 +0800
+++ opencv-4.11.0/cmake/templates/OpenCVConfig.root-WIN32.cmake.in 2025-01-18 23:48:03.298849297 +0800
@@ -99,9 +99,9 @@ elseif(MSVC)
# see Modules/CMakeGenericSystem.cmake
if("${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
Expand Down
Loading
Loading