35906 Commits

Author SHA1 Message Date
Alexander Smorkalov
3c34e42209 Merge branch 'as/release_4.13.0' into 4.x
Some checks failed
4.x / CodeQL (push) Has been cancelled
2025-12-30 21:56:39 +03:00
Alexander Smorkalov
fe38fc608f release: OpenCV 4.13.0 2025-12-30 10:52:05 +03:00
Alexander Smorkalov
a6c10358a4 Merge pull request #28331 from asmorkalov:as/python_standalone_layout
Define installation layout for Python standalone builds
2025-12-29 15:07:37 +03:00
Alexander Smorkalov
f9c2961411 Define installation layout for Python standalone builds. 2025-12-29 15:01:07 +03:00
Alexander Smorkalov
d43ff988ca Merge pull request #28330 from asmorkalov:as/python_standalone_dlpack
Fixed DLPack detection in Python standalone builds
2025-12-29 14:37:00 +03:00
Alexander Smorkalov
2addae071e Fixed DLPack detection in Python standalone builds 2025-12-29 13:45:19 +03:00
Alexander Smorkalov
83804b8fc7 Merge pull request #28326 from lebarsfa:4.x
"/arch:AVX" should be only for Visual Studio
2025-12-29 13:13:01 +03:00
lebarsfa
207ac36ca2 opencv/3rdparty/libwebp/CMakeLists.txt: "/arch:AVX" should be only for Visual Studio, "-mavx" for MinGW and possibly other compilers 2025-12-28 00:09:17 +01:00
Alexander Smorkalov
40ab411032 Merge pull request #28285 from akretz:fix_issue_28241
Fixed stack-use-after-scope errors in charuco detector
2025-12-27 18:17:58 +03:00
Alexander Smorkalov
b2042a61d2 Merge pull request #28320 from Kumataro:fix28319
docs(core): update Universal Intrinsics for VLA (RVV/SVE) and v4.11+ API changes
2025-12-27 18:16:00 +03:00
Kumataro
364f21fd24 docs(core): update Universal Intrinsics for VLA (RVV/SVE) and OpenCV 4.11+ API changes 2025-12-27 10:54:06 +09:00
Alexander Smorkalov
a49eb47057 Merge pull request #28306 from asmorkalov:as/ffmpeg_4.x_20251225
FFmpeg binaries update for Windows.
2025-12-27 00:41:19 +03:00
Alexander Smorkalov
b618676a53 Merge pull request #28311 from asmorkalov:as/ipp_compare_perf_regression
Disable IPP with AVX512 in cv::compare because of performance regression
2025-12-26 22:55:08 +03:00
Alexander Smorkalov
9b4043ea67 Merge pull request #28312 from 0AnshuAditya0:fix/issue-28291-qt-quit-lifecycle
Fix Qt HighGUI lifecycle issue when external QApplication exists
2025-12-26 18:29:18 +03:00
0AnshuAditya0
5d5b5c14a9 Fix Qt HighGUI lifecycle issue when external QApplication exists
Respect QApplication::quitOnLastWindowClosed() before calling qApp->quit().
This prevents OpenCV from unintentionally terminating externally managed
Qt applications when the last HighGUI window is closed.

Fixes #28291
2025-12-26 13:36:17 +05:30
Alexander Smorkalov
497e9037b4 FFmpeg binaries update for Windows. 2025-12-26 10:52:37 +03:00
Alexander Smorkalov
2b1cf03a9d Disable IPP with AVX512 in cv::compare because of performance regression. 2025-12-26 09:19:28 +03:00
Alexander Smorkalov
cff7581175 Merge pull request #28304 from raimbekovm:fix-typos-batch5
docs: fix spelling errors
2025-12-25 17:55:20 +03:00
Alexander Smorkalov
459a609271 Merge pull request #28283 from asmorkalov:as/ffmpeg_picture_leak
Fixed picture_sw object leak in ffmpeg backend with hardware codecs. #28283

Replacement for https://github.com/opencv/opencv/pull/28221

