1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00
Commit Graph

2243 Commits

Author SHA1 Message Date
donotsleepy e640a9bfb8 Merge pull request #28995 from donotsleepy:fix/png-found-status-guard
cmake: fix PNG status display when BUILD_PNG=ON #28995

### Description

Fixes #28657.

On macOS (and other Apple platforms), `BUILD_PNG=ON` is the default. The build system correctly clears `PNG_FOUND` in `OpenCVFindLibsGrfmt.cmake` and builds libpng from the bundled source. However, during the subsequent module processing phase, a downstream `find_package(PNG)` call — triggered transitively via `include()` in the **same scope** — overwrites not only `PNG_FOUND`, but also `PNG_INCLUDE_DIR`, `PNG_LIBRARIES`, and `PNG_VERSION_STRING`.

#### Root Cause: FindPNG.cmake Has Asymmetric Guards

Reading CMake 4.3's `FindPNG.cmake` (`/opt/homebrew/share/cmake/Modules/FindPNG.cmake`) reveals:

| Variable | Guard? | Fate |
|---|---|---|
| `PNG_LIBRARY` | `if(NOT PNG_LIBRARY)` at line 138 — **guarded** | Preserved |
| `PNG_PNG_INCLUDE_DIR` | `find_path(...)` at line 115 — **no guard** | **Overwritten** |
| `PNG_INCLUDE_DIR` | Derived from `PNG_PNG_INCLUDE_DIR` | **Chain-overwritten** |
| `PNG_LIBRARIES` | Derived from `PNG_LIBRARY` + `ZLIB_LIBRARY` | **Partly overwritten** |
| `PNG_VERSION_STRING` | Parsed from `PNG_PNG_INCLUDE_DIR/png.h` | **Overwritten** |

`PNG_LIBRARY` survives because FindPNG itself checks `if(NOT PNG_LIBRARY)`. But `find_path(PNG_PNG_INCLUDE_DIR)` runs unconditionally — re-searching and overwriting the bundled path with the system one.

#### Fix: Three Coordinated Changes

**Part A — Status guard** (`CMakeLists.txt`): When `BUILD_PNG=ON`, pass `FALSE` as the condition to always show `"build"` regardless of `PNG_FOUND`.

**Part B — Variable lock** (`cmake/OpenCVFindLibsGrfmt.cmake`): After building from bundled source, lock `PNG_PNG_INCLUDE_DIR` as `CACHE INTERNAL`. CMake's `find_path()` checks the cache first — if the variable exists with a valid path, it skips re-searching. The system path is never found.

**Part C — Cache cleanup** (`cmake/OpenCVFindLibsGrfmt.cmake`): Add `PNG_PNG_INCLUDE_DIR` to the `ocv_clear_internal_cache_vars()` call in the `else` branch. When a user switches `BUILD_PNG=OFF`, the cached variable is cleared, allowing `find_path` to search for the system libpng normally. Prevents stale cache leakage across configuration changes.

#### Verification (macOS 26, CMake 4.3, Homebrew libpng 1.6.58)

```
BEFORE downstream find_package(PNG):
  PNG_LIBRARY   = libpng
  PNG_INCLUDE_DIR = .../3rdparty/libpng
  PNG_VERSION_STRING = 1.6.37

AFTER downstream find_package(PNG) [with fix]:
  PNG_LIBRARY   = libpng          ← preserved (FindPNG guard)
  PNG_INCLUDE_DIR starts with .../3rdparty/libpng  ← locked (Part B)
  PNG_VERSION_STRING = 1.6.53     ← from bundled png.h
  Status display: build (ver 1.6.53)  ← correct (Part A)
```

The full reproduction and analysis are in the attached `bugReview/` directory.

### Checklist

- [x] There is a reference to the original bug report and related work
- [x] The test case is in `bugReview/` directory
- [x] Tested on macOS 26 (arm64) with CMake 4.3 + Homebrew libpng 1.6.58
- [x] Cache hygiene verified for BUILD_PNG ON→OFF→ON transitions
2026-05-12 12:40:57 +03:00
Chevi koren 1f8257adad Merge pull request #28423 from Chevi-Koren:fix-clp-vcpkg-final
Fix Clp library detection for vcpkg on Windows #28423

## Problem

Building OpenCV with `WITH_CLP=ON` on Windows (vcpkg) fails:

