mirror of
https://github.com/nihui/opencv-mobile.git
synced 2025-09-26 20:41:56 +08:00
update 3.4.20 and 4.8.0 and some ci fix and highgui fix (#53)
* update 3.4.20 patch * update 4.8.0 patch * update toolchain and ci * split ios simulator * fix wasm simd build * enable cxx11 for opencv2 * workaround for macos build * workaround for ios build * do not convert RGB/BGR inplace on imencode/imwrite * Update stb_image.h * enable stbi neon * Update highgui.cpp * mac catalyst * add test project * opencv2 link openmp * opencv 2.4.13.7 on newer msvc * enable c++11 test * test all packages
This commit is contained in:
2853
.github/workflows/release.yml
vendored
2853
.github/workflows/release.yml
vendored
File diff suppressed because it is too large
Load Diff
186
README.md
186
README.md
@@ -13,111 +13,128 @@
|
||||

|
||||

|
||||
|
||||
✔️ This project provides the minimal build of opencv library for the **Android**, **iOS** and **ARM Linux** platforms.
|
||||
:heavy_check_mark: This project provides the minimal build of opencv library for the **Android**, **iOS** and **ARM Linux** platforms.
|
||||
|
||||
✔️ Packages for **Windows**, **Linux**, **MacOS** and **WebAssembly** are available now.
|
||||
:heavy_check_mark: Packages for **Windows**, **Linux**, **MacOS** and **WebAssembly** are available now.
|
||||
|
||||
✔️ We provide prebuild binary packages for opencv **2.4.13.7**, **3.4.18** and **4.6.0**.
|
||||
:heavy_check_mark: We provide prebuild binary packages for opencv **2.4.13.7**, **3.4.20** and **4.8.0**.
|
||||
|
||||
✔️ We also provide prebuild binary package for **iOS with bitcode enabled**, that the official package lacks.
|
||||
:heavy_check_mark: We also provide prebuild binary package for **iOS/iOS-Simulator with bitcode enabled**, that the official package lacks.
|
||||
|
||||
✔️ All the binaries are compiled from source on github action, **no virus**, **no backdoor**, **no secret code**.
|
||||
:heavy_check_mark: We also provide prebuild binary package for **Mac-Catalyst** and **Apple xcframework**, that the official package lacks.
|
||||
|
||||
|opencv 4.6.0 android|package size|
|
||||
|---|---|
|
||||
|The official opencv|225MB|
|
||||
|opencv-mobile|17.1MB|
|
||||
:heavy_check_mark: All the binaries are compiled from source on github action, **no virus**, **no backdoor**, **no secret code**.
|
||||
|
||||
|opencv 4.6.0 ios|package size|
|
||||
|---|---|
|
||||
|The official opencv|182MB|
|
||||
|opencv-mobile|15.6MB|
|
||||
|opencv 4.8.0 android|package size|
|
||||
|:-:|:-:|
|
||||
|The official opencv|189 MB|
|
||||
|opencv-mobile|17.7 MB|
|
||||
|
||||
|opencv 4.6.0 ios with bitcode|package size|
|
||||
|---|---|
|
||||
|The official opencv|missing :(|
|
||||
|opencv-mobile|54.6MB|
|
||||
|opencv 4.8.0 ios|package size|package size with bitcode|
|
||||
|:-:|:-:|:-:|
|
||||
|The official opencv|197 MB|missing :(|
|
||||
|opencv-mobile|9.88 MB|34 MB|
|
||||
|
||||
# Download
|
||||
|
||||
## Android
|
||||
https://github.com/nihui/opencv-mobile/releases/latest
|
||||
|
||||
(armeabi-v7a, arm64-v8a, x86, x86_64) build with ndk r25b and android api 24.
|
||||
|Platform|Arch|opencv-2.4.13.7|opencv-3.4.20|opencv-4.8.0|
|
||||
|:-:|:-:|:-:|:-:|:-:|
|
||||
|Android|armeabi-v7a<br />arm64-v8a<br />x86<br />x86_64|[![download-icon]][opencv2-android-url]|[![download-icon]][opencv3-android-url]|[![download-icon]][opencv4-android-url]|
|
||||
|iOS|armv7<br />arm64<br />arm64e|[![download-icon]][opencv2-ios-url]<br />[![bitcode-icon]][opencv2-ios-bitcode-url]|[![download-icon]][opencv3-ios-url]<br />[![bitcode-icon]][opencv3-ios-bitcode-url]|[![download-icon]][opencv4-ios-url]<br />[![bitcode-icon]][opencv4-ios-bitcode-url]|
|
||||
|iOS-Simulator|i386<br />x86_64<br />arm64|[![download-icon]][opencv2-ios-simulator-url]<br />[![bitcode-icon]][opencv2-ios-simulator-bitcode-url]|[![download-icon]][opencv3-ios-simulator-url]<br />[![bitcode-icon]][opencv3-ios-simulator-bitcode-url]|[![download-icon]][opencv4-ios-simulator-url]<br />[![bitcode-icon]][opencv4-ios-simulator-bitcode-url]|
|
||||
|MacOS|x86_64<br />arm64|[![download-icon]][opencv2-macos-url]|[![download-icon]][opencv3-macos-url]|[![download-icon]][opencv4-macos-url]|
|
||||
|Mac-Catalyst|x86_64<br />arm64|[![download-icon]][opencv2-mac-catalyst-url]<br />[![bitcode-icon]][opencv2-mac-catalyst-bitcode-url]|[![download-icon]][opencv3-mac-catalyst-url]<br />[![bitcode-icon]][opencv3-mac-catalyst-bitcode-url]|[![download-icon]][opencv4-mac-catalyst-url]<br />[![bitcode-icon]][opencv4-mac-catalyst-bitcode-url]|
|
||||
|Apple<br />xcframework|ios<br />(armv7,arm64,arm64e)<br />ios-simulator<br />(i386,x86_64,arm64)<br />ios-maccatalyst<br />(x86_64,arm64)<br />macos<br />(x86_64,arm64)|[![download-icon]][opencv2-apple-url]<br />[![bitcode-icon]][opencv2-apple-bitcode-url]|[![download-icon]][opencv3-apple-url]<br />[![bitcode-icon]][opencv3-apple-bitcode-url]|[![download-icon]][opencv4-apple-url]<br />[![bitcode-icon]][opencv4-apple-bitcode-url]|
|
||||
|ARM-Linux|arm-linux-gnueabi<br />arm-linux-gnueabihf<br />aarch64-linux-gnu|[![download-icon]][opencv2-armlinux-url]|[![download-icon]][opencv3-armlinux-url]|[![download-icon]][opencv4-armlinux-url]|
|
||||
|Windows-VS2015|x86<br />x64|[![download-icon]][opencv2-windows-vs2015-url]|[![download-icon]][opencv3-windows-vs2015-url]|[![download-icon]][opencv4-windows-vs2015-url]|
|
||||
|Windows-VS2017|x86<br />x64|[![download-icon]][opencv2-windows-vs2017-url]|[![download-icon]][opencv3-windows-vs2017-url]|[![download-icon]][opencv4-windows-vs2017-url]|
|
||||
|Windows-VS2019|x86<br />x64|[![download-icon]][opencv2-windows-vs2019-url]|[![download-icon]][opencv3-windows-vs2019-url]|[![download-icon]][opencv4-windows-vs2019-url]|
|
||||
|Windows-VS2022|x86<br />x64|[![download-icon]][opencv2-windows-vs2022-url]|[![download-icon]][opencv3-windows-vs2022-url]|[![download-icon]][opencv4-windows-vs2022-url]|
|
||||
|Ubuntu-20.04|x86_64|[![download-icon]][opencv2-ubuntu-2004-url]|[![download-icon]][opencv3-ubuntu-2004-url]|[![download-icon]][opencv4-ubuntu-2004-url]|
|
||||
|Ubuntu-22.04|x86_64|[![download-icon]][opencv2-ubuntu-2204-url]|[![download-icon]][opencv3-ubuntu-2204-url]|[![download-icon]][opencv4-ubuntu-2204-url]|
|
||||
|WebAssembly|basic<br />simd<br />threads<br />simd+threads|[![download-icon]][opencv2-webassembly-url]|[![download-icon]][opencv3-webassembly-url]|[![download-icon]][opencv4-webassembly-url]|
|
||||
|
||||
* [opencv-mobile-2.4.13.7-android.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-2.4.13.7-android.zip)
|
||||
* [opencv-mobile-3.4.18-android.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-3.4.18-android.zip)
|
||||
* [opencv-mobile-4.6.0-android.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-4.6.0-android.zip)
|
||||
[download-icon]: https://img.shields.io/badge/download-blue?style=for-the-badge
|
||||
[bitcode-icon]: https://img.shields.io/badge/+bitcode-blue?style=for-the-badge
|
||||
|
||||
## iOS
|
||||
[opencv2-android-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-android.zip
|
||||
[opencv3-android-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-android.zip
|
||||
[opencv4-android-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-android.zip
|
||||
|
||||
(armv7, arm64, arm64e, i386, x86_64) build with Xcode 12.4.
|
||||
[opencv2-ios-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-ios.zip
|
||||
[opencv3-ios-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-ios.zip
|
||||
[opencv4-ios-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-ios.zip
|
||||
|
||||
* [opencv-mobile-2.4.13.7-ios.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-2.4.13.7-ios.zip)
|
||||
* [opencv-mobile-3.4.18-ios.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-3.4.18-ios.zip)
|
||||
* [opencv-mobile-4.6.0-ios.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-4.6.0-ios.zip)
|
||||
[opencv2-ios-bitcode-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-ios-bitcode.zip
|
||||
[opencv3-ios-bitcode-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-ios-bitcode.zip
|
||||
[opencv4-ios-bitcode-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-ios-bitcode.zip
|
||||
|
||||
## iOS with bitcode
|
||||
[opencv2-ios-simulator-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-ios-simulator.zip
|
||||
[opencv3-ios-simulator-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-ios-simulator.zip
|
||||
[opencv4-ios-simulator-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-ios-simulator.zip
|
||||
|
||||
(armv7, arm64, arm64e, i386, x86_64) build with Xcode 12.4.
|
||||
[opencv2-ios-simulator-bitcode-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-ios-simulator-bitcode.zip
|
||||
[opencv3-ios-simulator-bitcode-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-ios-simulator-bitcode.zip
|
||||
[opencv4-ios-simulator-bitcode-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-ios-simulator-bitcode.zip
|
||||
|
||||
* [opencv-mobile-2.4.13.7-ios-bitcode.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-2.4.13.7-ios-bitcode.zip)
|
||||
* [opencv-mobile-3.4.18-ios-bitcode.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-3.4.18-ios-bitcode.zip)
|
||||
* [opencv-mobile-4.6.0-ios-bitcode.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-4.6.0-ios-bitcode.zip)
|
||||
[opencv2-macos-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-macos.zip
|
||||
[opencv3-macos-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-macos.zip
|
||||
[opencv4-macos-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-macos.zip
|
||||
|
||||
## ARM Linux
|
||||
[opencv2-mac-catalyst-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-mac-catalyst.zip
|
||||
[opencv3-mac-catalyst-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-mac-catalyst.zip
|
||||
[opencv4-mac-catalyst-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-mac-catalyst.zip
|
||||
|
||||
(arm-linux-gnueabi, arm-linux-gnueabihf, aarch64-linux-gnu) build with ubuntu cross compiler.
|
||||
[opencv2-mac-catalyst-bitcode-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-mac-catalyst-bitcode.zip
|
||||
[opencv3-mac-catalyst-bitcode-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-mac-catalyst-bitcode.zip
|
||||
[opencv4-mac-catalyst-bitcode-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-mac-catalyst-bitcode.zip
|
||||
|
||||
* [opencv-mobile-2.4.13.7-armlinux.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-2.4.13.7-armlinux.zip)
|
||||
* [opencv-mobile-3.4.18-armlinux.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-3.4.18-armlinux.zip)
|
||||
* [opencv-mobile-4.6.0-armlinux.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-4.6.0-armlinux.zip)
|
||||
[opencv2-apple-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-apple.zip
|
||||
[opencv3-apple-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-apple.zip
|
||||
[opencv4-apple-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-apple.zip
|
||||
|
||||
## Windows
|
||||
[opencv2-apple-bitcode-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-apple-bitcode.zip
|
||||
[opencv3-apple-bitcode-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-apple-bitcode.zip
|
||||
[opencv4-apple-bitcode-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-apple-bitcode.zip
|
||||
|
||||
(x86, x64) build with VS2015, VS2017, VS2019 and VS2022.
|
||||
[opencv2-armlinux-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-armlinux.zip
|
||||
[opencv3-armlinux-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-armlinux.zip
|
||||
[opencv4-armlinux-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-armlinux.zip
|
||||
|
||||
* [opencv-mobile-2.4.13.7-windows-vs2015.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-2.4.13.7-windows-vs2015.zip)
|
||||
* [opencv-mobile-2.4.13.7-windows-vs2017.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-2.4.13.7-windows-vs2017.zip)
|
||||
* [opencv-mobile-2.4.13.7-windows-vs2019.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-2.4.13.7-windows-vs2019.zip)
|
||||
* [opencv-mobile-2.4.13.7-windows-vs2022.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-2.4.13.7-windows-vs2022.zip)
|
||||
* [opencv-mobile-3.4.18-windows-vs2015.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-3.4.18-windows-vs2015.zip)
|
||||
* [opencv-mobile-3.4.18-windows-vs2017.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-3.4.18-windows-vs2017.zip)
|
||||
* [opencv-mobile-3.4.18-windows-vs2019.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-3.4.18-windows-vs2019.zip)
|
||||
* [opencv-mobile-3.4.18-windows-vs2022.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-3.4.18-windows-vs2022.zip)
|
||||
* [opencv-mobile-4.6.0-windows-vs2015.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-4.6.0-windows-vs2015.zip)
|
||||
* [opencv-mobile-4.6.0-windows-vs2017.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-4.6.0-windows-vs2017.zip)
|
||||
* [opencv-mobile-4.6.0-windows-vs2019.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-4.6.0-windows-vs2019.zip)
|
||||
* [opencv-mobile-4.6.0-windows-vs2022.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-4.6.0-windows-vs2022.zip)
|
||||
[opencv2-windows-vs2015-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-windows-vs2015.zip
|
||||
[opencv3-windows-vs2015-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-windows-vs2015.zip
|
||||
[opencv4-windows-vs2015-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-windows-vs2015.zip
|
||||
|
||||
## Linux
|
||||
[opencv2-windows-vs2017-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-windows-vs2017.zip
|
||||
[opencv3-windows-vs2017-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-windows-vs2017.zip
|
||||
[opencv4-windows-vs2017-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-windows-vs2017.zip
|
||||
|
||||
(x86_64) build on Ubuntu-18.04, 20.04 and 22.04.
|
||||
[opencv2-windows-vs2019-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-windows-vs2019.zip
|
||||
[opencv3-windows-vs2019-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-windows-vs2019.zip
|
||||
[opencv4-windows-vs2019-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-windows-vs2019.zip
|
||||
|
||||
* [opencv-mobile-2.4.13.7-ubuntu-1804.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-2.4.13.7-ubuntu-1804.zip)
|
||||
* [opencv-mobile-2.4.13.7-ubuntu-2004.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-2.4.13.7-ubuntu-2004.zip)
|
||||
* [opencv-mobile-2.4.13.7-ubuntu-2204.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-2.4.13.7-ubuntu-2204.zip)
|
||||
* [opencv-mobile-3.4.18-ubuntu-1804.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-3.4.18-ubuntu-1804.zip)
|
||||
* [opencv-mobile-3.4.18-ubuntu-2004.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-3.4.18-ubuntu-2004.zip)
|
||||
* [opencv-mobile-3.4.18-ubuntu-2204.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-3.4.18-ubuntu-2204.zip)
|
||||
* [opencv-mobile-4.6.0-ubuntu-1804.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-4.6.0-ubuntu-1804.zip)
|
||||
* [opencv-mobile-4.6.0-ubuntu-2004.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-4.6.0-ubuntu-2004.zip)
|
||||
* [opencv-mobile-4.6.0-ubuntu-2204.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-4.6.0-ubuntu-2204.zip)
|
||||
[opencv2-windows-vs2022-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-windows-vs2022.zip
|
||||
[opencv3-windows-vs2022-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-windows-vs2022.zip
|
||||
[opencv4-windows-vs2022-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-windows-vs2022.zip
|
||||
|
||||
## MacOS
|
||||
[opencv2-ubuntu-2004-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-ubuntu-2004.zip
|
||||
[opencv3-ubuntu-2004-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-ubuntu-2004.zip
|
||||
[opencv4-ubuntu-2004-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-ubuntu-2004.zip
|
||||
|
||||
(x86_64, arm64) build with Xcode 12.4.
|
||||
[opencv2-ubuntu-2204-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-ubuntu-2204.zip
|
||||
[opencv3-ubuntu-2204-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-ubuntu-2204.zip
|
||||
[opencv4-ubuntu-2204-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-ubuntu-2204.zip
|
||||
|
||||
* [opencv-mobile-2.4.13.7-macos.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-2.4.13.7-macos.zip)
|
||||
* [opencv-mobile-3.4.18-macos.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-3.4.18-macos.zip)
|
||||
* [opencv-mobile-4.6.0-macos.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-4.6.0-macos.zip)
|
||||
[opencv2-webassembly-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-webassembly.zip
|
||||
[opencv3-webassembly-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-webassembly.zip
|
||||
[opencv4-webassembly-url]: https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.8.0-webassembly.zip
|
||||
|
||||
## WebAssembly
|
||||
|
||||
(basic, simd, threads, simd+threads) build with Emscripten 2.0.8.
|
||||
|
||||
* [opencv-mobile-2.4.13.7-webassembly.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-2.4.13.7-webassembly.zip)
|
||||
* [opencv-mobile-3.4.18-webassembly.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-3.4.18-webassembly.zip)
|
||||
* [opencv-mobile-4.6.0-webassembly.zip](https://github.com/nihui/opencv-mobile/releases/download/v16/opencv-mobile-4.6.0-webassembly.zip)
|
||||
* Android package build with ndk r25c and android api 24
|
||||
* iOS / iOS-Simulator / MacOS / Mac-Catalyst package build with Xcode 13.4.1
|
||||
* ARM Linux package build with cross compiler on Ubuntu-22.04
|
||||
* WebAssembly package build with Emscripten 3.1.28
|
||||
|
||||
# Usage Android
|
||||
|
||||
@@ -125,7 +142,7 @@
|
||||
2. Modify ```<project dir>/app/src/main/jni/CMakeListst.txt``` to find and link opencv
|
||||
|
||||
```cmake
|
||||
set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/opencv-mobile-4.6.0-android/sdk/native/jni)
|
||||
set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/opencv-mobile-4.8.0-android/sdk/native/jni)
|
||||
find_package(OpenCV REQUIRED)
|
||||
|
||||
target_link_libraries(your_jni_target ${OpenCV_LIBS})
|
||||
@@ -133,15 +150,16 @@ target_link_libraries(your_jni_target ${OpenCV_LIBS})
|
||||
|
||||
# Usage iOS and MacOS
|
||||
|
||||
1. Extract archive, and drag ```opencv2.framework``` into your project
|
||||
1. Extract archive, and drag ```opencv2.framework``` or ```opencv2.xcframework``` into your project
|
||||
|
||||
# Usage ARM Linux, Windows, Linux, WebAssembly
|
||||
|
||||
1. Extract archive to ```<project dir>/```
|
||||
2. Modify ```<project dir>/CMakeListst.txt``` to find and link opencv
|
||||
3. Pass ```-DOpenCV_STATIC=ON``` to cmake option for windows build
|
||||
|
||||
```cmake
|
||||
set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/opencv-mobile-4.6.0-armlinux/arm-linux-gnueabihf/lib/cmake/opencv4)
|
||||
set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/opencv-mobile-4.8.0-armlinux/arm-linux-gnueabihf/lib/cmake/opencv4)
|
||||
find_package(OpenCV REQUIRED)
|
||||
|
||||
target_link_libraries(your_target ${OpenCV_LIBS})
|
||||
@@ -151,14 +169,14 @@ target_link_libraries(your_target ${OpenCV_LIBS})
|
||||
|
||||
**step 1. download opencv source**
|
||||
```shell
|
||||
wget -q https://github.com/opencv/opencv/archive/4.6.0.zip -O opencv-4.6.0.zip
|
||||
unzip -q opencv-4.6.0.zip
|
||||
cd opencv-4.6.0
|
||||
wget -q https://github.com/opencv/opencv/archive/4.8.0.zip -O opencv-4.8.0.zip
|
||||
unzip -q opencv-4.8.0.zip
|
||||
cd opencv-4.8.0
|
||||
```
|
||||
|
||||
**step 2. strip zlib dependency and use stb-based highgui implementation (optional)**
|
||||
```shell
|
||||
patch -p1 -i ../opencv-4.6.0-no-zlib.patch
|
||||
patch -p1 -i ../opencv-4.8.0-no-zlib.patch
|
||||
truncate -s 0 cmake/OpenCVFindLibsGrfmt.cmake
|
||||
rm -rf modules/gapi
|
||||
rm -rf modules/highgui
|
||||
@@ -167,7 +185,7 @@ cp -r ../highgui modules/
|
||||
|
||||
**step 3. patch opencv source for no-rtti build (optional)**
|
||||
```shell
|
||||
patch -p1 -i ../opencv-4.6.0-no-rtti.patch
|
||||
patch -p1 -i ../opencv-4.8.0-no-rtti.patch
|
||||
```
|
||||
|
||||
**step 4. apply your opencv options to opencv4_cmake_options.txt**
|
||||
@@ -184,7 +202,7 @@ cmake -DCMAKE_INSTALL_PREFIX=install \
|
||||
|
||||
**step 6. make a package**
|
||||
```shell
|
||||
zip -r -9 opencv-mobile-4.6.0.zip install
|
||||
zip -r -9 opencv-mobile-4.8.0.zip install
|
||||
```
|
||||
|
||||
# Some notes
|
||||
@@ -238,5 +256,3 @@ zip -r -9 opencv-mobile-4.6.0.zip install
|
||||
|opencv_videoio|use android MediaCodec or ios AVFoundation api instead|
|
||||
|opencv_videostab|do video stablization on powerful pc or server|
|
||||
|opencv_viz|vtk is not available on mobile, write your own data visualization routines|
|
||||
|
||||
|
||||
|
@@ -23,6 +23,9 @@
|
||||
#include "exif.hpp"
|
||||
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#if __ARM_NEON
|
||||
#define STBI_NEON
|
||||
#endif
|
||||
#define STBI_NO_THREAD_LOCALS
|
||||
#define STBI_ONLY_JPEG
|
||||
#define STBI_ONLY_PNG
|
||||
@@ -201,12 +204,16 @@ bool imwrite(const String& filename, InputArray _img, const std::vector<int>& pa
|
||||
else if (img.type() == CV_8UC3)
|
||||
{
|
||||
c = 3;
|
||||
cvtColor(img, img, COLOR_BGR2RGB);
|
||||
Mat img2;
|
||||
cvtColor(img, img2, COLOR_BGR2RGB);
|
||||
img = img2;
|
||||
}
|
||||
else if (img.type() == CV_8UC4)
|
||||
{
|
||||
c = 4;
|
||||
cvtColor(img, img, COLOR_BGRA2RGBA);
|
||||
Mat img2;
|
||||
cvtColor(img, img2, COLOR_BGRA2RGBA);
|
||||
img = img2;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -368,12 +375,16 @@ bool imencode(const String& ext, InputArray _img, std::vector<uchar>& buf, const
|
||||
else if (img.type() == CV_8UC3)
|
||||
{
|
||||
c = 3;
|
||||
cvtColor(img, img, COLOR_BGR2RGB);
|
||||
Mat img2;
|
||||
cvtColor(img, img2, COLOR_BGR2RGB);
|
||||
img = img2;
|
||||
}
|
||||
else if (img.type() == CV_8UC4)
|
||||
{
|
||||
c = 4;
|
||||
cvtColor(img, img, COLOR_BGRA2RGBA);
|
||||
Mat img2;
|
||||
cvtColor(img, img2, COLOR_BGRA2RGBA);
|
||||
img = img2;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* stb_image - v2.27 - public domain image loader - http://nothings.org/stb
|
||||
/* stb_image - v2.28 - public domain image loader - http://nothings.org/stb
|
||||
no warranty implied; use at your own risk
|
||||
|
||||
Do this:
|
||||
@@ -48,6 +48,7 @@ LICENSE
|
||||
|
||||
RECENT REVISION HISTORY:
|
||||
|
||||
2.28 (2023-01-29) many error fixes, security errors, just tons of stuff
|
||||
2.27 (2021-07-11) document stbi_info better, 16-bit PNM support, bug fixes
|
||||
2.26 (2020-07-13) many minor fixes
|
||||
2.25 (2020-02-02) fix warnings
|
||||
@@ -108,7 +109,7 @@ RECENT REVISION HISTORY:
|
||||
Cass Everitt Ryamond Barbiero github:grim210
|
||||
Paul Du Bois Engin Manap Aldo Culquicondor github:sammyhw
|
||||
Philipp Wiesemann Dale Weiler Oriol Ferrer Mesia github:phprus
|
||||
Josh Tobin Matthew Gregan github:poppolopoppo
|
||||
Josh Tobin Neil Bickford Matthew Gregan github:poppolopoppo
|
||||
Julian Raschke Gregory Mullen Christian Floisand github:darealshinji
|
||||
Baldur Karlsson Kevin Schmidt JR Smith github:Michaelangel007
|
||||
Brad Weinberger Matvey Cherevko github:mosra
|
||||
@@ -140,7 +141,7 @@ RECENT REVISION HISTORY:
|
||||
// // ... x = width, y = height, n = # 8-bit components per pixel ...
|
||||
// // ... replace '0' with '1'..'4' to force that many components per pixel
|
||||
// // ... but 'n' will always be the number that it would have been if you said 0
|
||||
// stbi_image_free(data)
|
||||
// stbi_image_free(data);
|
||||
//
|
||||
// Standard parameters:
|
||||
// int *x -- outputs image width in pixels
|
||||
@@ -635,7 +636,7 @@ STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const ch
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER) || defined(__SYMBIAN32__)
|
||||
typedef unsigned short stbi__uint16;
|
||||
typedef signed short stbi__int16;
|
||||
typedef unsigned int stbi__uint32;
|
||||
@@ -1063,6 +1064,23 @@ static void *stbi__malloc_mad4(int a, int b, int c, int d, int add)
|
||||
}
|
||||
#endif
|
||||
|
||||
// returns 1 if the sum of two signed ints is valid (between -2^31 and 2^31-1 inclusive), 0 on overflow.
|
||||
static int stbi__addints_valid(int a, int b)
|
||||
{
|
||||
if ((a >= 0) != (b >= 0)) return 1; // a and b have different signs, so no overflow
|
||||
if (a < 0 && b < 0) return a >= INT_MIN - b; // same as a + b >= INT_MIN; INT_MIN - b cannot overflow since b < 0.
|
||||
return a <= INT_MAX - b;
|
||||
}
|
||||
|
||||
// returns 1 if the product of two signed shorts is valid, 0 on overflow.
|
||||
static int stbi__mul2shorts_valid(short a, short b)
|
||||
{
|
||||
if (b == 0 || b == -1) return 1; // multiplication by 0 is always 0; check for -1 so SHRT_MIN/b doesn't overflow
|
||||
if ((a >= 0) == (b >= 0)) return a <= SHRT_MAX/b; // product is positive, so similar to mul2sizes_valid
|
||||
if (b < 0) return a <= SHRT_MIN / b; // same as a * b >= SHRT_MIN
|
||||
return a >= SHRT_MIN / b;
|
||||
}
|
||||
|
||||
// stbi__err - error
|
||||
// stbi__errpf - error returning pointer to float
|
||||
// stbi__errpuc - error returning pointer to unsigned char
|
||||
@@ -1985,9 +2003,12 @@ static int stbi__build_huffman(stbi__huffman *h, int *count)
|
||||
int i,j,k=0;
|
||||
unsigned int code;
|
||||
// build size list for each symbol (from JPEG spec)
|
||||
for (i=0; i < 16; ++i)
|
||||
for (j=0; j < count[i]; ++j)
|
||||
for (i=0; i < 16; ++i) {
|
||||
for (j=0; j < count[i]; ++j) {
|
||||
h->size[k++] = (stbi_uc) (i+1);
|
||||
if(k >= 257) return stbi__err("bad size list","Corrupt JPEG");
|
||||
}
|
||||
}
|
||||
h->size[k] = 0;
|
||||
|
||||
// compute actual symbols (from jpeg spec)
|
||||
@@ -2112,6 +2133,8 @@ stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h)
|
||||
|
||||
// convert the huffman code to the symbol id
|
||||
c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k];
|
||||
if(c < 0 || c >= 256) // symbol id out of bounds!
|
||||
return -1;
|
||||
STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]);
|
||||
|
||||
// convert the id to a symbol
|
||||
@@ -2130,6 +2153,7 @@ stbi_inline static int stbi__extend_receive(stbi__jpeg *j, int n)
|
||||
unsigned int k;
|
||||
int sgn;
|
||||
if (j->code_bits < n) stbi__grow_buffer_unsafe(j);
|
||||
if (j->code_bits < n) return 0; // ran out of bits from stream, return 0s intead of continuing
|
||||
|
||||
sgn = j->code_buffer >> 31; // sign bit always in MSB; 0 if MSB clear (positive), 1 if MSB set (negative)
|
||||
k = stbi_lrot(j->code_buffer, n);
|
||||
@@ -2144,6 +2168,7 @@ stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n)
|
||||
{
|
||||
unsigned int k;
|
||||
if (j->code_bits < n) stbi__grow_buffer_unsafe(j);
|
||||
if (j->code_bits < n) return 0; // ran out of bits from stream, return 0s intead of continuing
|
||||
k = stbi_lrot(j->code_buffer, n);
|
||||
j->code_buffer = k & ~stbi__bmask[n];
|
||||
k &= stbi__bmask[n];
|
||||
@@ -2155,6 +2180,7 @@ stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j)
|
||||
{
|
||||
unsigned int k;
|
||||
if (j->code_bits < 1) stbi__grow_buffer_unsafe(j);
|
||||
if (j->code_bits < 1) return 0; // ran out of bits from stream, return 0s intead of continuing
|
||||
k = j->code_buffer;
|
||||
j->code_buffer <<= 1;
|
||||
--j->code_bits;
|
||||
@@ -2192,8 +2218,10 @@ static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman
|
||||
memset(data,0,64*sizeof(data[0]));
|
||||
|
||||
diff = t ? stbi__extend_receive(j, t) : 0;
|
||||
if (!stbi__addints_valid(j->img_comp[b].dc_pred, diff)) return stbi__err("bad delta","Corrupt JPEG");
|
||||
dc = j->img_comp[b].dc_pred + diff;
|
||||
j->img_comp[b].dc_pred = dc;
|
||||
if (!stbi__mul2shorts_valid(dc, dequant[0])) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
|
||||
data[0] = (short) (dc * dequant[0]);
|
||||
|
||||
// decode AC components, see JPEG spec
|
||||
@@ -2207,6 +2235,7 @@ static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman
|
||||
if (r) { // fast-AC path
|
||||
k += (r >> 4) & 15; // run
|
||||
s = r & 15; // combined length
|
||||
if (s > j->code_bits) return stbi__err("bad huffman code", "Combined length longer than code bits available");
|
||||
j->code_buffer <<= s;
|
||||
j->code_bits -= s;
|
||||
// decode into unzigzag'd location
|
||||
@@ -2246,8 +2275,10 @@ static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__
|
||||
if (t < 0 || t > 15) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
|
||||
diff = t ? stbi__extend_receive(j, t) : 0;
|
||||
|
||||
if (!stbi__addints_valid(j->img_comp[b].dc_pred, diff)) return stbi__err("bad delta", "Corrupt JPEG");
|
||||
dc = j->img_comp[b].dc_pred + diff;
|
||||
j->img_comp[b].dc_pred = dc;
|
||||
if (!stbi__mul2shorts_valid(dc, 1 << j->succ_low)) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
|
||||
data[0] = (short) (dc * (1 << j->succ_low));
|
||||
} else {
|
||||
// refinement scan for DC coefficient
|
||||
@@ -2282,6 +2313,7 @@ static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__
|
||||
if (r) { // fast-AC path
|
||||
k += (r >> 4) & 15; // run
|
||||
s = r & 15; // combined length
|
||||
if (s > j->code_bits) return stbi__err("bad huffman code", "Combined length longer than code bits available");
|
||||
j->code_buffer <<= s;
|
||||
j->code_bits -= s;
|
||||
zig = stbi__jpeg_dezigzag[k++];
|
||||
@@ -3102,6 +3134,7 @@ static int stbi__process_marker(stbi__jpeg *z, int m)
|
||||
sizes[i] = stbi__get8(z->s);
|
||||
n += sizes[i];
|
||||
}
|
||||
if(n > 256) return stbi__err("bad DHT header","Corrupt JPEG"); // Loop over i < n would write past end of values!
|
||||
L -= 17;
|
||||
if (tc == 0) {
|
||||
if (!stbi__build_huffman(z->huff_dc+th, sizes)) return 0;
|
||||
@@ -3351,6 +3384,28 @@ static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int stbi__skip_jpeg_junk_at_end(stbi__jpeg *j)
|
||||
{
|
||||
// some JPEGs have junk at end, skip over it but if we find what looks
|
||||
// like a valid marker, resume there
|
||||
while (!stbi__at_eof(j->s)) {
|
||||
int x = stbi__get8(j->s);
|
||||
while (x == 255) { // might be a marker
|
||||
if (stbi__at_eof(j->s)) return STBI__MARKER_none;
|
||||
x = stbi__get8(j->s);
|
||||
if (x != 0x00 && x != 0xff) {
|
||||
// not a stuffed zero or lead-in to another marker, looks
|
||||
// like an actual marker, return it
|
||||
return x;
|
||||
}
|
||||
// stuffed zero has x=0 now which ends the loop, meaning we go
|
||||
// back to regular scan loop.
|
||||
// repeated 0xff keeps trying to read the next byte of the marker.
|
||||
}
|
||||
}
|
||||
return STBI__MARKER_none;
|
||||
}
|
||||
|
||||
// decode image to YCbCr format
|
||||
static int stbi__decode_jpeg_image(stbi__jpeg *j)
|
||||
{
|
||||
@@ -3367,25 +3422,22 @@ static int stbi__decode_jpeg_image(stbi__jpeg *j)
|
||||
if (!stbi__process_scan_header(j)) return 0;
|
||||
if (!stbi__parse_entropy_coded_data(j)) return 0;
|
||||
if (j->marker == STBI__MARKER_none ) {
|
||||
// handle 0s at the end of image data from IP Kamera 9060
|
||||
while (!stbi__at_eof(j->s)) {
|
||||
int x = stbi__get8(j->s);
|
||||
if (x == 255) {
|
||||
j->marker = stbi__get8(j->s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
j->marker = stbi__skip_jpeg_junk_at_end(j);
|
||||
// if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0
|
||||
}
|
||||
m = stbi__get_marker(j);
|
||||
if (STBI__RESTART(m))
|
||||
m = stbi__get_marker(j);
|
||||
} else if (stbi__DNL(m)) {
|
||||
int Ld = stbi__get16be(j->s);
|
||||
stbi__uint32 NL = stbi__get16be(j->s);
|
||||
if (Ld != 4) return stbi__err("bad DNL len", "Corrupt JPEG");
|
||||
if (NL != j->s->img_y) return stbi__err("bad DNL height", "Corrupt JPEG");
|
||||
m = stbi__get_marker(j);
|
||||
} else {
|
||||
if (!stbi__process_marker(j, m)) return 0;
|
||||
if (!stbi__process_marker(j, m)) return 1;
|
||||
m = stbi__get_marker(j);
|
||||
}
|
||||
m = stbi__get_marker(j);
|
||||
}
|
||||
if (j->progressive)
|
||||
stbi__jpeg_finish(j);
|
||||
@@ -3976,6 +4028,7 @@ static void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int re
|
||||
unsigned char* result;
|
||||
stbi__jpeg* j = (stbi__jpeg*) stbi__malloc(sizeof(stbi__jpeg));
|
||||
if (!j) return stbi__errpuc("outofmem", "Out of memory");
|
||||
memset(j, 0, sizeof(stbi__jpeg));
|
||||
STBI_NOTUSED(ri);
|
||||
j->s = s;
|
||||
stbi__setup_jpeg(j);
|
||||
@@ -3989,6 +4042,7 @@ static int stbi__jpeg_test(stbi__context *s)
|
||||
int r;
|
||||
stbi__jpeg* j = (stbi__jpeg*)stbi__malloc(sizeof(stbi__jpeg));
|
||||
if (!j) return stbi__err("outofmem", "Out of memory");
|
||||
memset(j, 0, sizeof(stbi__jpeg));
|
||||
j->s = s;
|
||||
stbi__setup_jpeg(j);
|
||||
r = stbi__decode_jpeg_header(j, STBI__SCAN_type);
|
||||
@@ -4014,6 +4068,7 @@ static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp)
|
||||
int result;
|
||||
stbi__jpeg* j = (stbi__jpeg*) (stbi__malloc(sizeof(stbi__jpeg)));
|
||||
if (!j) return stbi__err("outofmem", "Out of memory");
|
||||
memset(j, 0, sizeof(stbi__jpeg));
|
||||
j->s = s;
|
||||
result = stbi__jpeg_info_raw(j, x, y, comp);
|
||||
STBI_FREE(j);
|
||||
@@ -4256,11 +4311,12 @@ static int stbi__parse_huffman_block(stbi__zbuf *a)
|
||||
a->zout = zout;
|
||||
return 1;
|
||||
}
|
||||
if (z >= 286) return stbi__err("bad huffman code","Corrupt PNG"); // per DEFLATE, length codes 286 and 287 must not appear in compressed data
|
||||
z -= 257;
|
||||
len = stbi__zlength_base[z];
|
||||
if (stbi__zlength_extra[z]) len += stbi__zreceive(a, stbi__zlength_extra[z]);
|
||||
z = stbi__zhuffman_decode(a, &a->z_distance);
|
||||
if (z < 0) return stbi__err("bad huffman code","Corrupt PNG");
|
||||
if (z < 0 || z >= 30) return stbi__err("bad huffman code","Corrupt PNG"); // per DEFLATE, distance codes 30 and 31 must not appear in compressed data
|
||||
dist = stbi__zdist_base[z];
|
||||
if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]);
|
||||
if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG");
|
||||
@@ -4955,7 +5011,7 @@ STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert)
|
||||
static STBI_THREAD_LOCAL int stbi__unpremultiply_on_load_local, stbi__unpremultiply_on_load_set;
|
||||
static STBI_THREAD_LOCAL int stbi__de_iphone_flag_local, stbi__de_iphone_flag_set;
|
||||
|
||||
STBIDEF void stbi__unpremultiply_on_load_thread(int flag_true_if_should_unpremultiply)
|
||||
STBIDEF void stbi_set_unpremultiply_on_load_thread(int flag_true_if_should_unpremultiply)
|
||||
{
|
||||
stbi__unpremultiply_on_load_local = flag_true_if_should_unpremultiply;
|
||||
stbi__unpremultiply_on_load_set = 1;
|
||||
@@ -5064,14 +5120,13 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
|
||||
if (!pal_img_n) {
|
||||
s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0);
|
||||
if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode");
|
||||
if (scan == STBI__SCAN_header) return 1;
|
||||
} else {
|
||||
// if paletted, then pal_n is our final components, and
|
||||
// img_n is # components to decompress/filter.
|
||||
s->img_n = 1;
|
||||
if ((1 << 30) / s->img_x / 4 < s->img_y) return stbi__err("too large","Corrupt PNG");
|
||||
// if SCAN_header, have to scan to see if we have a tRNS
|
||||
}
|
||||
// even with SCAN_header, have to scan to see if we have a tRNS
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -5103,6 +5158,8 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
|
||||
if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG");
|
||||
if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG");
|
||||
has_trans = 1;
|
||||
// non-paletted with tRNS = constant alpha. if header-scanning, we can stop now.
|
||||
if (scan == STBI__SCAN_header) { ++s->img_n; return 1; }
|
||||
if (z->depth == 16) {
|
||||
for (k = 0; k < s->img_n; ++k) tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is
|
||||
} else {
|
||||
@@ -5115,7 +5172,13 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
|
||||
case STBI__PNG_TYPE('I','D','A','T'): {
|
||||
if (first) return stbi__err("first not IHDR", "Corrupt PNG");
|
||||
if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG");
|
||||
if (scan == STBI__SCAN_header) { s->img_n = pal_img_n; return 1; }
|
||||
if (scan == STBI__SCAN_header) {
|
||||
// header scan definitely stops at first IDAT
|
||||
if (pal_img_n)
|
||||
s->img_n = pal_img_n;
|
||||
return 1;
|
||||
}
|
||||
if (c.length > (1u << 30)) return stbi__err("IDAT size limit", "IDAT section larger than 2^30 bytes");
|
||||
if ((int)(ioff + c.length) < (int)ioff) return 0;
|
||||
if (ioff + c.length > idata_limit) {
|
||||
stbi__uint32 idata_limit_old = idata_limit;
|
||||
@@ -5498,8 +5561,22 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req
|
||||
psize = (info.offset - info.extra_read - info.hsz) >> 2;
|
||||
}
|
||||
if (psize == 0) {
|
||||
if (info.offset != s->callback_already_read + (s->img_buffer - s->img_buffer_original)) {
|
||||
return stbi__errpuc("bad offset", "Corrupt BMP");
|
||||
// accept some number of extra bytes after the header, but if the offset points either to before
|
||||
// the header ends or implies a large amount of extra data, reject the file as malformed
|
||||
int bytes_read_so_far = s->callback_already_read + (int)(s->img_buffer - s->img_buffer_original);
|
||||
int header_limit = 1024; // max we actually read is below 256 bytes currently.
|
||||
int extra_data_limit = 256*4; // what ordinarily goes here is a palette; 256 entries*4 bytes is its max size.
|
||||
if (bytes_read_so_far <= 0 || bytes_read_so_far > header_limit) {
|
||||
return stbi__errpuc("bad header", "Corrupt BMP");
|
||||
}
|
||||
// we established that bytes_read_so_far is positive and sensible.
|
||||
// the first half of this test rejects offsets that are either too small positives, or
|
||||
// negative, and guarantees that info.offset >= bytes_read_so_far > 0. this in turn
|
||||
// ensures the number computed in the second half of the test can't overflow.
|
||||
if (info.offset < bytes_read_so_far || info.offset - bytes_read_so_far > extra_data_limit) {
|
||||
return stbi__errpuc("bad offset", "Corrupt BMP");
|
||||
} else {
|
||||
stbi__skip(s, info.offset - bytes_read_so_far);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7187,12 +7264,12 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re
|
||||
// Run
|
||||
value = stbi__get8(s);
|
||||
count -= 128;
|
||||
if (count > nleft) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); }
|
||||
if ((count == 0) || (count > nleft)) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); }
|
||||
for (z = 0; z < count; ++z)
|
||||
scanline[i++ * 4 + k] = value;
|
||||
} else {
|
||||
// Dump
|
||||
if (count > nleft) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); }
|
||||
if ((count == 0) || (count > nleft)) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); }
|
||||
for (z = 0; z < count; ++z)
|
||||
scanline[i++ * 4 + k] = stbi__get8(s);
|
||||
}
|
||||
@@ -7446,10 +7523,17 @@ static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req
|
||||
|
||||
out = (stbi_uc *) stbi__malloc_mad4(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0);
|
||||
if (!out) return stbi__errpuc("outofmem", "Out of memory");
|
||||
stbi__getn(s, out, s->img_n * s->img_x * s->img_y * (ri->bits_per_channel / 8));
|
||||
if (!stbi__getn(s, out, s->img_n * s->img_x * s->img_y * (ri->bits_per_channel / 8))) {
|
||||
STBI_FREE(out);
|
||||
return stbi__errpuc("bad PNM", "PNM file truncated");
|
||||
}
|
||||
|
||||
if (req_comp && req_comp != s->img_n) {
|
||||
out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y);
|
||||
if (ri->bits_per_channel == 16) {
|
||||
out = (stbi_uc *) stbi__convert_format16((stbi__uint16 *) out, s->img_n, req_comp, s->img_x, s->img_y);
|
||||
} else {
|
||||
out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y);
|
||||
}
|
||||
if (out == NULL) return out; // stbi__convert_format frees input on failure
|
||||
}
|
||||
return out;
|
||||
@@ -7486,6 +7570,8 @@ static int stbi__pnm_getinteger(stbi__context *s, char *c)
|
||||
while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) {
|
||||
value = value*10 + (*c - '0');
|
||||
*c = (char) stbi__get8(s);
|
||||
if((value > 214748364) || (value == 214748364 && *c > '7'))
|
||||
return stbi__err("integer parse overflow", "Parsing an integer in the PPM header overflowed a 32-bit int");
|
||||
}
|
||||
|
||||
return value;
|
||||
@@ -7516,9 +7602,13 @@ static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp)
|
||||
stbi__pnm_skip_whitespace(s, &c);
|
||||
|
||||
*x = stbi__pnm_getinteger(s, &c); // read width
|
||||
if(*x == 0)
|
||||
return stbi__err("invalid width", "PPM image header had zero or overflowing width");
|
||||
stbi__pnm_skip_whitespace(s, &c);
|
||||
|
||||
*y = stbi__pnm_getinteger(s, &c); // read height
|
||||
if (*y == 0)
|
||||
return stbi__err("invalid width", "PPM image header had zero or overflowing width");
|
||||
stbi__pnm_skip_whitespace(s, &c);
|
||||
|
||||
maxv = stbi__pnm_getinteger(s, &c); // read max value
|
||||
|
11
opencv-2.4.13.7-enable-cxx11.patch
Normal file
11
opencv-2.4.13.7-enable-cxx11.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
diff -Nuarp opencv-2.4.13.7.orig/cmake/OpenCVDetectCXXCompiler.cmake opencv-2.4.13.7/cmake/OpenCVDetectCXXCompiler.cmake
|
||||
--- opencv-2.4.13.7.orig/cmake/OpenCVDetectCXXCompiler.cmake 2018-07-02 20:41:56.000000000 +0800
|
||||
+++ opencv-2.4.13.7/cmake/OpenCVDetectCXXCompiler.cmake 2023-08-06 19:27:16.226755305 +0800
|
||||
@@ -114,3 +114,7 @@ elseif(MINGW)
|
||||
set(OpenCV_ARCH x86)
|
||||
endif()
|
||||
endif()
|
||||
+
|
||||
+set(CMAKE_CXX_STANDARD 11)
|
||||
+set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
||||
+set(CMAKE_CXX_EXTENSIONS OFF)
|
16
opencv-2.4.13.7-link-openmp.patch
Normal file
16
opencv-2.4.13.7-link-openmp.patch
Normal file
@@ -0,0 +1,16 @@
|
||||
diff -Nuarp opencv-2.4.13.7.orig/modules/core/CMakeLists.txt opencv-2.4.13.7/modules/core/CMakeLists.txt
|
||||
--- opencv-2.4.13.7.orig/modules/core/CMakeLists.txt 2018-07-02 20:41:56.000000000 +0800
|
||||
+++ opencv-2.4.13.7/modules/core/CMakeLists.txt 2023-08-13 19:26:51.073833956 +0800
|
||||
@@ -52,7 +52,11 @@ else()
|
||||
HEADERS ${lib_cuda_hdrs} ${lib_cuda_hdrs_detail})
|
||||
endif()
|
||||
|
||||
-ocv_create_module()
|
||||
+if(HAVE_OPENMP AND DEFINED OpenMP_CXX_LIBRARIES AND OpenMP_CXX_LIBRARIES)
|
||||
+ ocv_create_module(${OpenMP_CXX_LIBRARIES})
|
||||
+else()
|
||||
+ ocv_create_module()
|
||||
+endif()
|
||||
ocv_add_precompiled_headers(${the_module})
|
||||
|
||||
ocv_add_accuracy_tests()
|
28
opencv-2.4.13.7-newer-msvc.patch
Normal file
28
opencv-2.4.13.7-newer-msvc.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
diff -Nuarp opencv-2.4.13.7.orig/cmake/OpenCVConfig.cmake opencv-2.4.13.7/cmake/OpenCVConfig.cmake
|
||||
--- opencv-2.4.13.7.orig/cmake/OpenCVConfig.cmake 2018-07-02 20:41:56.000000000 +0800
|
||||
+++ opencv-2.4.13.7/cmake/OpenCVConfig.cmake 2023-08-13 22:11:10.193931771 +0800
|
||||
@@ -85,6 +85,10 @@ elseif(MSVC)
|
||||
set(OpenCV_RUNTIME vc14)
|
||||
elseif(MSVC_VERSION MATCHES "^191[0-9]$")
|
||||
set(OpenCV_RUNTIME vc15)
|
||||
+ elseif(MSVC_VERSION MATCHES "^192[0-9]$")
|
||||
+ set(OpenCV_RUNTIME vc16)
|
||||
+ elseif(MSVC_VERSION MATCHES "^193[0-9]$")
|
||||
+ set(OpenCV_RUNTIME vc17)
|
||||
endif()
|
||||
elseif(MINGW)
|
||||
set(OpenCV_RUNTIME mingw)
|
||||
diff -Nuarp opencv-2.4.13.7.orig/cmake/OpenCVDetectCXXCompiler.cmake opencv-2.4.13.7/cmake/OpenCVDetectCXXCompiler.cmake
|
||||
--- opencv-2.4.13.7.orig/cmake/OpenCVDetectCXXCompiler.cmake 2018-07-02 20:41:56.000000000 +0800
|
||||
+++ opencv-2.4.13.7/cmake/OpenCVDetectCXXCompiler.cmake 2023-08-13 22:11:03.358965110 +0800
|
||||
@@ -104,6 +104,10 @@ elseif(MSVC)
|
||||
set(OpenCV_RUNTIME vc14)
|
||||
elseif(MSVC_VERSION MATCHES "^191[0-9]$")
|
||||
set(OpenCV_RUNTIME vc15)
|
||||
+ elseif(MSVC_VERSION MATCHES "^192[0-9]$")
|
||||
+ set(OpenCV_RUNTIME vc16)
|
||||
+ elseif(MSVC_VERSION MATCHES "^193[0-9]$")
|
||||
+ set(OpenCV_RUNTIME vc17)
|
||||
endif()
|
||||
elseif(MINGW)
|
||||
set(OpenCV_RUNTIME mingw)
|
@@ -1,12 +0,0 @@
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/core/src/persistence.hpp opencv-3.4.18/modules/core/src/persistence.hpp
|
||||
--- opencv-3.4.18.orig/modules/core/src/persistence.hpp 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/core/src/persistence.hpp 2022-11-16 17:35:02.415050987 +0800
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <string>
|
||||
#include <iterator>
|
||||
|
||||
-#define USE_ZLIB 1
|
||||
+#define USE_ZLIB 0
|
||||
#if USE_ZLIB
|
||||
# ifndef _LFS64_LARGEFILE
|
||||
# define _LFS64_LARGEFILE 0
|
11
opencv-3.4.20-fix-emscripten-include.patch
Normal file
11
opencv-3.4.20-fix-emscripten-include.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/include/opencv2/core/hal/intrin_wasm.hpp opencv-3.4.20/modules/core/include/opencv2/core/hal/intrin_wasm.hpp
|
||||
--- opencv-3.4.20.orig/modules/core/include/opencv2/core/hal/intrin_wasm.hpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/include/opencv2/core/hal/intrin_wasm.hpp 2023-08-06 19:09:44.971191540 +0800
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <limits>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
+#include <emscripten/version.h>
|
||||
#include "opencv2/core/saturate.hpp"
|
||||
|
||||
#define CV_SIMD128 1
|
14
opencv-3.4.20-link-openmp.patch
Normal file
14
opencv-3.4.20-link-openmp.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/CMakeLists.txt opencv-3.4.20/modules/core/CMakeLists.txt
|
||||
--- opencv-3.4.20.orig/modules/core/CMakeLists.txt 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/CMakeLists.txt 2023-08-13 19:39:56.659037366 +0800
|
||||
@@ -31,6 +31,10 @@ if(HAVE_TBB)
|
||||
list(APPEND extra_libs tbb)
|
||||
endif()
|
||||
|
||||
+if(HAVE_OPENMP AND DEFINED OpenMP_CXX_LIBRARIES AND OpenMP_CXX_LIBRARIES)
|
||||
+ list(APPEND extra_libs ${OpenMP_CXX_LIBRARIES})
|
||||
+endif()
|
||||
+
|
||||
if(DEFINED WINRT AND NOT DEFINED ENABLE_WINRT_MODE_NATIVE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW")
|
||||
endif()
|
@@ -1,6 +1,6 @@
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/core/include/opencv2/core/bindings_utils.hpp opencv-3.4.18/modules/core/include/opencv2/core/bindings_utils.hpp
|
||||
--- opencv-3.4.18.orig/modules/core/include/opencv2/core/bindings_utils.hpp 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/core/include/opencv2/core/bindings_utils.hpp 2022-11-16 17:32:38.096053227 +0800
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/include/opencv2/core/bindings_utils.hpp opencv-3.4.20/modules/core/include/opencv2/core/bindings_utils.hpp
|
||||
--- opencv-3.4.20.orig/modules/core/include/opencv2/core/bindings_utils.hpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/include/opencv2/core/bindings_utils.hpp 2023-08-06 11:05:19.958163689 +0800
|
||||
@@ -185,12 +185,6 @@ void generateVectorOfMat(size_t len, int
|
||||
}
|
||||
|
||||
@@ -29,9 +29,9 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/include/opencv2/core/bindings_utils.
|
||||
return p.getArrayResult();
|
||||
}
|
||||
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/core/src/async.cpp opencv-3.4.18/modules/core/src/async.cpp
|
||||
--- opencv-3.4.18.orig/modules/core/src/async.cpp 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/core/src/async.cpp 2022-11-16 17:32:38.097053227 +0800
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/src/async.cpp opencv-3.4.20/modules/core/src/async.cpp
|
||||
--- opencv-3.4.20.orig/modules/core/src/async.cpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/src/async.cpp 2023-08-06 11:05:19.958163689 +0800
|
||||
@@ -118,7 +118,6 @@ struct AsyncArray::Impl
|
||||
if (has_exception)
|
||||
{
|
||||
@@ -40,9 +40,9 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/async.cpp opencv-3.4.18/modules/
|
||||
}
|
||||
CV_Error(Error::StsInternal, "AsyncArray: invalid state of 'has_result = true'");
|
||||
}
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/core/src/bindings_utils.cpp opencv-3.4.18/modules/core/src/bindings_utils.cpp
|
||||
--- opencv-3.4.18.orig/modules/core/src/bindings_utils.cpp 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/core/src/bindings_utils.cpp 2022-11-16 17:32:38.098053227 +0800
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/src/bindings_utils.cpp opencv-3.4.20/modules/core/src/bindings_utils.cpp
|
||||
--- opencv-3.4.20.orig/modules/core/src/bindings_utils.cpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/src/bindings_utils.cpp 2023-08-06 11:05:19.958163689 +0800
|
||||
@@ -15,7 +15,7 @@ String dumpInputArray(InputArray argumen
|
||||
return "InputArray: noArray()";
|
||||
std::ostringstream ss;
|
||||
@@ -123,9 +123,9 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/bindings_utils.cpp opencv-3.4.18
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/core/src/command_line_parser.cpp opencv-3.4.18/modules/core/src/command_line_parser.cpp
|
||||
--- opencv-3.4.18.orig/modules/core/src/command_line_parser.cpp 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/core/src/command_line_parser.cpp 2022-11-16 17:32:38.099053227 +0800
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/src/command_line_parser.cpp opencv-3.4.20/modules/core/src/command_line_parser.cpp
|
||||
--- opencv-3.4.20.orig/modules/core/src/command_line_parser.cpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/src/command_line_parser.cpp 2023-08-06 11:05:19.958163689 +0800
|
||||
@@ -124,7 +124,6 @@ static void from_str(const String& str,
|
||||
|
||||
void CommandLineParser::getByName(const String& name, bool space_delete, int type, void* dst) const
|
||||
@@ -222,9 +222,9 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/command_line_parser.cpp opencv-3
|
||||
}
|
||||
|
||||
return vec;
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/core/src/glob.cpp opencv-3.4.18/modules/core/src/glob.cpp
|
||||
--- opencv-3.4.18.orig/modules/core/src/glob.cpp 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/core/src/glob.cpp 2022-11-16 17:32:38.099053227 +0800
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/src/glob.cpp opencv-3.4.20/modules/core/src/glob.cpp
|
||||
--- opencv-3.4.20.orig/modules/core/src/glob.cpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/src/glob.cpp 2023-08-06 11:05:19.958163689 +0800
|
||||
@@ -231,7 +231,6 @@ static void glob_rec(const cv::String& d
|
||||
if ((dir = opendir (directory.c_str())) != 0)
|
||||
{
|
||||
@@ -245,9 +245,9 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/glob.cpp opencv-3.4.18/modules/c
|
||||
closedir(dir);
|
||||
}
|
||||
else
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/core/src/matrix.cpp opencv-3.4.18/modules/core/src/matrix.cpp
|
||||
--- opencv-3.4.18.orig/modules/core/src/matrix.cpp 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/core/src/matrix.cpp 2022-11-16 17:32:38.100053227 +0800
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/src/matrix.cpp opencv-3.4.20/modules/core/src/matrix.cpp
|
||||
--- opencv-3.4.20.orig/modules/core/src/matrix.cpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/src/matrix.cpp 2023-08-06 11:05:19.958163689 +0800
|
||||
@@ -640,18 +640,10 @@ void Mat::create(int d, const int* _size
|
||||
#endif
|
||||
if(!a)
|
||||
@@ -287,10 +287,10 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/matrix.cpp opencv-3.4.18/modules
|
||||
|
||||
updateContinuityFlag();
|
||||
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/core/src/parallel.cpp opencv-3.4.18/modules/core/src/parallel.cpp
|
||||
--- opencv-3.4.18.orig/modules/core/src/parallel.cpp 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/core/src/parallel.cpp 2022-11-16 17:32:38.101053227 +0800
|
||||
@@ -335,29 +335,9 @@ namespace {
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/src/parallel.cpp opencv-3.4.20/modules/core/src/parallel.cpp
|
||||
--- opencv-3.4.20.orig/modules/core/src/parallel.cpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/src/parallel.cpp 2023-08-06 11:05:19.959163685 +0800
|
||||
@@ -338,29 +338,9 @@ namespace {
|
||||
CV_TRACE_ARG_VALUE(range_end, "range.end", (int64)r.end);
|
||||
#endif
|
||||
|
||||
@@ -320,7 +320,7 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/parallel.cpp opencv-3.4.18/modul
|
||||
|
||||
if (!ctx.is_rng_used && !(cv::theRNG() == ctx.rng))
|
||||
ctx.is_rng_used = true;
|
||||
@@ -490,16 +470,10 @@ void parallel_for_(const cv::Range& rang
|
||||
@@ -493,16 +473,10 @@ void parallel_for_(const cv::Range& rang
|
||||
isNotNestedRegion = CV_XADD(&flagNestedParallelFor, 1) == 0;
|
||||
if (isNotNestedRegion)
|
||||
{
|
||||
@@ -337,9 +337,9 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/parallel.cpp opencv-3.4.18/modul
|
||||
}
|
||||
else // nested parallel_for_() calls are not parallelized
|
||||
#endif // CV_PARALLEL_FRAMEWORK
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/core/src/persistence_c.cpp opencv-3.4.18/modules/core/src/persistence_c.cpp
|
||||
--- opencv-3.4.18.orig/modules/core/src/persistence_c.cpp 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/core/src/persistence_c.cpp 2022-11-16 17:32:38.102053227 +0800
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/src/persistence_c.cpp opencv-3.4.20/modules/core/src/persistence_c.cpp
|
||||
--- opencv-3.4.20.orig/modules/core/src/persistence_c.cpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/src/persistence_c.cpp 2023-08-06 11:05:19.959163685 +0800
|
||||
@@ -456,17 +456,10 @@ cvOpenFileStorage(const char* query, CvM
|
||||
CV_Assert(fs);
|
||||
memset( fs, 0, sizeof(*fs));
|
||||
@@ -358,9 +358,9 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/persistence_c.cpp opencv-3.4.18/
|
||||
}
|
||||
|
||||
/* closes file storage and deallocates buffers */
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/core/src/persistence_types.cpp opencv-3.4.18/modules/core/src/persistence_types.cpp
|
||||
--- opencv-3.4.18.orig/modules/core/src/persistence_types.cpp 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/core/src/persistence_types.cpp 2022-11-16 17:32:38.102053227 +0800
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/src/persistence_types.cpp opencv-3.4.20/modules/core/src/persistence_types.cpp
|
||||
--- opencv-3.4.20.orig/modules/core/src/persistence_types.cpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/src/persistence_types.cpp 2023-08-06 11:05:19.959163685 +0800
|
||||
@@ -756,13 +756,9 @@ static void* icvReadSeq( CvFileStorage*
|
||||
flags |= CV_SEQ_FLAG_HOLE;
|
||||
if( !strstr(flags_str, "untyped") )
|
||||
@@ -375,10 +375,10 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/persistence_types.cpp opencv-3.4
|
||||
}
|
||||
}
|
||||
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/core/src/system.cpp opencv-3.4.18/modules/core/src/system.cpp
|
||||
--- opencv-3.4.18.orig/modules/core/src/system.cpp 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/core/src/system.cpp 2022-11-16 17:32:38.103053227 +0800
|
||||
@@ -1214,8 +1214,6 @@ void error( const Exception& exc )
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/src/system.cpp opencv-3.4.20/modules/core/src/system.cpp
|
||||
--- opencv-3.4.20.orig/modules/core/src/system.cpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/src/system.cpp 2023-08-06 11:05:19.959163685 +0800
|
||||
@@ -1259,8 +1259,6 @@ void error( const Exception& exc )
|
||||
static volatile int* p = 0;
|
||||
*p = 0;
|
||||
}
|
||||
@@ -387,7 +387,7 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/system.cpp opencv-3.4.18/modules
|
||||
}
|
||||
|
||||
void error(int _code, const String& _err, const char* _func, const char* _file, int _line)
|
||||
@@ -2094,7 +2092,7 @@ inline bool parseOption(const std::strin
|
||||
@@ -2139,7 +2137,7 @@ inline bool parseOption(const std::strin
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -396,7 +396,7 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/system.cpp opencv-3.4.18/modules
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -2119,7 +2117,7 @@ inline size_t parseOption(const std::str
|
||||
@@ -2164,7 +2162,7 @@ inline size_t parseOption(const std::str
|
||||
return v * 1024 * 1024;
|
||||
else if (suffixStr == "KB" || suffixStr == "Kb" || suffixStr == "kb")
|
||||
return v * 1024;
|
||||
@@ -405,7 +405,7 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/system.cpp opencv-3.4.18/modules
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -2162,16 +2160,11 @@ static inline const char * envRead(const
|
||||
@@ -2207,16 +2205,11 @@ static inline const char * envRead(const
|
||||
template<typename T>
|
||||
inline T read(const std::string & k, const T & defaultValue)
|
||||
{
|
||||
@@ -422,9 +422,9 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/system.cpp opencv-3.4.18/modules
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/core/src/umatrix.cpp opencv-3.4.18/modules/core/src/umatrix.cpp
|
||||
--- opencv-3.4.18.orig/modules/core/src/umatrix.cpp 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/core/src/umatrix.cpp 2022-11-16 17:32:38.103053227 +0800
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/src/umatrix.cpp opencv-3.4.20/modules/core/src/umatrix.cpp
|
||||
--- opencv-3.4.20.orig/modules/core/src/umatrix.cpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/src/umatrix.cpp 2023-08-06 11:05:19.959163685 +0800
|
||||
@@ -516,14 +516,9 @@ UMat Mat::getUMat(int accessFlags, UMatU
|
||||
new_u->originalUMatData = u;
|
||||
}
|
||||
@@ -503,9 +503,9 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/umatrix.cpp opencv-3.4.18/module
|
||||
CV_XADD(&u->refcount, -1);
|
||||
CV_Assert(u->data != 0 && "Error mapping of UMat to host memory.");
|
||||
return Mat();
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/core/src/utils/filesystem.cpp opencv-3.4.18/modules/core/src/utils/filesystem.cpp
|
||||
--- opencv-3.4.18.orig/modules/core/src/utils/filesystem.cpp 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/core/src/utils/filesystem.cpp 2022-11-16 17:32:38.103053227 +0800
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/src/utils/filesystem.cpp opencv-3.4.20/modules/core/src/utils/filesystem.cpp
|
||||
--- opencv-3.4.20.orig/modules/core/src/utils/filesystem.cpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/src/utils/filesystem.cpp 2023-08-06 11:05:19.960163681 +0800
|
||||
@@ -492,14 +492,9 @@ cv::String getCacheDirectory(const char*
|
||||
&& !utils::fs::isDirectory(default_cache_path))
|
||||
{
|
||||
@@ -521,9 +521,9 @@ diff -Nuarp opencv-3.4.18.orig/modules/core/src/utils/filesystem.cpp opencv-3.4.
|
||||
if (!existedCacheDirs.empty())
|
||||
{
|
||||
CV_LOG_WARNING(NULL, "Creating new OpenCV cache directory: " << default_cache_path);
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/imgproc/src/contours.cpp opencv-3.4.18/modules/imgproc/src/contours.cpp
|
||||
--- opencv-3.4.18.orig/modules/imgproc/src/contours.cpp 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/imgproc/src/contours.cpp 2022-11-16 17:32:38.103053227 +0800
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/imgproc/src/contours.cpp opencv-3.4.20/modules/imgproc/src/contours.cpp
|
||||
--- opencv-3.4.20.orig/modules/imgproc/src/contours.cpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/imgproc/src/contours.cpp 2023-08-06 11:05:19.960163681 +0800
|
||||
@@ -1761,7 +1761,6 @@ cvFindContours_Impl( void* img, CvMemS
|
||||
}
|
||||
else
|
12
opencv-3.4.20-no-zlib.patch
Normal file
12
opencv-3.4.20-no-zlib.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/src/persistence.hpp opencv-3.4.20/modules/core/src/persistence.hpp
|
||||
--- opencv-3.4.20.orig/modules/core/src/persistence.hpp 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/src/persistence.hpp 2023-08-06 11:09:02.718289684 +0800
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <string>
|
||||
#include <iterator>
|
||||
|
||||
-#define USE_ZLIB 1
|
||||
+#define USE_ZLIB 0
|
||||
#if USE_ZLIB
|
||||
# ifndef _LFS64_LARGEFILE
|
||||
# define _LFS64_LARGEFILE 0
|
@@ -1,7 +1,7 @@
|
||||
diff -Nuarp opencv-3.4.18.orig/modules/core/include/opencv2/core/cvdef.h opencv-3.4.18/modules/core/include/opencv2/core/cvdef.h
|
||||
--- opencv-3.4.18.orig/modules/core/include/opencv2/core/cvdef.h 2022-06-05 00:52:44.000000000 +0800
|
||||
+++ opencv-3.4.18/modules/core/include/opencv2/core/cvdef.h 2022-11-16 17:36:04.411050025 +0800
|
||||
@@ -532,33 +532,7 @@ Cv64suf;
|
||||
diff -Nuarp opencv-3.4.20.orig/modules/core/include/opencv2/core/cvdef.h opencv-3.4.20/modules/core/include/opencv2/core/cvdef.h
|
||||
--- opencv-3.4.20.orig/modules/core/include/opencv2/core/cvdef.h 2023-06-27 19:29:13.000000000 +0800
|
||||
+++ opencv-3.4.20/modules/core/include/opencv2/core/cvdef.h 2023-08-06 11:12:38.619404492 +0800
|
||||
@@ -534,33 +534,7 @@ Cv64suf;
|
||||
* exchange-add operation for atomic operations on reference counters *
|
||||
\****************************************************************************************/
|
||||
|
@@ -1,12 +0,0 @@
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/src/persistence.hpp opencv-4.6.0/modules/core/src/persistence.hpp
|
||||
--- opencv-4.6.0.orig/modules/core/src/persistence.hpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/src/persistence.hpp 2022-11-16 17:40:26.104045965 +0800
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <string>
|
||||
#include <iterator>
|
||||
|
||||
-#define USE_ZLIB 1
|
||||
+#define USE_ZLIB 0
|
||||
#if USE_ZLIB
|
||||
# ifndef _LFS64_LARGEFILE
|
||||
# define _LFS64_LARGEFILE 0
|
11
opencv-4.8.0-fix-emscripten-include.patch
Normal file
11
opencv-4.8.0-fix-emscripten-include.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/include/opencv2/core/hal/intrin_wasm.hpp opencv-4.8.0/modules/core/include/opencv2/core/hal/intrin_wasm.hpp
|
||||
--- opencv-4.8.0.orig/modules/core/include/opencv2/core/hal/intrin_wasm.hpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/include/opencv2/core/hal/intrin_wasm.hpp 2023-08-06 19:11:33.503734508 +0800
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <limits>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
+#include <emscripten/version.h>
|
||||
#include "opencv2/core/saturate.hpp"
|
||||
|
||||
#define CV_SIMD128 1
|
@@ -1,7 +1,7 @@
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/include/opencv2/core/bindings_utils.hpp opencv-4.6.0/modules/core/include/opencv2/core/bindings_utils.hpp
|
||||
--- opencv-4.6.0.orig/modules/core/include/opencv2/core/bindings_utils.hpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/include/opencv2/core/bindings_utils.hpp 2022-11-16 17:37:13.970048946 +0800
|
||||
@@ -191,12 +191,6 @@ void generateVectorOfMat(size_t len, int
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/include/opencv2/core/bindings_utils.hpp opencv-4.8.0/modules/core/include/opencv2/core/bindings_utils.hpp
|
||||
--- opencv-4.8.0.orig/modules/core/include/opencv2/core/bindings_utils.hpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/include/opencv2/core/bindings_utils.hpp 2023-08-06 11:18:38.666914922 +0800
|
||||
@@ -199,12 +199,6 @@ void generateVectorOfMat(size_t len, int
|
||||
}
|
||||
|
||||
CV_WRAP static inline
|
||||
@@ -14,7 +14,7 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/include/opencv2/core/bindings_utils.h
|
||||
AsyncArray testAsyncArray(InputArray argument)
|
||||
{
|
||||
AsyncPromise p;
|
||||
@@ -208,14 +202,6 @@ CV_WRAP static inline
|
||||
@@ -216,14 +210,6 @@ CV_WRAP static inline
|
||||
AsyncArray testAsyncException()
|
||||
{
|
||||
AsyncPromise p;
|
||||
@@ -29,9 +29,9 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/include/opencv2/core/bindings_utils.h
|
||||
return p.getArrayResult();
|
||||
}
|
||||
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/include/opencv2/core/ocl.hpp opencv-4.6.0/modules/core/include/opencv2/core/ocl.hpp
|
||||
--- opencv-4.6.0.orig/modules/core/include/opencv2/core/ocl.hpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/include/opencv2/core/ocl.hpp 2022-11-16 17:37:13.971048946 +0800
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/include/opencv2/core/ocl.hpp opencv-4.8.0/modules/core/include/opencv2/core/ocl.hpp
|
||||
--- opencv-4.8.0.orig/modules/core/include/opencv2/core/ocl.hpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/include/opencv2/core/ocl.hpp 2023-08-06 11:18:38.666914922 +0800
|
||||
@@ -302,21 +302,6 @@ public:
|
||||
|
||||
void release();
|
||||
@@ -54,9 +54,9 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/include/opencv2/core/ocl.hpp opencv-4
|
||||
struct Impl;
|
||||
inline Impl* getImpl() const { return (Impl*)p; }
|
||||
inline bool empty() const { return !p; }
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/src/async.cpp opencv-4.6.0/modules/core/src/async.cpp
|
||||
--- opencv-4.6.0.orig/modules/core/src/async.cpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/src/async.cpp 2022-11-16 17:37:13.972048946 +0800
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/src/async.cpp opencv-4.8.0/modules/core/src/async.cpp
|
||||
--- opencv-4.8.0.orig/modules/core/src/async.cpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/src/async.cpp 2023-08-06 11:18:38.666914922 +0800
|
||||
@@ -119,7 +119,6 @@ struct AsyncArray::Impl
|
||||
if (has_exception)
|
||||
{
|
||||
@@ -65,9 +65,9 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/async.cpp opencv-4.6.0/modules/co
|
||||
}
|
||||
CV_Error(Error::StsInternal, "AsyncArray: invalid state of 'has_result = true'");
|
||||
}
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/src/bindings_utils.cpp opencv-4.6.0/modules/core/src/bindings_utils.cpp
|
||||
--- opencv-4.6.0.orig/modules/core/src/bindings_utils.cpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/src/bindings_utils.cpp 2022-11-16 17:37:13.973048946 +0800
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/src/bindings_utils.cpp opencv-4.8.0/modules/core/src/bindings_utils.cpp
|
||||
--- opencv-4.8.0.orig/modules/core/src/bindings_utils.cpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/src/bindings_utils.cpp 2023-08-06 11:18:38.666914922 +0800
|
||||
@@ -17,7 +17,7 @@ String dumpInputArray(InputArray argumen
|
||||
return "InputArray: noArray()";
|
||||
std::ostringstream ss;
|
||||
@@ -148,9 +148,9 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/bindings_utils.cpp opencv-4.6.0/m
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/src/command_line_parser.cpp opencv-4.6.0/modules/core/src/command_line_parser.cpp
|
||||
--- opencv-4.6.0.orig/modules/core/src/command_line_parser.cpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/src/command_line_parser.cpp 2022-11-16 17:37:13.973048946 +0800
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/src/command_line_parser.cpp opencv-4.8.0/modules/core/src/command_line_parser.cpp
|
||||
--- opencv-4.8.0.orig/modules/core/src/command_line_parser.cpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/src/command_line_parser.cpp 2023-08-06 11:18:38.667914918 +0800
|
||||
@@ -119,7 +119,6 @@ static void from_str(const String& str,
|
||||
|
||||
void CommandLineParser::getByName(const String& name, bool space_delete, Param type, void* dst) const
|
||||
@@ -247,9 +247,9 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/command_line_parser.cpp opencv-4.
|
||||
}
|
||||
|
||||
return vec;
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/src/glob.cpp opencv-4.6.0/modules/core/src/glob.cpp
|
||||
--- opencv-4.6.0.orig/modules/core/src/glob.cpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/src/glob.cpp 2022-11-16 17:37:13.974048946 +0800
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/src/glob.cpp opencv-4.8.0/modules/core/src/glob.cpp
|
||||
--- opencv-4.8.0.orig/modules/core/src/glob.cpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/src/glob.cpp 2023-08-06 11:18:38.667914918 +0800
|
||||
@@ -243,7 +243,6 @@ static void glob_rec(const cv::String& d
|
||||
if ((dir = opendir (directory.c_str())) != 0)
|
||||
{
|
||||
@@ -270,9 +270,9 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/glob.cpp opencv-4.6.0/modules/cor
|
||||
closedir(dir);
|
||||
}
|
||||
else
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/src/matrix.cpp opencv-4.6.0/modules/core/src/matrix.cpp
|
||||
--- opencv-4.6.0.orig/modules/core/src/matrix.cpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/src/matrix.cpp 2022-11-16 17:37:13.974048946 +0800
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/src/matrix.cpp opencv-4.8.0/modules/core/src/matrix.cpp
|
||||
--- opencv-4.8.0.orig/modules/core/src/matrix.cpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/src/matrix.cpp 2023-08-06 11:18:38.667914918 +0800
|
||||
@@ -698,18 +698,10 @@ void Mat::create(int d, const int* _size
|
||||
#endif
|
||||
if(!a)
|
||||
@@ -312,9 +312,9 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/matrix.cpp opencv-4.6.0/modules/c
|
||||
|
||||
updateContinuityFlag();
|
||||
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/src/ocl_disabled.impl.hpp opencv-4.6.0/modules/core/src/ocl_disabled.impl.hpp
|
||||
--- opencv-4.6.0.orig/modules/core/src/ocl_disabled.impl.hpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/src/ocl_disabled.impl.hpp 2022-11-16 17:37:13.974048946 +0800
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/src/ocl_disabled.impl.hpp opencv-4.8.0/modules/core/src/ocl_disabled.impl.hpp
|
||||
--- opencv-4.8.0.orig/modules/core/src/ocl_disabled.impl.hpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/src/ocl_disabled.impl.hpp 2023-08-06 11:18:38.667914918 +0800
|
||||
@@ -177,11 +177,6 @@ void* Context::getOpenCLContextProperty(
|
||||
bool Context::useSVM() const { return false; }
|
||||
void Context::setUseSVM(bool enabled) { }
|
||||
@@ -327,9 +327,9 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/ocl_disabled.impl.hpp opencv-4.6.
|
||||
/* static */ Context Context::fromHandle(void* context) { OCL_NOT_AVAILABLE(); }
|
||||
/* static */ Context Context::fromDevice(const ocl::Device& device) { OCL_NOT_AVAILABLE(); }
|
||||
/* static */ Context Context::create(const std::string& configuration) { OCL_NOT_AVAILABLE(); }
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/src/parallel/parallel.cpp opencv-4.6.0/modules/core/src/parallel/parallel.cpp
|
||||
--- opencv-4.6.0.orig/modules/core/src/parallel/parallel.cpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/src/parallel/parallel.cpp 2022-11-16 17:37:13.975048946 +0800
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/src/parallel/parallel.cpp opencv-4.8.0/modules/core/src/parallel/parallel.cpp
|
||||
--- opencv-4.8.0.orig/modules/core/src/parallel/parallel.cpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/src/parallel/parallel.cpp 2023-08-06 11:18:38.667914918 +0800
|
||||
@@ -60,7 +60,6 @@ std::shared_ptr<ParallelForAPI> createPa
|
||||
}
|
||||
isKnown = true;
|
||||
@@ -353,9 +353,9 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/parallel/parallel.cpp opencv-4.6.
|
||||
}
|
||||
if (name.empty())
|
||||
{
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp opencv-4.6.0/modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp
|
||||
--- opencv-4.6.0.orig/modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp 2022-11-16 17:37:13.975048946 +0800
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp opencv-4.8.0/modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp
|
||||
--- opencv-4.8.0.orig/modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp 2023-08-06 11:18:38.667914918 +0800
|
||||
@@ -155,15 +155,10 @@ protected:
|
||||
void initBackend()
|
||||
{
|
||||
@@ -391,10 +391,10 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/parallel/plugin_parallel_wrapper.
|
||||
}
|
||||
}
|
||||
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/src/parallel.cpp opencv-4.6.0/modules/core/src/parallel.cpp
|
||||
--- opencv-4.6.0.orig/modules/core/src/parallel.cpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/src/parallel.cpp 2022-11-16 17:37:13.975048946 +0800
|
||||
@@ -347,29 +347,9 @@ namespace {
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/src/parallel.cpp opencv-4.8.0/modules/core/src/parallel.cpp
|
||||
--- opencv-4.8.0.orig/modules/core/src/parallel.cpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/src/parallel.cpp 2023-08-06 11:18:38.667914918 +0800
|
||||
@@ -351,29 +351,9 @@ namespace {
|
||||
CV_TRACE_ARG_VALUE(range_end, "range.end", (int64)r.end);
|
||||
#endif
|
||||
|
||||
@@ -424,7 +424,7 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/parallel.cpp opencv-4.6.0/modules
|
||||
|
||||
if (!ctx.is_rng_used && !(cv::theRNG() == ctx.rng))
|
||||
ctx.is_rng_used = true;
|
||||
@@ -515,16 +495,10 @@ void parallel_for_(const cv::Range& rang
|
||||
@@ -519,16 +499,10 @@ void parallel_for_(const cv::Range& rang
|
||||
isNotNestedRegion = !flagNestedParallelFor.exchange(true);
|
||||
if (isNotNestedRegion)
|
||||
{
|
||||
@@ -441,10 +441,10 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/parallel.cpp opencv-4.6.0/modules
|
||||
}
|
||||
else // nested parallel_for_() calls are not parallelized
|
||||
{
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/src/persistence.cpp opencv-4.6.0/modules/core/src/persistence.cpp
|
||||
--- opencv-4.6.0.orig/modules/core/src/persistence.cpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/src/persistence.cpp 2022-11-16 17:39:49.543046532 +0800
|
||||
@@ -697,7 +697,7 @@ bool FileStorage::Impl::open(const char
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/src/persistence.cpp opencv-4.8.0/modules/core/src/persistence.cpp
|
||||
--- opencv-4.8.0.orig/modules/core/src/persistence.cpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/src/persistence.cpp 2023-08-06 11:18:38.668914913 +0800
|
||||
@@ -704,7 +704,7 @@ bool FileStorage::Impl::open(const char
|
||||
strbufpos = bufOffset;
|
||||
bufofs = 0;
|
||||
|
||||
@@ -453,7 +453,7 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/persistence.cpp opencv-4.6.0/modu
|
||||
char *ptr = bufferStart();
|
||||
ptr[0] = ptr[1] = ptr[2] = '\0';
|
||||
FileNode root_nodes(fs_ext, 0, 0);
|
||||
@@ -738,13 +738,6 @@ bool FileStorage::Impl::open(const char
|
||||
@@ -745,13 +745,6 @@ bool FileStorage::Impl::open(const char
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -467,7 +467,7 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/persistence.cpp opencv-4.6.0/modu
|
||||
|
||||
// release resources that we do not need anymore
|
||||
closeFile();
|
||||
@@ -1877,18 +1870,12 @@ FileStorage::~FileStorage()
|
||||
@@ -1884,18 +1877,12 @@ FileStorage::~FileStorage()
|
||||
|
||||
bool FileStorage::open(const String& filename, int flags, const String& encoding)
|
||||
{
|
||||
@@ -486,10 +486,10 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/persistence.cpp opencv-4.6.0/modu
|
||||
}
|
||||
|
||||
bool FileStorage::isOpened() const { return p->is_opened; }
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/src/system.cpp opencv-4.6.0/modules/core/src/system.cpp
|
||||
--- opencv-4.6.0.orig/modules/core/src/system.cpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/src/system.cpp 2022-11-16 17:37:13.976048946 +0800
|
||||
@@ -1240,7 +1240,6 @@ void error( const Exception& exc )
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/src/system.cpp opencv-4.8.0/modules/core/src/system.cpp
|
||||
--- opencv-4.8.0.orig/modules/core/src/system.cpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/src/system.cpp 2023-08-06 11:18:38.668914913 +0800
|
||||
@@ -1280,7 +1280,6 @@ void error( const Exception& exc )
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/system.cpp opencv-4.6.0/modules/c
|
||||
#ifdef __GNUC__
|
||||
# if !defined __clang__ && !defined __APPLE__
|
||||
// this suppresses this warning: "noreturn" function does return [enabled by default]
|
||||
@@ -2046,15 +2045,9 @@ void* TLSDataContainer::getData() const
|
||||
@@ -2082,15 +2081,9 @@ void* TLSDataContainer::getData() const
|
||||
{
|
||||
// Create new data instance and save it to TLS storage
|
||||
pData = createDataInstance();
|
||||
@@ -513,7 +513,7 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/system.cpp opencv-4.6.0/modules/c
|
||||
}
|
||||
return pData;
|
||||
}
|
||||
@@ -2158,7 +2151,7 @@ inline bool parseOption(const std::strin
|
||||
@@ -2194,7 +2187,7 @@ inline bool parseOption(const std::strin
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -522,7 +522,7 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/system.cpp opencv-4.6.0/modules/c
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -2179,7 +2172,7 @@ inline size_t parseOption(const std::str
|
||||
@@ -2215,7 +2208,7 @@ inline size_t parseOption(const std::str
|
||||
return v * 1024 * 1024;
|
||||
else if (suffixStr == "KB" || suffixStr == "Kb" || suffixStr == "kb")
|
||||
return v * 1024;
|
||||
@@ -531,7 +531,7 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/system.cpp opencv-4.6.0/modules/c
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -2222,16 +2215,11 @@ static inline const char * envRead(const
|
||||
@@ -2258,16 +2251,11 @@ static inline const char * envRead(const
|
||||
template<typename T>
|
||||
inline T read(const std::string & k, const T & defaultValue)
|
||||
{
|
||||
@@ -548,9 +548,9 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/system.cpp opencv-4.6.0/modules/c
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/src/umatrix.cpp opencv-4.6.0/modules/core/src/umatrix.cpp
|
||||
--- opencv-4.6.0.orig/modules/core/src/umatrix.cpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/src/umatrix.cpp 2022-11-16 17:37:13.976048946 +0800
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/src/umatrix.cpp opencv-4.8.0/modules/core/src/umatrix.cpp
|
||||
--- opencv-4.8.0.orig/modules/core/src/umatrix.cpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/src/umatrix.cpp 2023-08-06 11:18:38.668914913 +0800
|
||||
@@ -602,14 +602,9 @@ UMat Mat::getUMat(AccessFlag accessFlags
|
||||
new_u->originalUMatData = u;
|
||||
}
|
||||
@@ -629,9 +629,9 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/umatrix.cpp opencv-4.6.0/modules/
|
||||
CV_XADD(&u->refcount, -1);
|
||||
CV_Assert(u->data != 0 && "Error mapping of UMat to host memory.");
|
||||
return Mat();
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/src/utils/filesystem.cpp opencv-4.6.0/modules/core/src/utils/filesystem.cpp
|
||||
--- opencv-4.6.0.orig/modules/core/src/utils/filesystem.cpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/src/utils/filesystem.cpp 2022-11-16 17:37:13.976048946 +0800
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/src/utils/filesystem.cpp opencv-4.8.0/modules/core/src/utils/filesystem.cpp
|
||||
--- opencv-4.8.0.orig/modules/core/src/utils/filesystem.cpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/src/utils/filesystem.cpp 2023-08-06 11:18:38.668914913 +0800
|
||||
@@ -508,14 +508,9 @@ cv::String getCacheDirectory(const char*
|
||||
&& !utils::fs::isDirectory(default_cache_path))
|
||||
{
|
||||
@@ -647,9 +647,9 @@ diff -Nuarp opencv-4.6.0.orig/modules/core/src/utils/filesystem.cpp opencv-4.6.0
|
||||
if (!existedCacheDirs.empty())
|
||||
{
|
||||
CV_LOG_WARNING(NULL, "Creating new OpenCV cache directory: " << default_cache_path);
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/imgproc/src/contours.cpp opencv-4.6.0/modules/imgproc/src/contours.cpp
|
||||
--- opencv-4.6.0.orig/modules/imgproc/src/contours.cpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/imgproc/src/contours.cpp 2022-11-16 17:37:13.976048946 +0800
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/imgproc/src/contours.cpp opencv-4.8.0/modules/imgproc/src/contours.cpp
|
||||
--- opencv-4.8.0.orig/modules/imgproc/src/contours.cpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/imgproc/src/contours.cpp 2023-08-06 11:18:38.668914913 +0800
|
||||
@@ -1762,7 +1762,6 @@ cvFindContours_Impl( void* img, CvMemS
|
||||
}
|
||||
else
|
||||
@@ -671,9 +671,9 @@ diff -Nuarp opencv-4.6.0.orig/modules/imgproc/src/contours.cpp opencv-4.6.0/modu
|
||||
|
||||
*firstContour = cvEndFindContours( &scanner );
|
||||
}
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/video/src/tracking/detail/tracking_feature.cpp opencv-4.6.0/modules/video/src/tracking/detail/tracking_feature.cpp
|
||||
--- opencv-4.6.0.orig/modules/video/src/tracking/detail/tracking_feature.cpp 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/video/src/tracking/detail/tracking_feature.cpp 2022-11-16 17:37:13.977048946 +0800
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/video/src/tracking/detail/tracking_feature.cpp opencv-4.8.0/modules/video/src/tracking/detail/tracking_feature.cpp
|
||||
--- opencv-4.8.0.orig/modules/video/src/tracking/detail/tracking_feature.cpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/video/src/tracking/detail/tracking_feature.cpp 2023-08-06 11:18:38.668914913 +0800
|
||||
@@ -107,15 +107,9 @@ void CvHaarEvaluator::generateFeatures(i
|
||||
|
||||
CvHaarEvaluator::FeatureHaar::FeatureHaar(Size patchSize)
|
12
opencv-4.8.0-no-zlib.patch
Normal file
12
opencv-4.8.0-no-zlib.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/src/persistence.hpp opencv-4.8.0/modules/core/src/persistence.hpp
|
||||
--- opencv-4.8.0.orig/modules/core/src/persistence.hpp 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/src/persistence.hpp 2023-08-06 11:17:31.634207928 +0800
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <string>
|
||||
#include <iterator>
|
||||
|
||||
-#define USE_ZLIB 1
|
||||
+#define USE_ZLIB 0
|
||||
#if USE_ZLIB
|
||||
# ifndef _LFS64_LARGEFILE
|
||||
# define _LFS64_LARGEFILE 0
|
@@ -1,7 +1,7 @@
|
||||
diff -Nuarp opencv-4.6.0.orig/modules/core/include/opencv2/core/cvdef.h opencv-4.6.0/modules/core/include/opencv2/core/cvdef.h
|
||||
--- opencv-4.6.0.orig/modules/core/include/opencv2/core/cvdef.h 2022-06-05 08:32:44.000000000 +0800
|
||||
+++ opencv-4.6.0/modules/core/include/opencv2/core/cvdef.h 2022-11-16 17:40:47.232045637 +0800
|
||||
@@ -662,33 +662,7 @@ __CV_ENUM_FLAGS_BITWISE_XOR_EQ (EnumTy
|
||||
diff -Nuarp opencv-4.8.0.orig/modules/core/include/opencv2/core/cvdef.h opencv-4.8.0/modules/core/include/opencv2/core/cvdef.h
|
||||
--- opencv-4.8.0.orig/modules/core/include/opencv2/core/cvdef.h 2023-06-28 19:53:33.000000000 +0800
|
||||
+++ opencv-4.8.0/modules/core/include/opencv2/core/cvdef.h 2023-08-06 11:22:45.396836446 +0800
|
||||
@@ -669,33 +669,7 @@ __CV_ENUM_FLAGS_BITWISE_XOR_EQ (EnumTy
|
||||
* exchange-add operation for atomic operations on reference counters *
|
||||
\****************************************************************************************/
|
||||
|
17
test/CMakeLists.txt
Normal file
17
test/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
project(opencv-mobile-test)
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
# opencv4 requires c++11
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
if(APPLE OR IOS)
|
||||
# set OpenCV_DIR to where opencv2.framework resides
|
||||
find_library(OpenCV_LIBS NAMES opencv2 PATHS ${OpenCV_DIR})
|
||||
else()
|
||||
# set OpenCV_DIR to where OpenCVConfig.cmake resides
|
||||
find_package(OpenCV REQUIRED)
|
||||
endif()
|
||||
|
||||
add_executable(opencv-mobile-test main.cpp)
|
||||
|
||||
target_link_libraries(opencv-mobile-test ${OpenCV_LIBS})
|
14
test/main.cpp
Normal file
14
test/main.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
cv::Mat bgr = cv::imread("in.jpg", 1);
|
||||
|
||||
cv::resize(bgr, bgr, cv::Size(200, 200));
|
||||
|
||||
cv::imwrite("out.jpg", bgr);
|
||||
|
||||
return 0;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user