### 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-25 15:43:38 +03:00
raimbekovm
a41857f3c2 docs: fix spelling errors
- 'tirangle' -> 'triangle'
- 'cirlce' -> 'circle'
- 'gradiantSize' -> 'gradientSize'
- 'unnotied' -> 'unnoticed'
- 'consistensy' -> 'consistency'
- 'implemention' -> 'implementation'
- 'suppported/Unsuppported/suppport' -> 'supported/Unsupported/support'
2025-12-25 15:45:08 +06:00
Alexander Smorkalov
c1c893ff73 Merge pull request #28299 from AsyaPronina:rename_workload_type_notify
[G-API] Renamed `WorkloadType::notify()` -> `WorkloadType::set()`
2025-12-25 11:59:05 +03:00
Alexander Smorkalov
b63565401b Merge pull request #28300 from raimbekovm:fix-array-typo
docs: fix spelling errors in documentation and comments
2025-12-25 11:58:16 +03:00
raimbekovm
229941f6a2 docs: fix spelling errors in documentation and comments
- Fixed 'arrray' -> 'array' in calib3d.hpp
- Fixed 'varaible' -> 'variable' in matmul_layer.cpp
- Fixed 'PreprocesingEngine' -> 'PreprocessingEngine' in onevpl sample
- Fixed 'convertion/convertions' -> 'conversion/conversions' in quaternion.hpp, grfmt_tiff.cpp, nary_eltwise_layers.cpp, instance_norm_layer.cpp
2025-12-25 11:48:31 +06:00
Alexander Smorkalov
5c1737e0dc Merge pull request #28297 from raimbekovm:fix-documentation-typos
docs: fix typos in documentation
2025-12-25 08:35:19 +03:00
Alexander Smorkalov
ec4889b7ae Merge pull request #28298 from raimbekovm:fix-spelling-errors
docs: fix spelling errors in documentation
2025-12-25 08:33:50 +03:00
Anastasiya Pronina
e16fbb392c [G-API] Renamed WorkloadType::notify() -> WorkloadType::set() 2025-12-24 22:44:54 +00:00
raimbekovm
17a01d687c docs: fix spelling errors in documentation
- Fixed 'reinitalized' -> 'reinitialized' in background_segm.hpp
- Fixed 'dimentions/dimentional/dimentinal' -> 'dimensions/dimensional' in mat.hpp, imgproc.hpp, gmat.hpp, recurrent_layers.cpp
- Fixed 'tresholded' -> 'thresholded' in aruco_detector.cpp
2025-12-24 22:37:09 +06:00
raimbekovm
2fb95415dd Fix typos in documentation: 'algorighm' -> 'algorithm', 'necesary' -> 'necessary' 2025-12-24 22:11:28 +06:00
Alexander Smorkalov
3e89c3e26f Merge pull request #28287 from asmorkalov:update_version_4.13.0-pre
pre: OpenCV 4.13.0 (version++)
2025-12-24 11:18:20 +03:00
Alexander Smorkalov
73737bb3f1 Merge pull request #28286 from asmorkalov:as/warning_fix_win32
Warning fix on Windows.
2025-12-23 21:58:11 +03:00
Dheeraj Alamuri
d3c539bf71 Merge pull request #28227 from dheeraj25406:docs-moments-degenerate
docs(imgproc): clarify cv::moments behavior for degenerate contours #28227

relates to https://github.com/opencv/opencv/issues/28222
Clarifies that for degenerate contours (single point or collinear points),
cv::moments() returns m00 == 0 and centroid is undefined.
Documents common workarounds such as boundingRect center or point averaging.
2025-12-23 20:53:43 +03:00
Alexander Smorkalov
e63d2a12f0 pre: OpenCV 4.13.0 (version++). 2025-12-23 18:31:50 +03:00
Alexander Smorkalov
a1b682254e Warning fix on Windows. 2025-12-23 18:25:26 +03:00
Adrian Kretz
54fc9dce0b Guarantee temporary object lifetime extension 2025-12-23 15:54:37 +01:00
Alexander Smorkalov
4705320496 Merge pull request #28239 from AdwaithBatchu:optimize-stitching-allocations
optimize: replace push_back with emplace_back in core loops
2025-12-23 15:05:35 +03:00
Alexander Smorkalov
81893fac24 Merge pull request #28282 from abhishek-gola:conv_kernel_size_fix
Support Conv kernel inference from initializer weights
2025-12-23 15:04:51 +03:00
Shruti Arsode
7e66c0504a Merge pull request #28275 from Shruti192903:docs/simpleblobdetector-api
docs(features2d): document getBlobContours and collectContours in SimpleBlobDetector #28275