LINK : fatal error LNK1181: cannot open input file 'libClp.lib'

vcpkg generates `Clp.lib` and `CoinUtils.lib`, but OpenCV expected `libClp.lib`/`libCoinUtils.lib`.

## Solution

Modernize CLP detection with a robust, platform-aware approach:

1. **CMake `find_package(Clp CONFIG)`**: detects vcpkg and uses imported targets (`Coin::Clp`, `Coin::CoinUtils`)
2. **Fallback**: pkg-config on Unix/Linux  
3. **Skip** Android/iOS

## Benefits

 Fixes Windows build with vcpkg  
 Uses modern CMake targets  
 Backward compatible with Unix/Linux  
 Safe for CI and mobile builds  
 Graceful fallback if CLP unavailable  

## Testing

- **Windows 11 + vcpkg**: build succeeds
- **No CLP installed**: configure/build succeeds  
- **Linux/Unix**: existing workflows unaffected
- **Android/iOS**: properly skipped

## Changes

- Update `cmake/OpenCVFindLibsPerf.cmake`
- Replace hardcoded library names with CMake targets
- Add mobile platform guards
- Preserve backward compatibility

Fixes #26592

---

### Pull Request Readiness Checklist

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch (`4.x`)
- [x] There is a reference to the original bug report and related work (#26592)
- [x] The feature is well documented and sample code can be built with the project CMake
- [x] No additional tests required - this is a build system fix that maintains existing functionality
2026-04-29 11:40:23 +03:00
Alexander Smorkalov 9dc7dc89d7 Merge pull request #28780 from ssam18:fix-lapack-cblas-link
cmake: link libcblas explicitly for LAPACK/Generic backend
2026-04-17 15:18:43 +03:00
Jesus Armando Anaya 166c235603 Merge pull request #28745 from JesusAnaya:fix-bundled-protobuf-include-priority
build: fix bundled protobuf headers being overridden by system-installed protobuf #28745

On macOS with Apple Clang 17, the compiler implicitly injects `/usr/local/include` as a high-priority user include (`-I`). The `SYSTEM` keyword in `target_include_directories` emits `-isystem` for the bundled protobuf path, which is searched after user `-I` paths, allowing a system-installed protobuf v4+ (which requires C++17 and abseil-cpp) to override the bundled headers.

Removing `SYSTEM` causes CMake to emit `-I` instead of `-isystem`, placing the bundled path before the implicit system include, restoring the intended header resolution order regardless of what protobuf version is installed on the host.

### Background

Apple Clang 17 (shipped with macOS 26 Tahoe Command Line Tools) changed the compiler driver behavior: it now unconditionally adds `-I/usr/local/include` to the search path, which is where Homebrew installs headers. Previous Apple Clang versions either omitted this path or added it as a lower-priority system include.

When Homebrew's `protobuf` is installed (v4+, e.g. `33.4_1`), its headers at `/usr/local/include/google/protobuf/` are resolved before the bundled `3rdparty/protobuf/src/` because `SYSTEM PUBLIC` in `target_include_directories` causes the bundled path to be emitted as `-isystem`, which ranks below `-I` in compiler search order. This was confirmed by inspecting the generated `flags.make`:

```
# before fix
-isystem /path/to/opencv/3rdparty/protobuf/src

# after fix
-I /path/to/opencv/3rdparty/protobuf/src   (first in the include list)
```

The system protobuf v4+ headers require C++17 and abseil-cpp. Since OpenCV 4.x compiles with `-std=c++11`, every translation unit in `3rdparty/protobuf/` fails:

```
/usr/local/include/google/protobuf/port_def.inc: error: Protobuf only supports C++17 and newer.
/usr/local/include/absl/base/policy_checks.h: error: C++ versions less than C++17 are not supported.
```

Note that `include_directories(BEFORE ...)` on the line above was intended to prevent exactly this, but it was overridden by `target_include_directories(SYSTEM PUBLIC ...)` deduplicating the path into a single `-isystem` entry. This is essentially the same class of problem tracked in #13328.

### Impact

The change is a one-line diff. Removing `SYSTEM` has no effect on Linux or Windows since those toolchains do not inject `/usr/local/include` implicitly. Warning suppression for protobuf headers in dependent modules is unaffected because OpenCV already applies explicit `-Wno-*` flags for all protobuf-related warnings in `3rdparty/protobuf/CMakeLists.txt`.

### Tested on

- macOS 26.3 (Tahoe), Apple Clang 17.0.0 (`clang-1700.6.4.2`), Homebrew `protobuf 33.4_1`, full build passes with `BUILD_PROTOBUF=ON`.

Fixes #28743, related to #27886.

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
  Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2026-04-17 10:53:45 +03:00
Samaresh Kumar Singh 1bef8b81f4 cmake: find and link libcblas separately for LAPACK/Generic
On systems like OpenBSD, CBLAS functions are provided by a standalone
libcblas that is not returned by find_package(LAPACK). This caused link
failures when building libopencv_core because cblas_sgemm and friends
from hal_internal.cpp could not be resolved.

Fixes #28768
2026-04-09 11:01:58 +03:00
Alexander Smorkalov 7e8e0853a8 Merge pull request #28611 from Arths17:4.x
Fix Windows build issues with IPPICV unpack and IPPIW CMakeLists.txt …
2026-03-31 15:24:38 +03:00
Alexander Smorkalov f82522ccfb Merge pull request #28589 from nmizonov:fix_ippiw_binary_usage
Fixed search of IPP IW binaries in cmake
2026-03-31 10:27:41 +03:00
CSBVision faf36aa95b Change file globbing to recursive for CUDA DLLs
With recent releases, the CUDA installation layout changes introduces a `bin\x64` subdirectory. Recursive glob inside `bin` works in either case.
2026-03-16 11:28:56 +01:00
Arths17 2ea7e3ad06 Fix Windows build issues with IPPICV unpack and IPPIW CMakeLists.txt copy (#28608)
- Replace execute_process(tar) with file(ARCHIVE_EXTRACT) for native .zip support
  and better Windows path handling when CMAKE_VERSION >= 3.18
- Replace execute_process copy with file(COPY) and existence check for reliable
  CMakeLists.txt copying to avoid timing/path issues on Windows
- Maintains backward compatibility with older CMake versions and Linux behavior

Fixes issue #28608
2026-03-05 23:05:10 -06:00
nmizonov b7266c92fd Fix IPPIW binaries search 2026-03-02 05:03:50 -08:00
Alexander Smorkalov c03734475f Merge pull request #28159 from asmorkalov:as/java_cleaners
Introduce option to generate Java code with finalize() or Cleaners interface #28159
 
Closes https://github.com/opencv/opencv/issues/22260
Replaces https://github.com/opencv/opencv/pull/23467

The PR introduce configuration option to generate Java code with Cleaner interface for Java 9+ and old-fashion finalize() method for old Java and Android. Mat class and derivatives are manually written. The PR introduce 2 base classes for it depending on the generator configuration.

Pros:
1. No need to implement complex and error prone cleaner on library side.
2. No new CMake templates, easier to modify code in IDE.

Cons:
1. More generator branches and different code for modern desktop and Android.

TODO: 
- [x] Add Java version check to cmake
- [x] Use Cleaners for ANDROID API 33+

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [ ] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2025-12-16 14:21:34 +03:00
Kai Pastor 6fc0f38e1c Fix CMake foreach loops 2025-12-06 11:03:53 +01:00
nishith-fujitsu 8efc0fd47b Merge pull request #28055 from nishith-fujitsu:sve_fastGEMM1t
dnn: add SVE optimized fastGEMM1T function and SVE dispatch #28055

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch

**Description**
This PR enables fastGemm1t vectorized with SVE for AARCH64 architecture that called by recurrent layers and fully connected layers with SVE dispatching mechanism.

**ARM Compatibility:**
Modified the build scripts, and configuration files to ensure compatibility with ARM processors.

**Checklist**

Code changes have been tested on ARM devices (Graviton3).

**Modifications**

- Implemented FastGemm1T kernel in SVE with Vector length agnostic approach.

- Added Flags and checks to call our ported Kernel in Recurrent Layer and FullyConnected layer.

- Changes made to cmakelist.txt to dispatch our ported kernel for SVE.

- Flag OpenCV Dispatch with SVE optimization is added to support SVE implemented kernel for OpenCV. According to OpenCV build optimization https://github.com/opencv/opencv/wiki/CPU-optimizations-build-options 
cmake \
    -DCPU_BASELINE=NEON\
    -D CPU_DISPATCH=SVE\

**Performance Improvement**
- The suggested optimizations Improves the performance of LSTM layer and fully connected layer.
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">

<head>

<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<link id=Main-File rel=Main-File
href="file:///C:/Users/jaiswaln/AppData/Local/Temp/msohtmlclip1/01/clip.htm">
<link rel=File-List
href="file:///C:/Users/jaiswaln/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml">
<style>
<!--table
	{mso-displayed-decimal-separator:"\.";
	mso-displayed-thousand-separator:"\,";}
@page
	{margin:.75in .7in .75in .7in;
	mso-header-margin:.3in;
	mso-footer-margin:.3in;}
tr
	{mso-height-source:auto;}
col
	{mso-width-source:auto;}
br
	{mso-data-placement:same-cell;}
td
	{padding-top:1px;
	padding-right:1px;
	padding-left:1px;
	mso-ignore:padding;
	color:black;
	font-size:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:"Aptos Narrow", sans-serif;
	mso-font-charset:0;
	mso-number-format:General;
	text-align:general;
	vertical-align:bottom;
	border:none;
	mso-background-source:auto;
	mso-pattern:auto;
	mso-protection:locked visible;
	white-space:nowrap;
	mso-rotate:0;}
.xl63
	{border:.5pt solid windowtext;}
.xl64
	{text-align:center;}
.xl65
	{text-align:center;
	border:.5pt solid windowtext;}
-->
</style>
</head>

<body link="#467886" vlink="#96607D">


Name of Test | dnn_neon | dnn_sve | dnn_sve   vs dnn_neon(x-factor)
-- | -- | -- | --
lstm::Layer_LSTM::BATCH=1,   IN=64, HIDDEN=192, TS=100 | 2.878 | 2.326 | 1.24
lstm::Layer_LSTM::BATCH=1,   IN=192, HIDDEN=192, TS=100 | 4.162 | 3.08 | 1.35
lstm::Layer_LSTM::BATCH=1,   IN=192, HIDDEN=512, TS=100 | 18.627 | 16.152 | 1.15
lstm::Layer_LSTM::BATCH=1,   IN=1024, HIDDEN=192, TS=100 | 10.98 | 7.976 | 1.38
lstm::Layer_LSTM::BATCH=64,   IN=64, HIDDEN=192, TS=2 | 4.41 | 3.459 | 1.27
lstm::Layer_LSTM::BATCH=64,   IN=192, HIDDEN=192, TS=2 | 6.567 | 4.807 | 1.37
lstm::Layer_LSTM::BATCH=64,   IN=192, HIDDEN=512, TS=2 | 28.471 | 22.909 | 1.24
lstm::Layer_LSTM::BATCH=64,   IN=1024, HIDDEN=192, TS=2 | 15.491 | 12.537 | 1.24
lstm::Layer_LSTM::BATCH=128,   IN=64, HIDDEN=192, TS=2 | 8.848 | 6.821 | 1.3
lstm::Layer_LSTM::BATCH=128,   IN=192, HIDDEN=192, TS=2 | 12.969 | 9.522 | 1.36
lstm::Layer_LSTM::BATCH=128,   IN=192, HIDDEN=512, TS=2 | 55.52 | 45.746 | 1.21
lstm::Layer_LSTM::BATCH=128,   IN=1024, HIDDEN=192, TS=2 | 31.226 | 26.132 | 1.19

</body>

</html>

<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">

<head>

<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<link id=Main-File rel=Main-File
href="file:///C:/Users/jaiswaln/AppData/Local/Temp/msohtmlclip1/01/clip.htm">
<link rel=File-List
href="file:///C:/Users/jaiswaln/AppData/Local/Temp/msohtmlclip1/01/clip_filelist.xml">
<style>
<!--table
	{mso-displayed-decimal-separator:"\.";
	mso-displayed-thousand-separator:"\,";}
@page
	{margin:.75in .7in .75in .7in;
	mso-header-margin:.3in;
	mso-footer-margin:.3in;}
tr
	{mso-height-source:auto;}
col
	{mso-width-source:auto;}
br
	{mso-data-placement:same-cell;}
td
	{padding-top:1px;
	padding-right:1px;
	padding-left:1px;
	mso-ignore:padding;
	color:black;
	font-size:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:"Aptos Narrow", sans-serif;
	mso-font-charset:0;
	mso-number-format:General;
	text-align:general;
	vertical-align:bottom;
	border:none;
	mso-background-source:auto;
	mso-pattern:auto;
	mso-protection:locked visible;
	white-space:nowrap;
	mso-rotate:0;}
.xl65
	{border:.5pt solid windowtext;}
.xl66
	{text-align:center;}
.xl67
	{text-align:center;
	border:.5pt solid windowtext;}
-->
</style>
</head>

<body link="#467886" vlink="#96607D">


Name of Test | dnn_neon | dnn_sve | dnn_sve   vs dnn_neon(x-factor)
-- | -- | -- | --
fc::Layer_FullyConnected::([5,   16, 512, 128], 256, false, OCV/CPU) | 5.086 | 4.483 | 1.13
fc::Layer_FullyConnected::([5,   16, 512, 128], 256, true, OCV/CPU) | 8.512 | 8.347 | 1.02
fc::Layer_FullyConnected::([5,   16, 512, 128], 512, false, OCV/CPU) | 9.467 | 8.965 | 1.06
fc::Layer_FullyConnected::([5,   16, 512, 128], 512, true, OCV/CPU) | 14.855 | 13.527 | 1.1
fc::Layer_FullyConnected::([5,   16, 512, 128], 1024, false, OCV/CPU) | 18.821 | 18.023 | 1.04
fc::Layer_FullyConnected::([5,   16, 512, 128], 1024, true, OCV/CPU) | 27.558 | 24.966 | 1.1
fc::Layer_FullyConnected::([5,   512, 384, 0], 256, false, OCV/CPU) | 0.924 | 0.804 | 1.15
fc::Layer_FullyConnected::([5,   512, 384, 0], 256, true, OCV/CPU) | 1.259 | 1.126 | 1.12
fc::Layer_FullyConnected::([5,   512, 384, 0], 512, false, OCV/CPU) | 1.957 | 1.655 | 1.18
fc::Layer_FullyConnected::([5,   512, 384, 0], 512, true, OCV/CPU) | 2.831 | 2.775 | 1.02
fc::Layer_FullyConnected::([5,   512, 384, 0], 1024, false, OCV/CPU) | 5.92 | 6.379 | 0.93
fc::Layer_FullyConnected::([5,   512, 384, 0], 1024, true, OCV/CPU) | 8.924 | 8.993 | 0.99

</body>

</html>
2025-12-03 10:42:28 +03:00
Dmitry Kurtaev 895be753ac Update FlatBuffers source code to 25.9.23 2025-11-27 18:31:10 +03:00
JayPol999 35f82d4599 Fix OpenBLAS detection on Fedora/RHEL (Issue #28049) 2025-11-20 23:24:55 +05:30
Benjamin Buch 91a720144b add MSVC 19.50 / VS 2026 / VC 18 to config: fix #28013 2025-11-14 15:44:58 +01:00
Kumataro 346308124a imgcodecs: GDAL: show GDAL version at OpenCV configuration 2025-10-20 18:37:04 +09:00
Alexander Smorkalov 0a25225b76 Merge pull request #27897 from asmorkalov:as/alernative_win_arm_neon_check
Enabled fp16 conversions, but disabled NEON FP16 arithmetics on Windows for ARM for now #27897

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [ ] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2025-10-13 19:40:11 +03:00
Alexander Smorkalov ceb197b7de Use /safeseh for x86 32-bit only. 2025-09-23 15:24:27 +03:00
Maksim Shabunin 6d4be10c44 build: fix OpenBLAS cmake search 2025-09-12 10:48:14 +03:00
cudawarped a56877a016 Silence unreferenced function with internal linkage has been removed warnings on windows
e.g.

contrib\modules\cudev\include\opencv2\cudev/ptr2d/warping.hpp(86): warning C4505: 'cv::cudev::affineMap': unreferenced function with internal linkage has been removed
contrib\modules\cudev\include\opencv2\cudev/ptr2d/warping.hpp(134): warning C4505: 'cv::cudev::perspectiveMap': unreferenced function with internal linkage has been removed
2025-09-01 16:43:04 +03:00
Dmitry Kurtaev ba19416730 Merge pull request #27581 from dkurt:d.kuryaev/dlpack
### Pull Request Readiness Checklist

resolves #16295

```
docker run --gpus 0 -v ~/opencv:/opencv -v ~/opencv_contrib:/opencv_contrib -it nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04
apt-get update && apt-get install -y cmake python3-dev python3-pip python3-venv &&
python3 -m venv .venv &&
source .venv/bin/activate &&
pip install -U pip &&
pip install -U numpy &&
pip install torch --index-url https://download.pytorch.org/whl/cu128 &&
cmake \
    -DWITH_OPENCL=OFF \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_DOCS=OFF \
    -DWITH_CUDA=ON \
    -DOPENCV_DNN_CUDA=ON \
    -DOPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules \
    -DBUILD_LIST=ts,cudev,python3 \
    -S /opencv -B /opencv_build &&
cmake --build /opencv_build -j16
export PYTHONPATH=/opencv_build/lib/python3/:$PYTHONPATH
```

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-08-20 11:43:41 +03:00
Johnny 1e37d84e3a Merge pull request #27537 from johnnynunez:patch-2
Refactor Blackwell #27537

In CUDA 13:
- 10.0 is b100/b200 same for aarch64 (gb200)
- 10.3 is GB300
- 11.0 is Thor with new OpenRm driver (moves to SBSA)
- 12.0 is RTX/RTX PRO
- 12.1 is Spark GB10

Thor was moved from 10.1 to 11.0 and Spark is 12.1.
Related patch: https://github.com/pytorch/pytorch/pull/156176
2025-08-20 11:29:31 +03:00
Pierre Chatelier e2d87defd1 Merge pull request #27522 from chacha21:fix_cuda129_msvc
Fix compilation problems with MSVC+Cuda 12.9 #27522

fix for #27521

Actually, when ENABLE_CUDA_FIRST_CLASS_LANGUAGE is enabled, the fix it not necessary. However, even when ENABLE_CUDA_FIRST_CLASS_LANGUAGE is enabled, I have checked that the fix is harmless So I propose to keep it simple for now and enable the fix whatever the state of ENABLE_CUDA_FIRST_CLASS_LANGUAGE

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [X] The PR is proposed to the proper branch
- [X] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2025-07-18 11:24:00 +03:00
Kumataro 468de9b367 Merge pull request #27536 from Kumataro:fix27530
eigen: fix to get version from eigen after v3.4.0 #27536

Close https://github.com/opencv/opencv/issues/27530

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2025-07-14 19:09:24 +03:00
Kumataro 1f674dcdb4 Merge pull request #27416 from Kumataro:fix27413
Close https://github.com/opencv/opencv/issues/27413

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2025-06-12 15:32:28 +03:00
Alexander Smorkalov 0806124ac7 Try to add FastCV to OpenCV4AndroidSDK 2025-05-24 18:49:11 +03:00
Alexander Smorkalov 4530206445 Merge pull request #27340 from asmorkalov:apreetam_5thPost
Update hash for the fastcv libs for both Linux and Android #27340

Replaces https://github.com/opencv/opencv/pull/27290
Updated libs PR: https://github.com/opencv/opencv_3rdparty/pull/95

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [ ] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2025-05-21 10:24:13 +03:00
Vadim Levin b3e17ea9d4 feat: add conditional inclusion support to header parser 2025-05-19 10:11:52 +03:00
Alfred Wingate 8fae4a65fe cmake: set SPNG_LIBRARY for pkgconfig as well
Pkgconfig will set SPNG_LIBRARIES but not SPNG_LIBRARY, this is an issue
as modules/imgcodecs/CmakeLists.txt uses SPNG_LIBRARY.

Bug: https://bugs.gentoo.org/955661
Fixes: c92815238e
Signed-off-by: Alfred Wingate <parona@protonmail.com>
2025-05-14 23:36:56 +03:00
Alexander Smorkalov 2364056aa3 License update in CPack generated packages. 2025-05-12 11:46:51 +03:00
Alexander Smorkalov 19c4d97638 Merge pull request #27252 from asmorkalov:as/extract_hal
Extract all HALs from 3rdparty to dedicated folder. #27252

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [ ] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2025-04-25 14:56:42 +03:00
Alexander Smorkalov 767dd838d3 Merge pull request #27192 from ddennedy:cmake4
Fix configuring with CMake version 4
2025-04-16 19:05:18 +03:00
Alexander Smorkalov 250ea3d7c6 Fixed Android build with FastCV. 2025-04-16 16:26:05 +03:00
Dan Dennedy cb8030809e Fix configuring with CMake version 4
fixes #27122
2025-04-02 13:45:08 -07:00
Maksim Shabunin 009fdbbea2 build: fix OpenBLAS detection on Linux 2025-03-31 18:54:39 +03:00
Kumataro 09c71aed14 Merge pull request #27107 from Kumataro:fix27105
build: Check supported C++ standard features and user setting #27107

Close #27105 

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-03-31 11:31:14 +03:00
Alexander Smorkalov 68a595d88b Set C++ standard for all CUDA configurations. 2025-03-25 16:47:12 +03:00
cudawarped 1d9dda3f09 Merge pull request #27112 from cudawarped:add_cuda_c++17
cuda: Force C++17 Standard for CUDA targets when CUDA Toolkit >=12.8 #27112

Fix https://github.com/opencv/opencv/issues/27095.

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [ ] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2025-03-21 14:41:49 +03:00
Connor Baker 5200419ba5 cmake/OpenCVDetectCUDAUtils.cmake: use IN_LIST to avoid regex matching valid capabilities 2025-02-13 23:47:00 +00:00
Alexander Smorkalov 5921aae2b3 Switch to static instance of FastCV on Linux. 2025-02-13 15:58:25 +03:00
Alexander Smorkalov 4e2f0471bd Revert "Update OpenCVFindWebP.cmake with sturkmen72's suggestion" 2025-02-01 09:27:43 +03:00
Alexander Smorkalov 43cebe52eb Merge pull request #26857 from hmaarrfk:patch-1
Update OpenCVFindWebP.cmake with sturkmen72's suggestion
2025-02-01 09:16:57 +03:00
Suleyman TURKMEN fbd2105067 Merge pull request #26762 from sturkmen72:avif_cmake
Fixed AVIF linkage on Windows #26762 

Closes #26747

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2025-01-31 16:41:08 +03:00
Mark Harfouche 2a0092cf75 Update OpenCVFindWebP.cmake with sturkmen72's suggestion
@sturkmen72  feel free to fold into https://github.com/opencv/opencv/pull/26762 but I would just like a dedicated patch to try.
2025-01-30 16:18:48 -05:00
Johnny 4b2a33a5c6 Merge pull request #26820 from johnnynunez:patch-1
Initial support Blackwell GPU arch #26820 
 
10.0 blackwell b100/b200
12.0 blackwell rtx50

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2025-01-25 09:51:27 +03:00
Kumataro ab77e1cfc8 Merge pull request #26678 from Kumataro:fix26673
OpenEXR 2.2 or earlier cannot be used with C++17 or later #26678

Close https://github.com/opencv/opencv/issues/26673
Close https://github.com/opencv/opencv/issues/25313

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-01-24 14:18:29 +03:00
cDc 1db982780f Merge pull request #26379 from cdcseacave:jxl_codec
Add jxl (JPEG XL) codec support #26379

### Pull Request Readiness Checklist

Related CI and Docker changes:
- https://github.com/opencv/ci-gha-workflow/pull/190
- https://github.com/opencv-infrastructure/opencv-gha-dockerfile/pull/44

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work https://github.com/opencv/opencv/issues/20178
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-12-31 11:56:35 +03:00
Alexander Smorkalov c803aa2ddd Merge pull request #26057 from asmorkalov:as/android_16k_pages
Android builds update #26057

Fixes https://github.com/opencv/opencv/issues/26027
Should also address https://github.com/opencv/opencv/issues/26542
 
Changes:
- Switched to Android build tools 34, NDK 26d, target API level 34 (required by Google Play).
- Use flexible page size on Android by default to support Android 15+.
- Dummy stub for R and BuildConfig classes for javadoc.
- Java 17 everywhere.
- Strict ndkVersion and ABI list in release package.

Related:
- Docker: https://github.com/opencv-infrastructure/opencv-gha-dockerfile/pull/41
- Pipeline: https://github.com/opencv/ci-gha-workflow/pull/183

Related IPP issue with NDK 27+: https://github.com/opencv/opencv/issues/26072

Google documentation for 16kb pages support : https://developer.android.com/guide/practices/page-sizes?hl=en

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2024-12-31 11:53:04 +03:00
Alexander Smorkalov 94bccbecc0 Merge pull request #26635 from FantasqueX:remove-no-long-long-1
Remove useless -Wno-long-long option
2024-12-27 10:01:53 +03:00