Description: This PR adds missing Doxygen documentation for the getBlobContours() method and the collectContours parameter in SimpleBlobDetector. These features were previously undocumented, making the contour collection functionality difficult for users to discover and use correctly.

Changes:
Added a @brief and detailed note for SimpleBlobDetector::Params::collectContours.
Added documentation for SimpleBlobDetector::getBlobContours(), including a @note regarding the required parameter setup.

Testing:
Verified the documentation build locally on macOS using ninja opencv_docs.
Confirmed the generated HTML displays the descriptions and cross-references accurately.

Partially fixes: #25904
Related PR that adds method: https://github.com/opencv/opencv/pull/21942

### 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-12-23 15:03:57 +03:00
Vadim Pisarevsky
eaccbe24b2 Merge pull request #28242 from vpisarev:fix_input_array_std_vector
modified Input/OutputArray methods to handle 'std::vector<T>' or 'std::vector<std::vector<T>>' properly #28242

This is port of #26408 with some further improvements (all switch-by-vector-type statements are consolidated in a single macro)

### 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-23 14:25:07 +03:00
Abhishek Gola
2bce8e6a46 Added conv kernel size 2025-12-23 13:49:07 +05:30
Alexander Smorkalov
a27397a654 Merge pull request #28274 from JahnviBhandari:setup
Fix wording in Adding Images Tutorial
2025-12-23 10:31:44 +03:00
Alexander Smorkalov
d00021017a Merge pull request #28277 from JosuaRieder:feature/fix_stitcher_doc
Remove stray STX in stitcher tutorial
2025-12-23 10:19:27 +03:00
Alexander Smorkalov
031e7de85c Merge pull request #28272 from abhishek-gola:heap_overflow_fix
Fixed heap-buffer-overflow in DNN NaryEltwiseLayer
2025-12-23 08:52:16 +03:00
Josua Rieder
56d76f95ed Remove stray STX in stitcher tutorial 2025-12-22 21:33:56 +01:00
fcmiron
ad9387340a Merge pull request #27460 from fcmiron:gapi_set_workloadtype_dynamically
G-API: Add support to set workload type dynamically in both OpenVINO and ONNX OVEP #27460

### 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-22 21:04:53 +03:00
Jonas Perolini
2bca09a191 Merge pull request #23190 from JonasPerolini:pr-output-marker-score
Include pixel-based confidence in ArUco marker detection #23190

The aim of this pull request is to compute a **pixel-based confidence** of the marker detection. The confidence [0;1] is defined as the percentage of correctly detected pixels, with 1 describing a pixel perfect detection. Currently it is possible to get the normalized Hamming distance between the detected marker and the dictionary ground truth [Dictionary::getDistanceToId()](https://github.com/opencv/opencv/blob/4.x/modules/objdetect/src/aruco/aruco_dictionary.cpp#L114) However, this distance is based on the extracted bits and we lose information in the [majority count step](https://github.com/opencv/opencv/blob/4.x/modules/objdetect/src/aruco/aruco_detector.cpp#L487). For example, even if each cell has 49% incorrect pixels, we still obtain a perfect Hamming distance.

**Implementation tests**: Generate 36 synthetic images containing 4 markers each (with different ids) so a total of 144 markers. Invert a given percentage of pixels in each cell of the marker to simulate uncertain detection. Assuming a perfect detection, define the ground truth uncertainty as the percentage of inverted pixels. The test is passed if `abs(computedConfidece - groundTruthConfidence) < 0.05` where `0.05` accounts for minor detection inaccuracies.

- Performed for both regular and inverted markers
- Included perspective-distorted markers
- Markers in all 4 possible rotations [0, 90, 180, 270]
- Different set of detection params:
    - `perspectiveRemovePixelPerCell`
    - `perspectiveRemoveIgnoredMarginPerCell`
    - `markerBorderBits`

![TestCases](https://github.com/user-attachments/assets/1113abd3-ff7a-45c8-8b4b-a9d2182eda82)


The code properly builds locally and `opencv_test_objdetect` and `opencv_test_core` passed. Please let me know if there are any further modifications needed. 

Thanks!


I've also pushed minor unrelated improvement (let me know if you want a separate PR) in the [bit extraction method](https://github.com/opencv/opencv/blob/4.x/modules/objdetect/src/aruco/aruco_detector.cpp#L435). `CV_Assert(perspectiveRemoveIgnoredMarginPerCell <=1)` should be `< 0.5`. Since there are margins on both sides of the cell, the margins must be smaller than half of the cell. When setting `perspectiveRemoveIgnoredMarginPerCell >= 0.5`, `opencv_test_objdetect` fails. Note: 0.499 is ok because `int()` will floor the result, thus `cellMarginPixels = int(cellMarginRate * cellSize)` will be smaller than `cellSize / 2`



### 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
- [ ] 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 PR is proposed to the proper branch
- [x] The feature is well documented and sample code can be built with the project CMake
2025-12-22 20:54:40 +03:00
Abhishek Shinde
ea9b183d9b Merge pull request #28259 from falloficarus22:fix/bilateral-filter-oob
Fix the out-of-bounds read in cv::bilateralFilter for 32f images #28259

### Root Cause Analysis

The issue was caused by a discrepancy between the image range used to allocate the color weight look-up table (LUT) and the actual range of pixel values encountered during filtering, especially near the image borders.

- Range Computation: `cv::bilateralFilter` computes the min/max values of the source image and allocates a `LUT (expLUT)` of size `kExpNumBins + 2` based on this range.
- Border Padding: If `cv::BORDER_CONSTANT` is used (defaulting to 0), and 0 is outside the image's original range (e.g., an image with values between 100 and 200), the padded image will contain values (0) that create differences larger than those accounted for in the `LUT`.
- Out-of-Bounds Access: When calculating the color weight, the code computes an index `idx` from the absolute difference. If this difference exceeds the expected range, `idx` can reach or exceed `kExpNumBins + 1`. Since the code performs linear interpolation using `expLUT[idx]` and `expLUT[idx + 1]`, an `idx` of `kExpNumBins + 1` causes an access to `expLUT[kExpNumBins + 2]`, which is out of bounds.

### Fix

I implemented a robust clamping mechanism in both the SIMD (AVX/SSE) and scalar paths of the bilateral filter invoker:

- Signature Update: Updated `bilateralFilterInvoker_32f` to accept `kExpNumBins` (the maximum valid `LUT` index).
- Clamping: Clamped the computed color difference (alpha) to `kExpNumBins` before calculating the `LUT` index. This ensures that any difference exceeding the planned range is safely treated as the maximum difference in the `LUT` (which usually corresponds to a weight of 0), avoiding any out-of-bounds memory access.

### Modified Files

Modified Files:
`modules/imgproc/src/bilateral_filter.simd.hpp`: Updated the invoker class and SIMD/scalar loops to clamp the LUT index.
`modules/imgproc/src/bilateral_filter.dispatch.cpp`: Updated the dispatch call site to pass the correct LUT size.

Closes #28254 

### 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
- [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-12-22 20:41:58 +03:00
Alexander Smorkalov
83448836d3 Merge pull request #28273 from happy-capybara-man:revert-27985-docs/fix-mat-clone-js
Revert "Merge pull request #27985 from happy-capybara-man:docs/fix-ma…
2025-12-22 20:01:53 +03:00
Jahnvi
55293d39c3 Fix wording in Adding Images Tutorial 2025-12-22 22:26:39 +05:30
Abhishek Gola
f86bdfcff4 fixed heap buffer overflow issue 2025-12-22 17:19:32 +05:30
Alexander Smorkalov
165b464cff Merge pull request #28216 from happy-capybara-man:4.x
js: restore deep copy behavior for Mat.clone() #28216

### Problem
In OpenCV.js, `cv.Mat.clone()` may resolve to Embind `ClassHandle.clone()` (handle/shallow clone) instead of OpenCV deep copy.

### Changes
- modules/js/src/helpers.js: override `cv.Mat.prototype.clone` -> `mat_clone` after runtime init
- modules/js/test/test_mat.js: update/extend tests to validate deep copy semantics of `clone()`

Fixes  #27572
Related: PR #26643 (js_clone_fix), PR #27985 (documentation update)

### Verification
- Built OpenCV.js with Emscripten 2.0.10
- QUnit: bin/tests.html
- CoreMat: test_mat_creation (0 failures)
<img width="745" height="362" alt="clone_fix" src="https://github.com/user-attachments/assets/16399abf-b94c-4591-b4aa-6e0fbd6cf23b" />

### 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
- [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.
- [ ] The feature is well documented and sample code can be built with the project CMake
2025-12-22 14:30:10 +03:00