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

Compare commits

...

1640 Commits

Author SHA1 Message Date
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
satyam yadav 15fe69b5af Merge pull request #28250 from satyam102006:fix/stackblur-overflow-28233
imgproc: fix heap-buffer-overflow in stackBlur #28233 #28250

### Summary
Fixes a heap-buffer-overflow in `cv::stackBlur` when the kernel size is larger than the image dimensions 
### Changes
* Added input validation to clamp the kernel size to the image dimensions.
* Added a regression test (`regression_28233`) covering 1x1 and small image cases.

Fixes #28233
2025-12-22 11:22:12 +03:00
Alexander Smorkalov a66443fdc2 Merge pull request #28265 from shahkarnav115-beep:dnn-blobfromimages-umat-error
dnn: add error message for unimplemented UMat NCHW blob conversion
2025-12-22 11:04:31 +03:00
satyam yadav 74fbfc2343 Merge pull request #28117 from satyam102006:fix/solveCubic-numerical-instability
core: fix solveCubic numerical instability via coefficient normalization (fixes #27748) #28117

 Summary
This PR fixes numerical instability in `cv::solveCubic` when the leading coefficient `a` is non-zero but extremely small relative to other coefficients (Issue #27748). 

It introduces a **normalization step** that scales all coefficients by their maximum magnitude before solving. This ensures robust detection of when the equation should degenerate to a quadratic solver, without breaking valid cubic equations that happen to have small coefficients (e.g., scaled by 1e-9).

The Problem (Issue #27748)
The previous implementation checked `if (a == 0)` to decide whether to use the cubic or quadratic formula. 
- When `a` is extremely small (e.g., 1e-17) but not exactly zero, and other coefficients are normal (e.g., 5.0), the standard cubic formula suffers from catastrophic cancellation and overflow, producing incorrect roots (e.g., 1e14).

 The Fix
1. Normalization: The solver now finds `max_coeff = max(|a|, |b|, |c|, |d|)` and scales all coefficients by `1.0 / max_coeff`.
2. Relative Threshold: It then checks `if (abs(a) < epsilon)` on the *normalized* coefficients. 

 Why this is better than previous attempts
In a previous attempt (PR #28057), a simple absolute check `abs(a) < epsilon` was proposed. That approach was rejected because it failed for scaled equations. 


Fixes #27748
2025-12-22 11:01:51 +03:00
Karnav Shah a714934c86 dnn: add error message for unimplemented UMat NCHW blob conversion 2025-12-22 01:25:48 +05:30
Abhishek Gola 66bb0a8017 Merge pull request #28164 from abhishek-gola:randomNormalLike_layer_4x
Added randomNormalLike layer to 4.x branch #28164

OpenCV Extra: https://github.com/opencv/opencv_extra/pull/1297
Backport of https://github.com/opencv/opencv/pull/28110 to 4.x

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-12-21 20:18:28 +03:00
Alexander Smorkalov 8cf2e774b7 Merge pull request #28208 from asmorkalov:as/filters_stateless
Stateless HAL for filters and morphology. #28208

### 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-20 13:30:09 +03:00
satyam yadav 2b42788803 Merge pull request #28217 from satyam102006:feature/dis-coarsest-scale
[video] Add setCoarsestScale to DISOpticalFlow (Fixes #25068) #28217

### Description
This PR addresses issue #25068 regarding the number of scales in `DISOpticalFlow`.

Currently, `DISOpticalFlow` automatically computes the `coarsest_scale` based on the image size. While generally effective, this behavior can cause errors in specific use cases (e.g., mechanics/speckle pattern analysis) where high pyramid levels degrade quality.

This change introduces a manual override:
- Added `setCoarsestScale(int val)` and `getCoarsestScale()` to the public API.
- Updated `DISOpticalFlowImpl::calc` and `ocl_calc` to use the user-defined scale if set.
- Preserved the existing "automatic" behavior as the default (when set to -1).

### Changes
- **`modules/video/include/opencv2/video/tracking.hpp`**: Added virtual method declarations.
- **`modules/video/src/dis_flow.cpp`**: Implemented `set/getCoarsestScale` in `DISOpticalFlowImpl` and updated calculation logic.
- **`modules/video/test/test_OF_accuracy.cpp`**: Added `DenseOpticalFlow_DIS.ManualCoarsestScale` regression test.


Fixes #25068
2025-12-20 13:28:32 +03:00
Alexander Smorkalov 64755d0c3a Merge pull request #28248 from ramukhsuya:tflite-minimum-support
DNN: Add TFLite Minimum layer support
2025-12-20 13:18:33 +03:00
Alexander Smorkalov da6a671b46 Merge pull request #28249 from vrabaud:msan
Fix potential overflow
2025-12-20 13:15:51 +03:00
happy-capybara-man 78c27ba4a6 Revert "Merge pull request #27985 from happy-capybara-man:docs/fix-mat-clone-js"
This reverts commit db207c88b0.
2025-12-20 15:23:15 +08:00
Vincent Rabaud 5d8ab389f8 Fix potential overflow
Fixes https://g-issues.oss-fuzz.com/issues/470321412
2025-12-19 16:59:18 +01:00
ramukhsuya 43053327ff DNN: Add TFLite Minimum layer support 2025-12-19 20:41:38 +05:30
Alexander Smorkalov 9f9b6e8dd3 Merge pull request #28246 from brianferri:4.x
fix: Invalid operands to binary expression
2025-12-19 15:12:31 +03:00
Alexander Smorkalov a3380cc128 Code review fixes. 2025-12-19 14:59:45 +03:00
Dmitry Kurtaev 43074571af Merge pull request #28163 from dkurt:d.kurtaev/convexHull_repeats
Keep convexHull output indices monotone if possible #28163

### Pull Request Readiness Checklist

resolves https://github.com/opencv/opencv/issues/24907 ?
resolves https://github.com/opencv/opencv/issues/4954

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-19 14:41:21 +03:00
Brian Ferri 93f1413db9 fix: Invalid operands to binary expression 2025-12-19 10:49:36 +01:00
AdwaithBatchu 5f0bd387db optimize: replace push_back with emplace_back in core loops
Replaces wasteful temporary object construction with in-place construction using emplace_back. Covers hot paths in objdetect, imgproc, and stitching modules.
2025-12-19 11:56:20 +05:30
happy-capybara-man 4946b97c3d js: remove empty line before EOF in helpers.js 2025-12-19 02:56:25 +08:00
Alexander Smorkalov b157553e55 Merge pull request #28202 from satyam102006:fix-27372-dshow-whitebalance-mapping
videoio(dshow): Fix incorrect mapping for White Balance Temperature property
2025-12-18 18:17:36 +03:00
ramukhsuya 44b31dd82c Merge pull request #28171 from ramukhsuya:tflite-maximum-support
dnn(tflite): add support for MAXIMUM layer #28171

Fixes #26433
This PR adds support for the `MAXIMUM` layer in the TFLite importer.
It maps the TFLite `MAXIMUM` opcode to the existing OpenCV Element-wise `Max` operation.

### 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-12-18 17:55:04 +03:00
Alexander Smorkalov bbda4e8964 Merge pull request #28226 from vrabaud:msan
Fix potential pointer overflow.
2025-12-18 14:53:10 +03:00
HARSH SUMAN e3e87055bd Merge pull request #28195 from harsh-suman5:fix-coverage-regex
Fix regex escape warning in _coverage.py by using raw string #2819

while i am running '_coverage.py' I noticed there is a syntax warning:"\." It is an invalid escape sequence
The regex was written as a normal string with '\.' which is not valid escape in string literals and give problems and error in a new python versions. 
To fix this switch to raw string(r'cv2?\.\w+') which can passes the backslashes directly to the regex engine. This removes the warning and keeps the code  and pattern working properly.

This is a small fix but important for future compatibilities.
2025-12-18 14:52:20 +03:00
Alexander Smorkalov f23969a07a Merge pull request #28220 from asmorkalov:as/kleidicv_0.7
KleidiCV update to version 0.7.
2025-12-18 14:33:40 +03:00
AdwaithBatchu 87f4a9782c Merge pull request #28203 from AdwaithBatchu:fix-macos-lapack-warnings
core: suppress LAPACK deprecation warnings on macOS #28203

### Description
On macOS (Apple Silicon) with newer Xcode/Clang, the CLAPACK interface is deprecated.
Compiling `hal_internal.cpp` triggers multiple warnings like:
`warning: 'sgesv_' is deprecated: first deprecated in macOS 13.3 - The CLAPACK interface is deprecated. [-Wdeprecated-declarations]`

Since migrating to the new Accelerate interface (Apple's recommended fix) requires significant changes to the HAL implementation and breaks the build if headers are mismatched, this PR takes the pragmatic approach. It suppresses the `-Wdeprecated-declarations` warning for this specific file using Clang pragmas to clean up the build output.

### Verification
- [x] Verified build is silent on macOS (M3).
- [x] Verified pragmas are correctly scoped within `HAVE_LAPACK` to prevent scope mismatch on non-LAPACK builds.

### 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-12-18 13:53:56 +03:00
Karnav Shah dc52acc7d1 Merge pull request #28200 from shahkarnav115-beep:fix-avif-null-checks
imgcodecs(avif): add safety checks for AVIF decoder and encoder #28200

Add defensive checks to prevent potential null dereference in AVIF decoder and encoder paths when handling malformed input or allocation failures.

### 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-12-18 12:47:35 +03:00
Vincent Rabaud 91a745adc5 Fix potential pointer overflow.
It is undefined behavior in C++ to compute an adress out of the
allocated zone (even when not dereferencing).
https://en.cppreference.com/w/cpp/language/operator_arithmetic.html#Pointer_arithmetic
2025-12-18 10:26:04 +01:00
Alexander Smorkalov 0af685708b Merge pull request #28211 from pratham-mcw:fix/neon-dotprod-expand-overflow
NEON: fix dot product accumulation causing NORM test failures on Windows ARM64
2025-12-18 11:39:46 +03:00
Alexander Smorkalov 721bb7289d Merge pull request #28185 from asmorkalov:as/static_analysys_fix
Fixed issues identified by PVS Studio #28185

Partially fixes https://github.com/opencv/opencv/issues/28167
Paper: https://pvs-studio.com/en/blog/posts/cpp/1321/

Closed items: N2, N4, N5, N6, N7, N8, N10, N11, N13, N14.

To be continued...

### 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-18 11:32:19 +03:00
Alexander Smorkalov 6aa1228ec1 KleidiCV update to version 0.7. 2025-12-18 09:51:09 +03:00
Alexander Smorkalov a858fb7cff Stateless HAL for filters and morphology. 2025-12-18 09:36:54 +03:00
Alexander Smorkalov 0ca4117c27 Merge pull request #28198 from asmorkalov:as/gapi_static_analysis
Fixes for issues found by PVS Studio in GAPI module.
2025-12-17 22:13:41 +03:00
happy-capybara-man 8ea50a77fd js: restore deep copy behavior for Mat.clone()
Emscripten 3.1.71+ introduced ClassHandle.clone() which performs a shallow copy.
This shadowed the original OpenCV clone() method which was intended for deep copying.

This patch:
1. Hooks into onRuntimeInitialized in helpers.js
2. Overrides cv.Mat.prototype.clone to point to mat_clone (deep copy)
3. Updates JS tests to use clone() to verify the fix
2025-12-18 01:39:27 +08:00
satyam yadav dbe11a4d1c Update cap_dshow.cpp 2025-12-16 23:46:29 +05:30
Alexander Smorkalov e4d294d018 Merge pull request #28196 from vrabaud:msan
Prevent integer overflow in dimension checks.
2025-12-16 20:47:06 +03:00
Alexander Smorkalov 9f1a2d3736 Fixes for issues found by PVS Studio. 2025-12-16 18:34:20 +03:00
Alexander Smorkalov 2a29d87e1d Merge pull request #28137 from Ghazi-raad:fix/null-pointer-gapi-state-28095-v2
Fix null pointer dereference in G-API stateful kernels
2025-12-16 15:17:58 +03:00
Vincent Rabaud 5c6c584c01 Prevent integer overflow in dimension checks.
This fixes https://g-issues.oss-fuzz.com/issues/446726230
2025-12-16 13:09:31 +01: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
Alex 7ca9d9ce03 Merge pull request #27878 from 0lekW:ffmpeg-negative-dts-seeking-fix
Fix frame seeking with negative DTS values in FFMPEG backend #27878

**Merge with extra**: https://github.com/opencv/opencv_extra/pull/1289

Fixes https://github.com/opencv/opencv/issues/27819
Fixes https://github.com/opencv/opencv/issues/23472
Accompanied by PR on https://github.com/opencv/opencv_extra/pull/1289

The FFmpeg backend fails to correctly seek in H.264 videos that contain negative DTS values in their initial frames. This is a valid encoding practice used by modern video encoders (such as DaVinci Resolve's current export) where B-frame reordering causes the first few frames to have negative DTS values.

When picture_pts is unavailable (AV_NOPTS_VALUE), the code falls back to using pkt_dts:
`picture_pts = packet_raw.pts != AV_NOPTS_VALUE_ ? packet_raw.pts : packet_raw.dts;`

If this DTS value is negative (which is legal per H.264 spec), it propagates through the frame number calculation:
`frame_number = dts_to_frame_number(picture_pts) - first_frame_number;`

This results in negative frame numbers, messing up seeking operations.

Solution implemented in this branch is a timestamp normalization similar to FFmpegs -avoid_negative_ts_make_zero flag:
- Calculate a global offset once on the first decoded frame by getting the minimum timestamp in either:
    - Container start_time
    - Stream start_time
    - First observed timestamp (PTS, then DTS).
- Apply the offset consistently to all timestamps, shifting negative values to begin at 0 while keeping relative timing.
- Simplify timestamp converters to remove `start_time` subtractions since timestamps are pre-normalized.

This also includes a new test `videoio_ffmpeg.seek_with_negative_dts`
This test verifies that seeking behavior performs as expected on a file which has negative DTS values in the first frames. 
A PR on opencv_extra accompanies this one with that testing file: https://github.com/opencv/opencv_extra/pull/1279

```
opencv_extra=ffmpeg-videoio-negative-dts-test-data
```

<cut/>

### 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-16 11:38:51 +03:00
Abhishek Gola 33ebceddb2 Merge pull request #28168 from abhishek-gola:mergeDebevec_fix
Added 16U and 32F support in merge functions in photo module #28168

closes: https://github.com/opencv/opencv/issues/27873
### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-12-16 10:45:19 +03:00
Kumataro 9c48c69c8a Merge pull request #28179 from Kumataro:fix28178
js: add C++17 requirement check for Emscripten 4.0.20+ #28179
 
Close https://github.com/opencv/opencv/issues/28178

### 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-16 10:41:43 +03:00
Alexander Smorkalov fdb1ad3aa4 Merge pull request #28156 from asmorkalov:as/cuda_bufferpool_raise
Enabled Python test for CUDA BufferPool.
2025-12-16 10:37:50 +03:00
Alexander Smorkalov 75ede342cf Merge pull request #28186 from shahkarnav115-beep:fix-stitching-argparse-safety
samples(python): fix argparse boolean flag for --try_cuda
2025-12-16 10:22:19 +03:00
Alexander Smorkalov 507a0a6c5a Merge pull request #28192 from shahkarnav115-beep:fix-sample-launcher-selection
Fix crash in sample launcher when no item is selected
2025-12-16 10:21:54 +03:00
Karnav Shah 4e2c39b1a0 Fix crash in sample launcher when no item is selected 2025-12-16 11:30:55 +05:30
Alexander Smorkalov 7291f638b6 Merge pull request #28182 from shahkarnav115-beep:samples-guard-stft-timestep
samples(python): guard against invalid STFT time step
2025-12-15 19:26:01 +03:00
pratham-mcw ddf2863aaa NEON: fix incorrect accumulation in v_dotprod_expand_fast 2025-12-15 21:29:10 +05:30
Karnav Shah 1eb1157490 samples(python): fix argparse boolean flag for --try_cuda 2025-12-15 15:53:04 +05:30
Karnav Shah 9a7e88eb3e samples(python): guard against invalid STFT time step 2025-12-15 15:04:10 +05:30
Yuantao Feng 912d27a7b7 Merge pull request #28180 from fengyuentau:rvv_hal/flip
rvv_hal: fix flip inplace #28180

Fixes https://github.com/opencv/opencv/issues/28124

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-12-15 10:51:48 +03:00
Karnav Shah f5d6fe5392 Merge pull request #28176 from shahkarnav115-beep:docs-animation-frame-duration
Docs(imgcodecs): clarify animation frame duration units #28176

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake

Docs-only change. No code or tests affected.
2025-12-15 09:24:58 +03:00
satyam yadav 748d654535 Merge pull request #28173 from satyam102006:fix/issue-28165-videoio-ios-crash
videoio(ios): fix NSInvalidArgumentException in VideoWriter release #28173

Summary
Fixes a crash on iOS when calling `VideoWriter::release()` in OpenCV 4.12.0.

Issue
Fixes #28165

Detailed Description
This PR resolves a regression where an `NSInvalidArgumentException` was thrown with the message ` -[NSAutoreleasePool retain]: Cannot retain an autorelease pool`.

The crash was caused by the manual usage of `NSAutoreleasePool` in the `~CvVideoWriter_AVFoundation` destructor. The local pool variable was being captured by the completion handler block passed to `[mMovieWriter finishWritingWithCompletionHandler:]`. Since `NSAutoreleasePool` instances cannot be retained, capturing them in a block causes a crash.

Changes:
- Replaced manual `NSAutoreleasePool` allocation and draining with modern `@autoreleasepool` blocks in `CvVideoWriter_AVFoundation`.
- applied this modernization to the Constructor, Destructor, and `write` methods.
- Specifically in the destructor, an inner `@autoreleasepool` is now used inside the completion block, ensuring no pool object needs to be captured from the outer scope.
2025-12-14 15:25:52 +03:00
zdenyhraz c5d70a7f22 Merge pull request #28146 from zdenyhraz:iterative-phase-correlation
Iterative Phase Correlation #28146

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-12-13 12:45:05 +03:00
Alexander Smorkalov 3eb143cc22 Merge pull request #28139 from asmorkalov:as/webp_1.6.0
WebP update to version 1.6.0 #28139

### 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-13 12:44:01 +03:00
Alexander Smorkalov 579dfb6e02 Merge pull request #27640 from asmorkalov:as/kleidicv_mac
Enable KleidiCV on Linux and Mac Mx by default #27640

OpenCV Extra: https://github.com/opencv/opencv_extra/pull/1296

### 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-11 18:06:39 +03:00
Stefania Hergane dee619b628 Merge pull request #28127 from StefaniaHergane:hs/deprecated_ov_element_undefined
Update deprecated ov::element::undefined #28127

### Summary
Fixing OpenCV build error below.
Relates to OpenVINO 2026.0 updates on `ov::element::undefined` (https://github.com/openvinotoolkit/openvino/pull/32573) - replaced by `ov::element::dynamic`.
```
/home/jenkins/agent/workspace/openVINO-builder/opencv_source/opencv-opencv-f627368/modules/gapi/src/backends/ov/govbackend.cpp
[2025-12-03T21:25:54.540Z] /home/jenkins/agent/workspace/openVINO-builder/opencv_source/opencv-opencv-f627368/modules/gapi/src/backends/ov/govbackend.cpp: In function ���ov::element::Type toOV(int)���:
[2025-12-03T21:25:54.540Z] /home/jenkins/agent/workspace/openVINO-builder/opencv_source/opencv-opencv-f627368/modules/gapi/src/backends/ov/govbackend.cpp:114:25: error: ���undefined��� is not a member of ���ov::element���
[2025-12-03T21:25:54.540Z]   114 |     return ov::element::undefined;
...
/home/jenkins/agent/workspace/openVINO-builder/opencv_source/opencv-opencv-f627368/modules/gapi/test/infer/gapi_infer_ov_tests.cpp
[2025-12-03T21:26:19.642Z] /home/jenkins/agent/workspace/openVINO-builder/opencv_source/opencv-opencv-f627368/modules/gapi/test/infer/gapi_infer_ov_tests.cpp: In function ���ov::element::Type opencv_test::toOV(int)���:
[2025-12-03T21:26:19.642Z] /home/jenkins/agent/workspace/openVINO-builder/opencv_source/opencv-opencv-f627368/modules/gapi/test/infer/gapi_infer_ov_tests.cpp:832:25: error: ���undefined��� is not a member of ���ov::element���
[2025-12-03T21:26:19.642Z]   832 |     return ov::element::undefined;
```

### 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-10 17:48:35 +03:00
Dmitry Kurtaev 334b7146f5 Merge pull request #28157 from dkurt:normalize_vec_qrdetect
Remove floating point arithmetic from angle computation in QR codes #28157

### Pull Request Readiness Checklist

resolves https://github.com/opencv/opencv/issues/24646

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-10 10:20:08 +03:00
Ghazi-raad f704001eb7 Merge pull request #28120 from Ghazi-raad:test/line-connectivity-26413
Test: Add regression test for LINE_4 vs LINE_8 connectivity #28120 

Add test to verify correct behavior of LINE_4 (4-connected) and LINE_8 (8-connected) line drawing. This test ensures:

- LINE_4 produces staircase pattern (more pixels) for diagonal lines
- LINE_8 produces diagonal steps (fewer pixels)
- LINE_4 pixels have only horizontal/vertical neighbors (no diagonal-only)

Regression test for issue #26413 where LINE_4 and LINE_8 behaviors were swapped.
2025-12-09 15:59:24 +03:00
Skreg 2bf4f5c151 Merge pull request #26366 from shyama7004:fix-orb.cpp
Fix ORB inconsistency for masks with values 255 and 1. #26366

### Pull Request Readiness Checklist

The PR fixes : [25974](https://github.com/opencv/opencv/issues/25974)

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-12-09 14:31:53 +03:00
Alexander Smorkalov 02628f0188 Enabled Python test for CUDA BufferPool. 2025-12-09 12:09:41 +03:00
Alexander Smorkalov 9a9ae12475 Merge pull request #28147 from asmorkalov:as/libpng_1.6.53
libpng update to version 1.6.53.
2025-12-09 12:07:24 +03:00
shubham khatri 498853d996 Merge pull request #28143 from Shubh3155:fix-js-ptr-factory-namespace
Fix JS bindings for namespaced Ptr factory return types #28143

This PR fixes an issue in the JS bindings generator for factory functions returning cv::Ptr<T> where T belongs to a namespaced class (for example cv::ximgproc::EdgeDrawing).
The generator previously produced unqualified C++ template arguments such as:
.constructor(select_overload<Ptr<EdgeDrawing>()>(&cv::ximgproc::createEdgeDrawing))

This results in invalid C++ because EdgeDrawing is not found in the global namespace.

Fixes https://github.com/opencv/opencv/issues/28130

In modules/js/generator/embindgen.py, inside both:

gen_function_binding_with_wrapper

gen_function_binding

a check is added:

When factory == True,

And the return type begins with Ptr<...>,

And the inner type is missing a namespace (::),
Ptr<T>  →  Ptr<class_info.cname>

This ensures the fully-qualified class name (e.g. cv::ximgproc::EdgeDrawing) is used in the generated bindings.

.constructor(select_overload<Ptr<cv::ximgproc::EdgeDrawing>()>(&cv::ximgproc::createEdgeDrawing))

Configured OpenCV with:
cmake .. -DBUILD_opencv_js=ON

Ran:
make -j gen_opencv_js_source

JS generator completed successfully without errors.

This change does not modify generated files directly — it modifies the generator logic so the correct namespace is applied automatically.
2025-12-09 12:05:55 +03:00
Alexander Smorkalov 0e2373557b Merge pull request #28119 from galinabykova:approxPolyDP_fix_distance_segment
fix bug in approxPolyDP: calculate distance to a segment, not to a straight line
2025-12-09 10:59:33 +03:00
Alexander Smorkalov e345632aeb Merge pull request #28145 from ramukhsuya:fix-convert-rgb-docs
Docs: Fix CAP_PROP_CONVERT_RGB description to BGR (Fixes #22697)
2025-12-09 10:58:11 +03:00
Alexander Smorkalov 192f0d620e Merge pull request #28149 from vrabaud:rotacli
Increase minAreaRect accuracy
2025-12-09 10:30:07 +03:00
Alexander Smorkalov 5599da14f7 Merge pull request #28155 from vrabaud:msan
Disable MSAn for lapack_LU
2025-12-09 08:24:50 +03:00
Vincent Rabaud 01f2f3c4b9 Disable MSAn for lapack_LU
One of the arguments is sent to Fortran so the whole function has
to be disabled fro MSAN. Arguments cannot be unpoisoned, cf
https://g3doc.corp.google.com/testing/msan/g3doc/index.md?cl=head#memorysanitizer-api
2025-12-08 21:53:53 +01:00
Alexander Smorkalov c25e48249f Merge pull request #28148 from vrabaud:windows
Add missing combaseapi.h include.
2025-12-08 18:07:50 +03:00
Alexander Smorkalov 1d5bf7a09c Merge pull request #28141 from asmorkalov:as/orbbec_diagnostics
Added Orbbec cameras support to CMake diagnostics.
2025-12-08 14:07:24 +03:00
Vincent Rabaud 4d7ce375fc Increase minAreaRect accuracy
Just keep doubles all the way and avoid arithmetic with CV_PI/2
2025-12-08 09:44:02 +01:00
Alexander Smorkalov 318e2e26bd Merge pull request #28134 from dg0yt:in-lists
Fix CMake foreach loops
2025-12-08 11:25:24 +03:00
Alexander Smorkalov 3574a2fe19 Merge pull request #28128 from asmorkalov:as/qt_unicode
Fixed unicode tracing symbols with QT
2025-12-08 10:58:15 +03:00
Vincent Rabaud c6220c2b47 Add missing combaseapi.h include.
This is needed for CoCreateGuid.
2025-12-08 08:53:54 +01:00
Alexander Smorkalov 1288aace98 libpng update to version 1.6.53. 2025-12-08 10:34:20 +03:00
Alexander Smorkalov bd54424f03 Merge pull request #28140 from asmorkalov:as/openjpeg_2.5.4
OpenJPEG update to 2.5.4 #28140

### 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-08 08:59:51 +03:00
Alexander Smorkalov fc6c6bf7de Merge pull request #28142 from parekh-parth2001:doc-imwrite-return
Document imwrite boolean return value
2025-12-08 08:56:41 +03:00
ramukhsuya 6460332780 Docs: Fix CAP_PROP_CONVERT_RGB description to BGR (Fixes #22697) 2025-12-07 19:35:25 +05:30
Alexander Smorkalov 927beeacf6 Merge pull request #28138 from Kumataro:trial26447
doc: add supported src type info for each ColorConversionCodes
2025-12-07 15:26:13 +03:00
Parth Parekh 201db16aa2 Document boolean return value of imwrite 2025-12-07 14:25:56 +05:30
Alexander Smorkalov 7a1425ca2c Added Orbbec cameras support to CMake diagnostics. 2025-12-07 11:38:29 +03:00
Alexander Smorkalov 55eb43fa28 Merge pull request #28131 from Kumataro:chore_libpng_1_6_52
chore: Synchronize 3rdparty libpng version to 1.6.52 in README/CHANGES
2025-12-07 10:13:20 +03:00
Kumataro 7971cbc7d0 doc: add supported src type info for each ColorConversionCodes 2025-12-07 00:33:02 +09:00
Ghazi-raad 5a0679b862 Fix null pointer dereference in G-API stateful kernels
Fixes #28095

Problem:
- Stateful kernels dereference null state pointer on line 446 in gcpukernel.hpp
- jinboson confirmed state_ptr is null on x86 Ubuntu (7 hours ago)
- Causes crash with std::shared_ptr assertion on LoongArch64 and strict platforms

Solution (addressing Copilot review feedback from PR #28096):
1. Added null pointer check using CV_Error instead of CV_Assert:
   - CV_Assert with && 'message' doesn't display the message correctly
   - CV_Error properly reports cv::Error::StsNullPtr with clear message

2. Fixed test kernels to properly initialize state using std::make_shared:
   - GOCVStInvalidResize: Initialize state in setup()
   - GOCVCountStateSetups: Initialize state before incrementing counter
   - Used std::make_shared<int>() for modern C++ best practice

Impact:
- Prevents crashes on platforms with strict null pointer checking
- Provides actionable error message for developers
- Fixes StatefulKernel.StateInitOnceInRegularMode and InvalidReallocatingKernel tests
2025-12-06 12:45:48 +00:00
Kai Pastor 6fc0f38e1c Fix CMake foreach loops 2025-12-06 11:03:53 +01:00
Kumataro 29f44b4530 chore: Synchronize 3rdparty libpng version to 1.6.52 in README/CHANGES 2025-12-06 08:33:27 +09:00
Alexander Smorkalov 324d489e71 Updated libpng to v1.6.52 and added RISC-V optimimizations. (#28111)
* Updated libpng to v1.6.51 and added RISC-V optimimizations.

* Force 3rdparty build for CI test.

* Added RISC-V RVV diagnostics for PNG.

* RISC-V RVV diagnostic fix.

* Disabled incorrect in-place flip HAL on RISC-V RVV.

* Disabled risc-v rvv of  png_read_filter_row_paeth in libpng.

* Set PNG simd configuration defaults accornding to OpenCV settings.

* Update to libpng 1.6.52 with RISC-V RVV fix.

* Build fix for RISC-V RVV.

* Reverted CI changes.
2025-12-05 17:17:22 +03:00
Alexander Smorkalov de660aedca Reverted CI changes. 2025-12-05 16:00:14 +03:00
Alexander Smorkalov fd11f635c1 Merge pull request #28122 from asmorkalov:as/dynamic_openmp
Dropped OPENCV_FOR_OPENMP_DYNAMIC_DISABLE environment varibale in favor of standard OMP_DYNAMIC #28122

Fixes: https://github.com/opencv/opencv/issues/25717
Replaces: https://github.com/opencv/opencv/pull/28084

### 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-05 14:13:19 +03:00
Alexander Smorkalov 92ea2c324b Fixed unicode tracing symbols with QT. 2025-12-05 08:45:32 +03:00
Alexander Smorkalov 98d065370c Build fix for RISC-V RVV. 2025-12-05 08:08:36 +03:00
Alexander Smorkalov d88f080b7e Update to libpng 1.6.52 with RISC-V RVV fix. 2025-12-05 07:52:26 +03:00
Alexander Smorkalov ab23a89975 Set PNG simd configuration defaults accornding to OpenCV settings. 2025-12-04 18:07:21 +03:00
Alexander Smorkalov 8807d75566 Merge pull request #28125 from asmorkalov:as/disable_riscv_flip
Disabled incorrect in-place flip HAL on RISC-V RVV
2025-12-04 17:41:12 +03:00
Alexander Smorkalov e669a955c7 Disabled risc-v rvv of png_read_filter_row_paeth in libpng. 2025-12-04 16:35:02 +03:00
Alexander Smorkalov e5075ffa33 Disabled incorrect in-place flip HAL on RISC-V RVV. 2025-12-04 14:55:31 +03:00
Alexander Smorkalov 71d49c2dc2 Disabled incorrect in-place flip HAL on RISC-V RVV. 2025-12-04 14:53:33 +03:00
Alexander Smorkalov 1d8d76cd50 RISC-V RVV diagnostic fix. 2025-12-04 11:28:32 +03:00
Gursimar Singh b1d75bf477 Merge pull request #28078 from gursimarsingh:codeql-migration
Adding github CodeQL #28078

Related pipeline in CI repo: https://github.com/opencv/ci-gha-workflow/pull/280

### 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-12-03 11:15:59 +03: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
Alexander Smorkalov e3fe5a5681 Merge pull request #28112 from asmorkalov:as/jpeg_turbo_3.1.2
Merge pull request #28112 from asmorkalov:as/jpeg_turbo_3.1.2

### Pull Request Readiness Checklist

Previous update: https://github.com/opencv/opencv/pull/27031

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-03 10:26:44 +03:00
Alessandro de Oliveira Faria (A.K.A.CABELO) 9c3d3dbee7 Merge pull request #28082 from cabelo:4.x
Analog Gauge Reader - cabelo@opensuse.org #28082

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake

I humbly offer this example so that all developers can understand that many problems can be solved without VLM models.

<img width="269" height="267" alt="image" src="https://github.com/user-attachments/assets/d31f1557-7648-4e9c-8933-dcadb1f326aa" />
<img width="269" height="267" alt="image" src="https://github.com/user-attachments/assets/4039417c-b5c9-4228-ac7b-5336aeb88325" />
<img width="840" height="288" alt="image" src="https://github.com/user-attachments/assets/53f8ddf9-63cd-43b1-bff0-2e9e39d14153" />
2025-12-03 10:05:50 +03:00
Alexander Smorkalov 5a4f23f9d6 Merge pull request #28088 from Ghazi-raad:fix/drawcontours-line-type-swap-26413
Fix LINE_4/LINE_8 swap in drawContours (issue #26413)
2025-12-03 09:34:01 +03:00
sinkboy-chen 4c7fd071f0 Merge pull request #28118 from sinkboy-chen:bugfix/cuda-race-condition
stitching: pass warp params by value to avoid CUDA constant races #28118

### 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 the Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on 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 are accuracy tests, performance tests, and test data in the opencv_extra repository, if applicable.  
      The patch to opencv_extra uses the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake configuration.

Fixes #26870.

In `modules/stitching/src/cuda/build_warp_maps.cu`, the original implementation copied parameters into global GPU constant symbols:

```cpp
cudaSafeCall(cudaMemcpyToSymbol(build_warp_maps::ck_rinv, k_rinv, 9 * sizeof(float)));
cudaSafeCall(cudaMemcpyToSymbol(build_warp_maps::cr_kinv, r_kinv, 9 * sizeof(float)));
cudaSafeCall(cudaMemcpyToSymbol(build_warp_maps::cscale, &scale, sizeof(float)));
```

As discussed in the issue, this can cause race conditions when multiple warps are built concurrently. This patch removes the use of these global constant symbols and instead passes the required data as kernel parameters (a total of 11 floats encapsulated in `WarpParams`).

One potential concern is increased register pressure due to additional kernel arguments. However, based on experiments using the test case from issue #26870, there is no significant performance regression; in fact, a small speed‑up was observed.

Testing was performed on an NVIDIA GeForce RTX 4090 (single GPU).

Note: ./bin/opencv_perf_stitching did not run successfully on my system even with an unmodified git checkout, so performance was evaluated using the test case from issue #26870 instead.
2025-12-03 08:51:59 +03:00
Alexander Smorkalov 2c8cfdebde Added RISC-V RVV diagnostics for PNG. 2025-12-02 10:40:01 +03:00
Galina Bykova fc7e70ef4a fix bug in approxPolyDP: calculate distance to a segment, not to a line 2025-12-01 21:22:11 +03:30
Alexander Smorkalov 54d066b89c Force 3rdparty build for CI test. 2025-12-01 17:14:08 +03:00
Alexander Smorkalov e47916120f Updated libpng to v1.6.51 and added RISC-V optimimizations. 2025-12-01 13:47:27 +03:00
Alexander Smorkalov a08565253e Merge pull request #28102 from satyam102006:fix-issue-28101
highgui: fix memory leak in CvWindow Qt backend
2025-12-01 10:50:15 +03:00
Alexander Smorkalov 6bc22ad5c3 Merge pull request #28091 from ParalYAO:fix/brisk/descriptor-calculation-pointer-bug
fix(features2d): Correct pointer arithmetic in BRISK corner traversal
2025-12-01 10:34:12 +03:00
satyam yadav fbd550438f Merge pull request #28073 from satyam102006:issue-OpenCV-to-MSMF-
catch _com_error exceptions to suppress debugger flooding #28073

Resolves: #27643

This PR fixes an issue where the Microsoft Media Foundation (MSMF) backend triggers repeated C++ exceptions (_com_error) during video capture. While these exceptions are often non-fatal "first-chance" exceptions, they cause the Visual Studio debugger to break execution repeatedly, making debugging difficulty and flooding the output window.

Changes
cap_msmf.cpp: Added try-catch blocks around critical COM interaction paths.

Updated SourceReaderCB::OnReadSample (Async callback) to catch _com_error.

Updated CvCapture_MSMF::grabFrame (Synchronous grab) to catch _com_error.

Added CV_LOG_WARNING to log the error message from the caught exception, ensuring that actual errors are still visible in the logs without crashing the application or halting the debugger.

Impact
Users debugging OpenCV applications on Windows with Visual Studio will no longer be interrupted by internal MSMF exceptions when using the default backend.

The application flow remains uninterrupted even if MSMF encounters transient internal errors.
2025-12-01 09:07:08 +03:00
satyam yadav be607ce6c8 memory leak 2025-11-30 17:57:21 +05:30
Alexander Smorkalov 1c712fe2ff Merge pull request #28093 from AKash-A007:fix-pytest-cov-warnings-27867
python: fix pytest-cov false warnings by compiling config scripts with full path (#27867)
2025-11-28 13:21:35 +03:00
Ghazi-raad 47a6419290 Merge pull request #28086 from Ghazi-raad:fix/aravis-default-pixel-format-26523
fix: set default pixel format for Aravis cameras when unsupported format #28086

Fixes #26523

This PR fixes an issue where Aravis VideoCapture returns empty frames when the camera's pixel format is not explicitly set via CAP_PROP_FOURCC.

Problem:

The Aravis backend's retrieveFrame() function only processes four specific pixel formats:
- ARV_PIXEL_FORMAT_MONO_8
- ARV_PIXEL_FORMAT_BAYER_GR_8
- ARV_PIXEL_FORMAT_MONO_12
- ARV_PIXEL_FORMAT_MONO_16

If the camera has a different pixel format configured (or the camera's default format is unsupported), retrieveFrame() returns false on line 333 and all frames appear empty. This happens even though:
- The camera opens successfully (isOpened() returns true)
- The camera is capturing data
- The user has set up autotrigger and auto-exposure correctly

Root Cause:

In open() at line 271, the code retrieves the camera's current pixel format with arv_camera_get_pixel_format(). But if this format doesn't match one of the four supported formats, there's no fallback, causing all subsequent frames to fail retrieval.

Solution:

Added a check after retrieving the camera's pixel format. If the format is not one of the four supported formats, the code now:
1. Sets pixelFormat to a sensible default (MONO_8)
2. Applies this format to the camera via arv_camera_set_pixel_format()

This ensures:
- Cameras work out-of-the-box without requiring explicit CAP_PROP_FOURCC setup
- Users can still override the format with CAP_PROP_FOURCC if needed
- Behavior matches user expectations from other camera backends (V4L2, MSMF, etc.)

The default of MONO_8 was chosen because it's the most universally supported format across USB3 Vision and GigE Vision cameras.

Changes:

modules/videoio/src/cap_aravis.cpp: Added pixel format validation and default setting (10 lines)

Testing:

With this fix:
- Cameras with unsupported default formats will automatically switch to MONO_8
- The sample code from the issue works without uncommenting the CAP_PROP_FOURCC line
- Users can still explicitly set their preferred format via CAP_PROP_FOURCC

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 (issue #26523)
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      N/A - This requires specialized USB3 Vision / GigE Vision hardware not available in CI
- [x] The feature is well documented and sample code can be built with the project CMake
      The fix maintains existing API behavior and makes the backend work as expected
2025-11-28 12:40:08 +03:00
Alexander Smorkalov 329f0fddaf Merge pull request #28092 from dkurt:flatbuffers_25.9.23
Update FlatBuffers source code to 25.9.23
2025-11-28 10:54:30 +03:00
Akash Arunkumar 13210cbb1d python: fix pytest-cov false warnings by using compile() with full file path in exec_file_wrapper 2025-11-27 17:31:05 +00:00
Dmitry Kurtaev 895be753ac Update FlatBuffers source code to 25.9.23 2025-11-27 18:31:10 +03:00
Ghazi-raad 2cf9c68da0 Merge pull request #28087 from Ghazi-raad:fix/tempfile-race-condition-19648
Fix tempfile race condition on Windows (issue #19648) #28087

Fix tempfile race condition on Windows

Addresses issue #19648

Problem
The cv::tempfile() function on Windows used GetTempFileNameA() followed by an immediate DeleteFileA() call. This created a race condition where multiple OpenCV processes running simultaneously could receive the same temporary filename, leading to name collisions.

Root Cause
The previous implementation:

Called GetTempFileNameA() to generate a temp filename
Immediately deleted the file to free the name
Returned just the filename string
Between steps 2 and 3, another process could call GetTempFileNameA() and receive the same filename, causing a collision.

Solution
Replaced GetTempFileNameA() with GUID-based filename generation using CoCreateGuid(), following the same approach already used in GetTempFileNameWinRT() and Microsoft's recommendations for scenarios requiring many temp files.

Changes
modules/core/src/system.cpp:

Removed GetTempFileNameA() and DeleteFileA() calls
Added CoCreateGuid() to generate unique GUID-based filenames
Format: "ocv{GUID}" where GUID ensures uniqueness across processes
Benefits

Eliminates race condition in multi-process scenarios
No file I/O overhead from creating and deleting placeholder files
Consistent with WinRT implementation approach
Follows Microsoft best practices
Testing
Standard OpenCV test suite. The change only affects Windows temp file naming and maintains the same String return type and usage pattern.
2025-11-27 17:57:42 +03:00
Haodi Yao 29746ab963 fix(features2d): Correct pointer arithmetic in BRISK corner traversal
The pointer offset to move from top-right to bottom-right was incorrect. This change corrects the pointer calculation to use the proper row stride, ensuring it lands on the correct pixel.
2025-11-27 16:34:26 +08:00
Alexander Smorkalov 641a7aa2a6 Merge pull request #28090 from asmorkalov:as/system_aravis
Unblock system-wide installation of Aravis SDK.
2025-11-27 10:18:21 +03:00
Ghazi-raad 71c759b7cd Merge pull request #28085 from Ghazi-raad:fix/multiband-blender-memory-leak-27333
Fixed multiband blender memory leak 27333 #28085

Fixes #27333

This PR fixes a memory leak in MultiBandBlender where memory from pyramid vectors was not being released when prepare() was called multiple times or when the blender object was reused.

Problem:

MultiBandBlender retains hundreds of MB to several GB of memory even after the blender pointer is released. The issue occurs because:

1. The resize() function on std::vector does not release memory when the new size is less than or equal to the current size
2. It only adjusts the size marker while retaining the capacity and existing data
3. When prepare() is called, the pyramid vectors are resized but old data remains allocated

Example from the bug report: Blending 14 images (1920x1080) retained ~200MB after blender.release(). With larger images, several GB could be retained.

Root Cause:

GPU path (lines 254-256): Correctly calls clear() before operations
Non-GPU path (lines 285-298): Missing clear() calls, causing resize() to retain old data

Solution:

Added .clear() calls before .resize() in the non-GPU path to match the GPU path behavior. This ensures:
- Memory from previous blend operations is released in prepare()
- Reusing a blender object doesn't accumulate memory
- Behavior is consistent between GPU and non-GPU code paths

Changes:

modules/stitching/src/blenders.cpp: Added 2 clear() calls (dst_pyr_laplace_.clear() and dst_band_weights_.clear()) before resize() in the non-GPU path

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 (issue #27333)
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      N/A - This is a memory management fix that doesn't affect algorithm behavior. Existing stitching tests verify correctness.
- [x] The feature is well documented and sample code can be built with the project CMake
      The fix maintains existing API behavior, no documentation changes needed
2025-11-27 09:57:21 +03:00
Alexander Smorkalov 1c2cdb1818 Unblock system-wide installation of Aravis SDK. 2025-11-27 09:38:43 +03:00
Ghazi-raad a27a13921b Fix LINE_4/LINE_8 swap in drawContours (issue #26413)
Changed condition to correctly route LINE_8 to Line() instead of Line2().

The condition 'line_type == 1 || line_type == 4' was causing LINE_8 (value 8)
to be processed by Line2() which implements 4-connectivity, and LINE_4 (value 4)
to be processed by Line() which was implementing 8-connectivity behavior. This
resulted in swapped line connectivity.

Changed to 'line_type == 1 || line_type == 8' so LINE_8 goes to Line() with
8-connectivity and LINE_4 goes to Line2() with 4-connectivity, matching the
documented behavior where LINE_4 should produce 4-connected lines and LINE_8
should produce 8-connected lines.

Fixes #26413
2025-11-26 21:41:28 +00:00
Alexander Smorkalov 4da9a518ef Merge pull request #28076 from asmorkalov:as/ubuntu_arm_update
Update ARM config label to Ubuntu 24.04.
2025-11-26 17:05:50 +03:00
Alexander Smorkalov 638f372c2e Update ARM config label to Ubuntu 24.04. 2025-11-26 16:47:13 +03:00
Anshu 166f4591d2 Merge pull request #28047 from 0AnshuAditya0:fix-pyos-fspath-memory-leak
Fix memory leak in pyopencv_to for path-like objects #28047
   
This PR fixes a memory leak in pyopencv_to when handling path-like objects (e.g., pathlib.Path).
Problem:
PyOS_FSPath() returns a new strong reference, but the code was not calling Py_XDECREF to decrement it, causing a memory leak on every call with path-like arguments.
Solution:

Store the returned reference from PyOS_FSPath() in a separate variable path_obj
Call Py_XDECREF(path_obj) on all function exit paths (both success and error paths)
This ensures proper reference counting without changing the function's behavior

Testing:
The leak can be reproduced using the steps in issue #28046 with Python built with --with-address-sanitizer. This fix ensures the reference is properly released.
Fixes #28046

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

 ✓ I agree to contribute to the project under Apache 2 License.
 ✓ 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 (4.x)
 ✓ There is a reference to the original bug report and related work (#28046)
 NA 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-11-26 12:18:42 +03:00
Dmitry Kurtaev 621ad482d6 Merge pull request #28051 from dkurt:minAreaRect_angle
Correct minAreaRect angle to be in range [-90, 0) #28051

### Pull Request Readiness Checklist

Box angle range over all imgproc tests is in interval `[-90, -0.0581199]`

resolves https://github.com/opencv/opencv/issues/27667
resolves https://github.com/opencv/opencv/issues/19472
resolves https://github.com/opencv/opencv/issues/24436

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-11-25 15:56:59 +03:00
Alexander Smorkalov 52a5b6c3df Merge pull request #28065 from AKash-A007:fix-avif-matrixcoeff-unspecified
imgcodecs: avif: use UNSPECIFIED matrixCoefficients instead of IDENTITY for YUV400
2025-11-25 09:19:41 +03:00
Alexander Smorkalov 09a92e811b Merge pull request #28072 from Kumataro:fix28071
imgcodecs: avif: support to encode with metadata for 1ch Mat
2025-11-25 09:19:00 +03:00
Kumataro 3c3596c6ef Merge pull request #28063 from Kumataro:fix28062
imgcodecs: Fix IMWRITE_AVIF_DEPTH typo and update AVIF details on imwrite() #28063

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

- Corrected the documentation for `IMWRITE_AVIF_DEPTH`.
- Added descriptions for the new AVIF encoder parameters in `imwrite()` documentation.

### 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-11-24 10:46:12 +03:00
Alexander Smorkalov d54fb714eb Merge pull request #28067 from dimitre:4.x
typo COMPENSACTION -> COMPENSATION
2025-11-24 10:43:59 +03:00
Alexander Smorkalov 71b476b256 Merge pull request #28059 from cabelo:realsense
Just original author.
2025-11-24 09:31:28 +03:00
Kumataro 6617a7ca34 imgcodecs: avif: support metadata for 1ch Mat 2025-11-24 08:19:25 +09:00
Akash A 79cfef49ff imgcodecs: avif: set matrixCoefficients to UNSPECIFIED for monochrome images
Fixes issue with libavif >= 1.3.0 where subsampling with identity matrix
coefficients is invalid. Aligns OpenCV AVIF writer with updated libavif
conformance rules.
2025-11-23 12:13:54 +00:00
Alessandro de Oliveira Faria (A.K.A. CABELO) 76c1c60d7b Just original author. 2025-11-22 15:15:00 -03:00
Alexander Smorkalov 49607438bd Merge pull request #28048 from asmorkalov:as/stateless_hal_filtering
Improved HAL status check for filter, sepFilter and morphology operations to support stateless HAL
2025-11-22 12:41:05 +03:00
Alexander Smorkalov 79fd6d018b Merge pull request #28052 from JayPol559:fix-openblas-28049
Fix OpenBLAS detection on Fedora/RHEL: header path + threaded library selection (Issue #28049)
2025-11-22 12:39:59 +03:00
Dmytro Dadyka 6231b080ff Merge pull request #27952 from DDmytro:ecc/template-mask-rework
Add optional template mask for findTransformECC #27952

Supersedes #22997

**Summary**
Add optional template mask support to findTransformECC so that only pixels valid in both the template and the image are used in ECC. Backward compatibility is preserved (existing signatures unchanged; one new overload adds templateMask).

**Motivation**

- Real-world frames often contain moving foreground artifacts (e.g., a football over a static field). Masking the object in one frame only is insufficient because its position changes independently of the background. Since we don’t know the warp a priori, we can’t back-project a single mask across frames. The correct approach is to supply both masks and take their intersection.
- Templates may include uninformative/low-texture or noisy regions, or partial overlaps with other objects. Excluding such regions from the alignment improves robustness and convergence.

This PR completes and replaces https://github.com/opencv/opencv/pull/22997

### 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-11-21 11:50:29 +03:00
Dmitry Kurtaev 2cc5b69fd1 Merge pull request #28043 from dkurt:d.kurtaev/convexHull_eps
Handle near-zero convexity in convexHull #28043

### Pull Request Readiness Checklist

resolves https://github.com/opencv/opencv/issues/21482
closes https://github.com/opencv/opencv/issues/14401

Also skip a code that determines orientation inside rotatingCalipers and rely on the order after convexHull

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-11-21 10:54:38 +03:00
Adrian Kretz c0364e4e31 Merge pull request #27993 from akretz:undistortPoints_convergence
Undistort points convergence #27993

I have looked into the `undistortPoints()` problem of issue #27916 and have found a solution. The problem is, as @Linhuihang has correctly pointed out, that the fixed-point iterations do not converge. Here are the functions which are optimized for the undistortion problem:

$$
\begin{aligned}
  r^2  &= x'^2 + y'^2 \\
  f_1(x') &= \frac{1 + k_4 r^2 + k_5 r^4 + k_6 r^6}{1 + k_1 r^2 + k_2 r^4 + k_3 r^6} (x'' - 2p_1 x' y' - p_2(r^2 + 2 x'^2) - s_1 r^2 + s_2 r^4) = x' \\
  f_2(y') &=  \frac{1 + k_4 r^2 + k_5 r^4 + k_6 r^6}{1 + k_1 r^2 + k_2 r^4 + k_3 r^6} (y'' - p_1 (r^2 + 2 y'^2) - 2 p_2 x' y' - s_3 r^2 - s_4 r^4) = y'
\end{aligned}
$$

where $x', y'$ are the undistorted points we want to compute and and $x'', y''$ are the given distorted points. This problem is solved using fixed-point iterations like

$$
  x'_{k+1} = f_1(x'_k),\quad
  y'_{k+1} = f_2(y'_k)
$$

I guess the issue here is that the distortion function does not necessarily satisfy the [Banach fixed-point theorem](https://en.wikipedia.org/wiki/Banach_fixed-point_theorem), i.e. the slope of the function can be too large. This can be seen in @Linhuihang's comment https://github.com/opencv/opencv/issues/27916#issuecomment-3417883642 - the point series jumps around and doesn't converge.

A common solution is to instead do damped fixed-point iterations, so that the updates are "more smooth".

$$
  x'_{k+1} = (1 - \alpha) x'_k + \alpha f_1(x'_k),\quad
  y'_{k+1} = (1 - \alpha) y'_k + \alpha f_2(y'_k)
$$

I have implemented a simple logic which starts with $\alpha = 1$ (so just like it is now) and reduces $\alpha$ whenever the optimization error would increase. This seems reasonable to me: the initial logic is to do normal fixed-point iterations and to gradually become "more damped" when we notice that we don't converge. Perhaps there is a better way to ensure convergence, but this is the most straightforward modification to the current code that I have found.

This problem is not due to the $\tau_x, \tau_y$ parameters; it also occurs when they are zero. In fact, the fixed-point iterations are done when the tilt correction of $\tau_x, \tau_y$ has already been applied. I have added a test to reproduce the problem. This PR fixes #27916.


### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-11-21 10:52:02 +03:00
Pierre Chatelier fdf0332954 Merge pull request #23913 from chacha21:GpuMatND_InputOutputArray
make cuda::GpuMatND compatible with InputArray/OutputArray #23913

continuation of  [PR#19259](https://github.com/opencv/opencv/pull/19259) 

Make cuda::GpuMatND wrappable in InputArray/OutputArray
The goal for now is just wrapping, some functions are not supported (InputArray::size(), InputArray::convertTo(), InputArray::assign()...)

No new feature for cuda::GpuMatND

- [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-11-21 08:41:12 +03:00
JayPol999 35f82d4599 Fix OpenBLAS detection on Fedora/RHEL (Issue #28049) 2025-11-20 23:24:55 +05:30
Alexander Smorkalov b90041b30a Merge pull request #27975 from asmorkalov:as/windows_arm_round
Use rounding intrinsic on Windows for ARM
2025-11-20 20:09:46 +03:00
Alexander Smorkalov f7d3850183 Use rounding intrinsic on Windows for ARM. 2025-11-20 18:51:59 +03:00
Alexander Smorkalov 308631197f Improved HAL status check for filter, sepFilter and morphology operations to support stateless HAL. 2025-11-20 08:55:03 +03:00
Alexander Smorkalov 8fb0b7177f Merge pull request #28040 from vrabaud:bmp
Avoid integer overflow in BmpDecoder::readData
2025-11-19 15:40:49 +03:00
Vincent Rabaud 01cce12ce7 Avoid integer overflow in BmpDecoder::readData
This solves https://g-issues.oss-fuzz.com/issues/457623761
2025-11-19 10:20:06 +01:00
Alexander Smorkalov f627368ebc Merge pull request #28029 from StefaniaHergane:hs/govbackend_update_ov_tensor_data_usage
Update usage of ov::Tensor::data in govbackend
2025-11-18 11:08:19 +03:00
Stefania Hergane 67bece1d99 Update usage of ov::Tensor::data in govbackend.cpp
Signed-off-by: StefaniaHergane <stefania-persida.hergane@intel.com>
2025-11-17 16:20:24 +00:00
Alexander Smorkalov 2a5f3980f0 Merge pull request #26480 from saolaolsson:consistent-termcriteria-for-undistortimagepoints
Make undistortImagePoints default criteria undistortPoints consistent
2025-11-17 13:35:28 +03:00
Kumataro 6f74546488 Merge pull request #27318 from Kumataro:fix27298
core: add copyAt() for ROI operation #27318

Close https://github.com/opencv/opencv/issues/27320
Close https://github.com/opencv/opencv/issues/27298

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-11-17 10:58:20 +03:00
Alexander Smorkalov 6d52d416e8 Merge pull request #28026 from harunresit:fix-27966-torch
Unnecessary copy of Mat object is fixed in TorchImporter
2025-11-17 10:54:51 +03:00
Anshu 8fec01d73e Merge pull request #28017 from 0AnshuAditya0:fix-audio-buffer-calculation-27969
Optimize audio buffer duration calculation in MSMF capture. Fixes #27969 #28017

### Description
Cache the repeated calculation of `(bit_per_sample/8)*nChannels` in a local variable to avoid redundant computations in `grabFrame()` and `configureAudioFrame()` functions.

### Changes
- Added `bytesPerSample` local variable in both functions
- Replaced 6 repeated calculations with the cached variable
- Improves performance in frequently called audio processing code

Fixes #27969
2025-11-17 10:52:11 +03:00
harunresit 7a0b9f35b5 Initial commit 2025-11-16 21:20:33 +01:00
Alexander Smorkalov 5bec733bfb Merge pull request #28015 from bebuch:fix-msvc-vs-2026
add MSVC 19.50 / VS 2026 / VC 18 to config: fix #28013
2025-11-16 19:25:03 +03:00
Alexander Smorkalov 42cf71285e Merge pull request #28018 from satyam102006:fix/dnn-torchimporter-pad-allocation
Update torch_importer.cpp
2025-11-16 18:47:33 +03:00
satyam yadav 27d106d574 Update torch_importer.cpp 2025-11-16 15:00:50 +03:00
Alexander Smorkalov 723bcb9a7b Merge pull request #28010 from asmorkalov:as/solve_pnp_iterative
Solve PnP iterative documentation update
2025-11-16 14:48:24 +03:00
harunresit f26d7e1bf4 Merge pull request #28014 from harunresit:fix-28002-clahe
Added BitShift option to CLAHE #28014

Briefly, this PR is the fix of https://github.com/opencv/opencv/issues/28002

### 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-11-16 14:45:50 +03:00
Alexander Smorkalov 45f37fe9c8 Merge pull request #28020 from Kumataro:fix28013_doc
Update windows_install.markdown - add set opencv path for vc18
2025-11-16 14:25:23 +03:00
Kumataro f8e5bf07af Update windows_install.markdown - add set opencv path for vc18 2025-11-16 08:45:06 +09:00
omaraziz255 3dce4fa655 Merge pull request #27943 from omaraziz255:docs/py-pip-install
docs(py): add pip-based install tutorial #27943

- New tutorial: `doc/tutorials/py_tutorials/py_setup/py_pip_install/py_pip_install.markdown` with anchor `{#tutorial_py_pip_install}`.
- Python setup TOC updated to include the new page near the top.
- Windows/Ubuntu/Fedora pages: added **Quick start (pip)** callout
- Expanded troubleshooting in the pip tutorial (env mismatch, headless GUI notes, wheel mismatches, Raspberry Pi/ARM guidance).

This aligns with the issue request to make `pip install opencv-python` the default path for Python newcomers and reduce confusion from legacy content.

Fixes #24360 
### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-11-14 18:07:30 +03:00
Benjamin Buch 91a720144b add MSVC 19.50 / VS 2026 / VC 18 to config: fix #28013 2025-11-14 15:44:58 +01:00
Alexander Smorkalov 990d9d1a4f Solve PnP iterative documentation update 2025-11-14 11:00:48 +03:00
Alexander Smorkalov 1abc90c178 Merge pull request #27979 from ssam18:fix-reproducible-builds-27961
Fix #27961: Support reproducible builds by making host system version optional
2025-11-14 10:21:12 +03:00
Alexander Smorkalov 9dbae59760 Merge pull request #28008 from penghuiho:fix-moments-ocl
Unblocked OpenCL implementation of cv::moments
2025-11-13 18:19:41 +03:00
Alexander Smorkalov 412e6d9949 Merge pull request #28009 from vrabaud:protolite
Fix out of bounds in calibrateAndNormalizePointsPnP
2025-11-13 15:01:33 +03:00
Vincent Rabaud 49fc1dd796 Fix out of bounds in calibrateAndNormalizePointsPnP
ipoints can have 3 or 4 points.
2025-11-13 11:14:39 +01:00
Alessandro de Oliveira Faria (A.K.A.CABELO) 45d233f7bf Merge pull request #28003 from cabelo:oneapi
Building OpenCV with oneAPI #28003

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-11-13 10:30:35 +03:00
Dmitry Kurtaev 5c02d32cca Merge pull request #28000 from dkurt:d.kurtaev:reset_winograd_impl
### Pull Request Readiness Checklist

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

resolves https://github.com/opencv/opencv/issues/27580

- [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-11-13 09:19:46 +03:00
penghuiho 4c1f32e716 Fix the issue of obtaining the size of the _src 2025-11-13 13:57:41 +08:00
Yuantao Feng 78adab13e9 Merge pull request #27479 from fengyuentau:4x/imgproc/boundingRect-simd
imgproc: supports CV_SIMD_SCALABLE in pointSetBoundingRect #27479

### 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-11-12 18:44:41 +03:00
Alexander Smorkalov 8f0c9ffe90 Merge pull request #27997 from VadimLevin:dev/vlevin/fix-alias-type-node-resolved-typename
fix: use export_name as resolved typename for AliasTypeNode
2025-11-12 11:31:48 +03:00
Alexander Smorkalov a31a52adef Merge pull request #27992 from asmorkalov:as/HoughLines_bias
Fixed standard HoughLines output shift for rho. #27992

Closes: https://github.com/opencv/opencv/issues/25038
Replaces: https://github.com/opencv/opencv/pull/25043

Merge with https://github.com/opencv/opencv_extra/pull/1288

The original implementation introduces systematic shift (-rho/2) for odd indexes. Integer division just gives proper rounding.

### 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-11-12 11:30:14 +03:00
Vadim Levin 17ce5a290b fix: use export_name as resolved typename for AliasTypeNode
Use ctype_name as export name for AliasTypeNode if export name is not
explicitly provided.
2025-11-12 10:30:31 +03:00
Alexander Smorkalov adaa369bb1 Merge pull request #27881 from asmorkalov:as/new_windows_ci
Switch to new Windows CI pipelines.
2025-11-11 14:50:38 +03:00
victorget 3e49b6fa93 Merge pull request #27925 from intel-staging:dev/enforce_ipp_define
Added CMake define option to enforce IPP calls in IPP HAL when building with IPP integration #27925

Extra build option needed to simplify custom builds with IPP integration to ensure the IPP calls done even in cases when the results are not bitwise compliant to the reference OpenCV implementation. Option name is ```WITH_IPP_CALLS_ENFORCED```, and it is disabled by default.

Requested by some IPP customers and might be used in general as a way providing calls with better performance for the cases the aligned precision is not as important aspect.

Supposed to be used in HAL only, so added only in IPP HAL CMake, currently it affects only Warp Affine, Warp Perspective and Remap integrations since the results may vary depending on HW and algorithm implementations.

### 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-11-11 13:30:47 +03:00
Alexander Smorkalov 5b2976f27b Switch to new Windows CI pipelines. 2025-11-11 13:23:28 +03:00
Alexander Smorkalov 2dd0ac3122 Merge pull request #27991 from asmorkalov:as/gapi_unrich_ctor
Fixed unrichable code with MSVC on x86 32-bit systems. #27991

Suppress the following warnings:
```
  Warning: C:\GHA-OCV-5\_work\opencv\opencv\opencv\modules\gapi\src\streaming\onevpl\file_data_provider.cpp(131): warning C4702: unreachable code [C:\GHA-OCV-5\_work\opencv\opencv\build\modules\gapi\opencv_gapi.vcxproj]
  Warning: C:\GHA-OCV-5\_work\opencv\opencv\opencv\modules\gapi\src\streaming\onevpl\source.cpp(77): warning C4702: unreachable code [C:\GHA-OCV-5\_work\opencv\opencv\build\modules\gapi\opencv_gapi.vcxproj]
  Warning: C:\GHA-OCV-5\_work\opencv\opencv\opencv\modules\gapi\src\streaming\onevpl\source.cpp(82): warning C4702: unreachable code [C:\GHA-OCV-5\_work\opencv\opencv\build\modules\gapi\opencv_gapi.vcxproj]
  Warning: C:\GHA-OCV-5\_work\opencv\opencv\opencv\modules\gapi\src\streaming\onevpl\source.cpp(103): warning C4702: unreachable code [C:\GHA-OCV-5\_work\opencv\opencv\build\modules\gapi\opencv_gapi.vcxproj]
  Warning: C:\GHA-OCV-5\_work\opencv\opencv\opencv\modules\gapi\src\streaming\onevpl\source.cpp(90): warning C4702: unreachable code [C:\GHA-OCV-5\_work\opencv\opencv\build\modules\gapi\opencv_gapi.vcxproj]
  Warning: C:\GHA-OCV-5\_work\opencv\opencv\opencv\modules\gapi\src\streaming\onevpl\source.cpp(94): warning C4702: unreachable code [C:\GHA-OCV-5\_work\opencv\opencv\build\modules\gapi\opencv_gapi.vcxproj]
  Warning: C:\GHA-OCV-5\_work\opencv\opencv\opencv\modules\gapi\src\streaming\onevpl\source.cpp(86): warning C4702: unreachable code [C:\GHA-OCV-5\_work\opencv\opencv\build\modules\gapi\opencv_gapi.vcxproj]
  Warning: C:\GHA-OCV-5\_work\opencv\opencv\opencv\modules\gapi\src\streaming\onevpl\source.cpp(99): warning C4702: unreachable code [C:\GHA-OCV-5\_work\opencv\opencv\build\modules\gapi\opencv_gapi.vcxproj]
  Warning: C:\GHA-OCV-5\_work\opencv\opencv\opencv\modules\gapi\src\streaming\gstreamer\gstreamersource.cpp(366): warning C4702: unreachable code [C:\GHA-OCV-5\_work\opencv\opencv\build\modules\gapi\opencv_gapi.vcxproj]
  Warning: C:\GHA-OCV-5\_work\opencv\opencv\opencv\modules\gapi\src\streaming\gstreamer\gstreamersource.cpp(360): warning C4702: unreachable code [C:\GHA-OCV-5\_work\opencv\opencv\build\modules\gapi\opencv_gapi.vcxproj]
  Warning: C:\GHA-OCV-5\_work\opencv\opencv\opencv\modules\gapi\src\streaming\gstreamer\gstreamerpipeline.cpp(77): warning C4702: unreachable code [C:\GHA-OCV-5\_work\opencv\opencv\build\modules\gapi\opencv_gapi.vcxproj]
```

### 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-11-10 18:26:07 +03:00
Alexander Smorkalov 83026bfe87 Merge pull request #27990 from asmorkalov:as/power9_build_fix
Fix missing vec_cvfo on IBM POWER9 due to unavailable VSX float64 conversion #27990 

Replaces https://github.com/opencv/opencv/pull/27633
Closes https://github.com/opencv/opencv/issues/27635

### 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-11-10 12:11:24 +03:00
happy-capybara-man db207c88b0 Merge pull request #27985 from happy-capybara-man:docs/fix-mat-clone-js
docs(js): Fix Mat.clone() documentation to use mat_clone() for deep copy #27985

- Update code example to use ```mat_clone()``` instead of ```clone()```
- Add explanatory note about shallow copy issue due to Emscripten embind
Problem
- OpenCV.js documentation shows ```Mat.clone()``` usage, but this method performs shallow copy instead of deep copy due to Emscripten embind limitations, causing unexpected behavior where modifications to cloned matrices affect the original.

Related Issues and PRs
- Fixes documentation aspect of issue #27572
- Related to PR #26643 (js_clone_fix)

### 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-11-10 10:47:40 +03:00
Alexander Smorkalov 64bbaa9f41 Merge pull request #27972 from asmorkalov:as/dst_mat_type
Force empty output type where it's defined in API #27972

The PR replaces:
- https://github.com/opencv/opencv/pull/27936
- https://github.com/opencv/opencv/pull/21059

Empty matrix has undefined type, so user code should not relay on the output type, if it's empty. The PR introduces some exceptions:
- copyTo documentation defines, that the method re-create output buffer and set it's type.
- convertTo has output type as parameter and output type is defined and expected.
2025-11-10 08:00:17 +03:00
Suleyman TURKMEN 386be68f93 Merge pull request #27981 from sturkmen72:fix_alpha_handling
Fix alpha handling for blending in PNG format #27981

### Pull Request Readiness Checklist

closes #27974

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-11-09 18:23:13 +03:00
Alexander Smorkalov 87436149a5 Merge pull request #27980 from ssam18:fix-grabcut-type-conversion-27968
Fix #27968: Eliminate unnecessary type conversions in GrabCut initGMMs
2025-11-09 17:30:07 +03:00
Alexander Smorkalov 964e23aa6c Merge pull request #27983 from Kumataro:fix27982
imgcodecs: Suppress unknown metadata type warning
2025-11-09 12:06:28 +03:00
Kumataro 3402fc1f6d imgcodecs: Suppress unknown metadata type warning 2025-11-09 09:59:55 +09:00
Samaresh Kumar Singh 603bc58d3b Fix #27968: Eliminate unnecessary type conversions in GrabCut initGMMs
Remove performance bottleneck caused by redundant type conversions in the
initGMMs() function's tight nested loops that iterate over all image pixels.

Changes:
- Changed storage vectors from Vec3f to Vec3b to store pixel data directly
  without intermediate conversion
- Modified kmeans preparation to convert Vec3b data to CV_32FC1 only when
  creating the Mat for clustering (using convertTo instead of per-pixel cast)
- Explicitly convert Vec3b to Vec3d only when calling addSample() method

Performance Impact:
Previously: Vec3b -> Vec3f (in loop) -> Vec3d (implicit in addSample)
Now: Vec3b (in loop) -> Vec3d (explicit, only in addSample call)

This eliminates one unnecessary type conversion per pixel in the tight loop,
reducing computational overhead especially for large images.

Fixes #27968
2025-11-08 13:16:01 -06:00
Samaresh Kumar Singh 7224bced8b Fix #27961: Support reproducible builds by making host system version optional
Add BUILD_INFO_SKIP_SYSTEM_VERSION option to exclude the host kernel version
from build outputs, enabling reproducible builds across systems with different
kernel versions.

Changes:
- Modified CMakeLists.txt to conditionally include CMAKE_HOST_SYSTEM_VERSION
  in the build platform status based on BUILD_INFO_SKIP_SYSTEM_VERSION flag
- Updated 3rdparty/tbb/CMakeLists.txt to set TBB_HOST_VERSION conditionally
- Modified 3rdparty/tbb/version_string.ver.cmakein to use the new variable

When BUILD_INFO_SKIP_SYSTEM_VERSION=ON is set, the host system version is
excluded from both the CMake status output and the TBB version strings,
producing identical binaries on equivalent build systems regardless of
kernel version differences.

Default behavior is unchanged (version included) for backward compatibility.

Fixes #27961
2025-11-08 09:16:11 -06:00
Ismail Abou Zeid 5fb4ce482c Merge pull request #27950 from ismailabouzeidx:feat/estimate-translation2d
[calib3d] Add estimateTranslation2D() #27950

Merge with opencv_extra PR: opencv/opencv_extra#1286

### **Description**

This PR adds a new API, `cv::estimateTranslation2D()`, to the **calib3d** module.  
It computes a **pure 2D translation** between two sets of corresponding points using robust methods (`RANSAC` and `LMedS`).  
The function mirrors the interface and behavior of `estimateAffine2D()` and `estimateAffinePartial2D()`, but constrains the transformation to translation only.

This model is particularly useful for cases where the motion between images is purely translational, such as:
- Aerial stitching and planar mosaics.  
- Image alignment in fixed-camera systems.  
- Lightweight pipelines where affine or homography models are unnecessarily complex.

The implementation introduces a new internal class `Translation2DEstimatorCallback` and integrates seamlessly into OpenCV’s existing robust estimation framework (`PointSetRegistrator`).

---

### **Key Features**
- Implements `cv::estimateTranslation2D()` in the `calib3d` module.
- Supports robust methods **RANSAC** and **LMedS**.  
- Adds accuracy and performance tests.  
- Provides full **C++ and Python bindings**.  
- Includes **Doxygen documentation** consistent with OpenCV’s standards.  
- Verified correctness across noise, outlier, and datatype variations.

---
### **Testing & Verification**

**Unit Tests** (`modules/calib3d/`)

- **Minimal sample:**  
  `test1Point` validates that a single correspondence recovers the correct translation under both **RANSAC** and **LMedS** across 500 randomized trials.  
- **Robustness to noise and outliers:**  
  `testNPoints` generates 100 correspondences, injects noise and outliers (≤40% for RANSAC, ≤50% for LMedS), and verifies that:  
  - Estimated **T** closely matches ground truth (`cvtest::norm(..., NORM_L2)`).  
  - Inlier mask consistency and correctness are maintained.  
- **Datatype conversion:**  
  `testConversion` checks mixed input datatypes (integer → float) to ensure correct conversion and consistent results.  
- **Input immutability:**  
  `dont_change_inputs` confirms that input arrays remain unchanged after function execution, mirroring affine behavior.

**Performance Tests** (`modules/calib3d/`)

- `EstimateTranslation2DPerf` benchmarks **RANSAC** and **LMedS** using:  
  - Point counts: 1000  
  - Confidence levels: 0.95  
  - Refinement iterations: 10, 0  
  
These tests confirm **numerical stability**, **performance scaling**, and **consistency** across datatypes and noise levels.

---
### 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 (`4.x`)
- [x] There is a clear description, motivation, and validation summary in this PR
- [x] There are accuracy and performance tests in the calib3d module
- [x] The feature is well documented and sample code can be built with CMake
- [x] The feature has Python bindings and verified documentation output
- [x] There is test data or sample code in the opencv_extra repository (if applicable)
- [ ] There is a reference to the original bug report or related issue (if applicable)
2025-11-08 17:27:54 +03:00
Alexander Smorkalov 9921531fa4 Merge pull request #27976 from asmorkalov:as/size_t_fix_win32
Fixed ptrdiff_t cast on windows 32-bit #27976

### 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-11-08 17:07:36 +03:00
Alexander Smorkalov 6862afb2c1 Merge pull request #27977 from asmorkalov:as/proper_ffmpeg_diagnostic_windows_arm
Fixed pre-built ffmpeg diagnostics on Windows for ARM. #27977

### 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-11-08 11:24:24 +03:00
sirudoi 881774d872 Merge pull request #27930 from sirudoi:4.x
Add macOS support for Orbbec Gemini330 camera #27930

### Description of Changes
Adds macOS support for Orbbec Gemini330 in videoio by integrating OrbbecSDK v2. Completes the non-macOS work in [#27230](https://github.com/opencv/opencv/pull/27230).

#### Motivation

[#27230](https://github.com/opencv/opencv/pull/27230) skipped macOS. On macOS, UVC alone lacks required device controls; OrbbecSDK v2 provides them.

#### Key Change
 - macOS: fetch/link OrbbecSDK v2.5.5 (replaces v1.9.4).
 - videoio (macOS): switch OrbbecSDK API usage from v1 to v2.

### 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] The feature is well documented and sample code can be built with the project CMake
2025-11-07 10:36:11 +03:00
Pierre Chatelier 9fc556a83e Merge pull request #27366 from chacha21:arrowedLine_clipped
Try to fix distant points to save time when ThickLine() calls FillConvexPoly() #27366

Proposal for #27365

cv::clipLine() is useful, but one should take care of a margin to preserve line caps.

### 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-11-07 10:34:52 +03:00
Alexander Smorkalov 426aa598e7 Merge pull request #27960 from vrabaud:protolite
Allow protobuffer message to be compiled with LITE_RUNTIME
2025-11-06 10:06:15 +03:00
Vincent Rabaud 1691a2355c Allow protobuffer message to be compiled with LITE_RUNTIME
When adding "option optimize_for = LITE_RUNTIME;" to proto
messages, they are compiled as lighter MessageLite (the base class
of Message).

Those lighter messages do not allow for reflection though:

https://developers.google.com/protocol-buffers/docs/reference/cpp-generated

This fixes https://github.com/opencv/opencv/issues/20275
2025-11-05 14:42:20 +01:00
abhijeetraj10-web 2f22bdf477 Merge pull request #27959 from abhijeetraj10-web:fix-patchNaNs-doc
Clarified supported types in cv::patchNaNs() documentation #27959

### 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

Updated the docs for cv::patchNaNs() to specify that both CV_32F and CV_64F types are supported. Fixes incomplete information.
2025-11-05 14:42:12 +03:00
Alexander Smorkalov d3d247f1e3 Merge pull request #27962 from Tuchis:fix-fisheye-documentation
Remove mention of 'tangential lens distortion' from fisheye documentation.
2025-11-05 12:22:45 +03:00
Alexander Smorkalov ec60a98ac6 Merge pull request #27963 from vrabaud:js
Fix generation when returned class and function are in a namespace
2025-11-05 11:10:36 +03:00
Vincent Rabaud f984d3bdc7 Fix generation when returned class and function are in a namespace
This is to fix js generation at HEAD with ximgproc.
2025-11-04 11:17:29 +01:00
Vladyslav Humennyy f692304c29 Remove mention of 'tangential lens distortion' from fisheye documentation.
In `fisheye::initUndistortRectifyMap` states, that the function 'compensate radial and tangential lens distortion'. But in fact, fisheye camera model in OpenCV does not uses tangential distortion. It uses only radial distortions, with 4 distortion k_1, k_2, k_3, k_4, which all are radial. In the code of the function all of those koeficients indeed are used as radial lens distortion coefficients. Possible reason of that issue is similar documentation of pinhole camera, that as first four coefficients uses 2 radial and 2 tangential lens distortion coefficients - k_1, k_2, p_1, p_2.
2025-11-04 11:16:59 +02:00
Alexander Smorkalov 01f9bdae4c Merge pull request #27723 from fanchenkong1:fastconv-wasm-scalar-opt
DNN: Add large scalar fastconv kernel for WASM/no-SIMD build
2025-10-31 22:50:41 +03:00
Alexander Smorkalov 5c73895cba Merge pull request #27949 from cudawarped:fix_cudart_dependency
[cuda] Add cudart target to all modules which use CUDA
2025-10-31 22:43:45 +03:00
Alexander Smorkalov 3516c57c81 Merge pull request #27944 from DDmytro:ecc-sanity-update
perf(video): add sanity checks and update ECC baselines for grayscale and color inputs.
2025-10-30 22:16:27 +03:00
Alexander Smorkalov 0c10aecacd Merge pull request #27945 from MaximSmolskiy:add_comments_for_undistortPoints
Add comments for undistortPoints
2025-10-30 16:11:11 +03:00
Alexander Smorkalov c69e20a495 Merge pull request #27948 from vrabaud:c_headers
Get code to compile without FFmpeg's libavdevice
2025-10-30 16:10:13 +03:00
cudawarped 6adb985679 [cuda] Add cudart to all modules which use it 2025-10-28 17:26:13 +02:00
Alexander Smorkalov d7f6201219 Merge pull request #27939 from Kumataro:fix27938
openexr: suppress -Wnontrivial-memcall warnings
2025-10-28 13:31:03 +03:00
Vincent Rabaud 3a4a88c116 Get code to compile without FFMPEG's libavdevice 2025-10-28 10:46:47 +01:00
MaximSmolskiy 2faff661c6 Add comments for undistortPoints 2025-10-28 03:13:16 +03:00
Dmytro Dadyka 37497fa2e3 perf(video): add sanity checks and update ECC baselines for grayscale and color inputs 2025-10-28 01:35:26 +02:00
Kumataro f836f67203 openexr: suppress -Wnontrivial-memcall warnings 2025-10-26 10:01:40 +09:00
Alexander Smorkalov 52393156c8 Merge pull request #27524 from DDmytro:multichannel_ecc
Extend findTransformECC and computeECC to support multichannel input (1 or 3 channels)
2025-10-24 11:24:15 +03:00
Stefan Dragnev 12b64b0e2a Merge pull request #27927 from tailsu:tailsu/tiff-error-handler
tiff: use a per-TIFF error handler #27927

libtiff 4.5 introduced [per-TIFF error handlers](https://libtiff.gitlab.io/libtiff/functions/TIFFOpenOptions.html). This PR removes the global OpenCV error handlers and uses per-handle error handlers. This reduces any risks associated with modifying global state, e.g. if another library also tries to set the global error handlers and OpenCV clobbers them.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-10-23 13:38:10 +03:00
Alexander Smorkalov 09c893477e Merge pull request #27443 from ritamelo06:gapi-feature
feat: G-API: Custom stream sources in Python (#27276)
2025-10-21 12:59:06 +03:00
Jay Pol 47d71530a7 Merge pull request #27866 from JayPol559:4.x
Fix HDR tutorial result mismatch by adding gamma note #27866

This PR fixes #22219 by clarifying the gamma correction value in the HDR tutorial.

The function cv.createTonemap() has a default gamma value of 1.0. To match the tutorial example results, gamma should be explicitly set to 2.2. This note has been added to the Tonemap HDR image section of the tutorial.
2025-10-21 12:30:58 +03:00
Alexander Smorkalov 543e9ed010 Merge pull request #27926 from MaximSmolskiy:add_comments_for_fisheye_undistortPoints
Add comments for fisheye::undistortPoints
2025-10-21 08:16:38 +03:00
MaximSmolskiy b65d66e797 Add comments for fisheye::undistortPoints 2025-10-21 04:56:22 +03:00
Alexander Smorkalov 50cd7b8b4b Merge pull request #27923 from cudawarped:move_throw_no_cuda_to_stub
[core][cuda] Move throw_no_cuda to it an independant stub
2025-10-20 19:54:28 +03:00
Alexander Smorkalov 53a96cdc0b Merge pull request #27922 from Kumataro:fix27921
imgcodecs: GDAL: show GDAL version at OpenCV configuration
2025-10-20 16:18:58 +03:00
Alexander Smorkalov fa276bba3d Merge pull request #27919 from Kumataro:fix27830
imgcodecs: Workaround for image flipping bug in older GDAL FITS drivers
2025-10-20 15:18:25 +03:00
cudawarped ff216e8796 [core][cuda] Move throw_no_cuda to it an independant stub so it is not included in the same file that requires cudart 2025-10-20 13:10:23 +03:00
Kumataro 346308124a imgcodecs: GDAL: show GDAL version at OpenCV configuration 2025-10-20 18:37:04 +09:00
Alexander Smorkalov 11422da957 Merge pull request #27920 from MaximSmolskiy:support_qr_decomposition_for_stereoCalibrate
Support QR decomposition for stereoCalibrate
2025-10-20 09:49:12 +03:00
Alexander Smorkalov 70d69d07c8 Merge pull request #27914 from MaximSmolskiy:refactor_minEnclosingCircle
Refactor minEnclosingCircle
2025-10-20 08:40:28 +03:00
MaximSmolskiy 455720aae8 Support QR decomposition for stereoCalibrate 2025-10-19 19:34:13 +03:00
Kumataro 75f738b3d1 imgcodecs: Workaround for image flipping bug in older GDAL FITS drivers 2025-10-19 15:38:00 +09:00
Alexander Smorkalov cb8f398a87 Merge pull request #27915 from MaximSmolskiy:fix_ml_kdtree_findNearest
Fix ml::KDTree::findNearest
2025-10-17 12:01:12 +03:00
Dmitry Kurtaev f1a99760ad Merge pull request #27841 from dkurt:ffmpeg_camera
Open camera device by index through FFmpeg #27841

### Pull Request Readiness Checklist

resolves https://github.com/opencv/opencv/issues/26812

Example of explicit backend option (similar to `-f v4l2` from command line)
```
export OPENCV_FFMPEG_CAPTURE_OPTIONS="f;v4l2"
```
see https://trac.ffmpeg.org/wiki/Capture/Webcam for available options

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-10-17 10:23:24 +03:00
MaximSmolskiy 98a12515fe Fix ml::KDTree::findNearest 2025-10-16 22:58:55 +03:00
MaximSmolskiy e45d07e95b Refactor minEnclosingCircle 2025-10-16 22:18:39 +03:00
Alexander Smorkalov c75cd1047b Merge pull request #27911 from Kumataro:refix26899
core: fix lut_data data type
2025-10-16 15:55:40 +03:00
s-trinh f5014c179f Merge pull request #27736 from s-trinh:use_USAC_P3P_in_solvePnP
Update Gao P3P with Ding P3P #27736

### 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

---

The current Gao P3P implementation does not cover all the degenerate cases, **see last line** in: https://github.com/opencv/opencv/blob/6d889ee74c94124f6492eb8f0d50946d9c31d8e9/modules/calib3d/src/p3p.cpp#L211-L221

See also:
- https://github.com/opencv/opencv/issues/4854

---

<details>

<summary>OBSOLETE</summary>

To fix this, the USAC P3P from OpenCV 5 is used instead: https://github.com/opencv/opencv/blob/7e6da007cddcf83a527dfda95d57228fa5a535d3/modules/3d/src/usac/pnp_solver.cpp#L282

---

## Some results

### Old P3P vs new

In the following video, I have tried to highlight the viewpoints which cause issues:

https://github.com/user-attachments/assets/97bec6a6-4043-4509-b50e-a9856d6423bd

| | Old P3P    | New P3P |
| -------- | ------- | ------- |
| Mean (ms)  | 0.045701 | 0.024816 |
| Median (ms) | 0.025146 | 0.023193 |
| Std (ms)    | 0.028953    | 0.006124 |

### New P3P vs AP3P

https://github.com/user-attachments/assets/eaeb21dc-3ffd-4b6c-9902-4352f824aa45

The AP3 method is superior both in term of accuracy and computation time:

| | New P3P    | AP3P |
| -------- | ------- | ------- |
| Mean (ms)  | 0.043750 | 0.023442 |
| Median (ms) | 0.023193 | 0.021484 |
| Std (ms)    | 0.039920 | 0.005265 |

### New P3P vs AP3P (range test)

https://github.com/user-attachments/assets/572e7b7a-2966-4bed-8e0c-b93d863987dc

The implemented P3P method does not work well when the tag is small, at long range.

| | New P3P    | AP3P |
| -------- | ------- | ------- |
| Mean (ms)  | 0.031351 | 0.025189 |
| Median (ms) | 0.022217 | 0.020996 |
| Std (ms)    | 0.024920 | 0.009633 |

---

- I have tried to simplify the P3P code, hope I did not break the implementation code
- calculations are performed using double type for simplicity.
- code such as the following are redundant and no more needed and should be replaced by `cv::Rodrigues`:

https://github.com/opencv/opencv/blob/6d889ee74c94124f6492eb8f0d50946d9c31d8e9/modules/calib3d/src/usac/pnp_solver.cpp#L395

</details>
2025-10-16 15:21:15 +03:00
Kumataro ec630504a7 core: fix lut_data data type 2025-10-16 21:19:12 +09:00
Alexander Smorkalov 6c009c2a14 Merge pull request #27903 from victorget:dev/ipp_hal_threading
Fixed parallel invoke for warp perspective for best performance
2025-10-16 14:55:15 +03:00
Alexander Smorkalov 703f0bb0f2 Merge pull request #27906 from asmorkalov:as/cairosvg
Use cairosvg for pattern rendering to get rid of double resize. #27906

Depends on https://github.com/opencv/ci-gha-workflow/pull/269

### 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-16 12:06:35 +03:00
Kumataro d0d9bd20ed Merge pull request #27890 from Kumataro:fix26899
core: support 16 bit LUT #27890

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

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-10-16 12:03:02 +03:00
Alexander Smorkalov c88b3cb11f Merge pull request #27910 from MaximSmolskiy:add_corner_cases_tests_for_minEnclosingCircle
Add corner cases tests for minEnclosingCircle
2025-10-16 10:36:42 +03:00
Alexander Smorkalov 1bf1b91a58 Merge pull request #27908 from badshah400:4.x
Fixed linking for HighGUI against Qt 6.9 and newer
2025-10-16 09:27:56 +03:00
Alexander Smorkalov 00493e603a Merge pull request #27909 from DasoTD:fix-ambiguous-rect-assignment
Fix ambiguous operator error in Rect assignment for C++ modules
2025-10-16 09:23:48 +03:00
MaximSmolskiy b4d3488b02 Add corner cases tests for minEnclosingCircle 2025-10-15 22:27:27 +03:00
xybuild da69f6748e Fix ambiguous operator error in Rect assignment for C++ modules 2025-10-15 19:15:01 +01:00
Atri Bhattacharya e7728bb27d Fixed linking for HighGUI against Qt 6.9 and newer
Use `link_libraries` instead of `add_defintions` to link against Qt 6.9
and newer to avoid un-expanded generator expressions from Qt cmake files
being appended to linker flags when building the HighGUI module.

The actual bug is likely in how Qt cmake files end up with these
un-expanded generator expressions in the first place — see discussion in
https://bugreports.qt.io/browse/QTBUG-134774 — but the recommended way
to link against the library is to use `link_libraries` anyway, so this
fix should do the trick.

Fixes issue #27223.
2025-10-15 21:49:04 +05:30
Alexander Smorkalov 563ef8ff97 Merge pull request #27904 from MaximSmolskiy:fix_minEnclosingCircle
Fix minEnclosingCircle
2025-10-15 11:00:18 +03:00
Maxim Smolskiy 8f0373816a Merge pull request #27900 from MaximSmolskiy:refactor-minEnclosingCircle-tests
Refactor minEnclosingCircle tests #27900

### Pull Request Readiness Checklist

Separate input points for tests

Before this, next input points depended on previous ones and it was not obvious which input points specific test checked

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-10-15 09:48:49 +03:00
MaximSmolskiy 1b09d7390f Fix minEnclosingCircle 2025-10-15 01:34:14 +03:00
Victor Getmanskiy 9e515caeac - Fixed incorrect implementation of multithreaded call for warp perspective in IPP HAL.
- Changed splitting logic to improved performance for all warp related functions in IPP HAL for multithreaded mode.
- Removed IPP 7.0 preprocessor condition from warp in IPP HAL, since unsupported.
- Added preprocessor condition to enforce IPP warp calls for custom builds.
2025-10-14 06:21:31 -07:00
Dave Merchant 0ee9c27966 Merge pull request #27810 from D00E:known-foreground-mask
2025-10-14T05:53:31.5387050Z C:\GHA-OCV-1\_work\ci-gha-workflow\ci-gha-workflow\opencv\modules\imgcodecs\src\bitstrm.cpp(156,57): warning C4244: 'argument': conversion from 'int64_t' to 'ptrdiff_t', possible loss of data [C:\GHA-OCV-1\_work\ci-gha-workflow\ci-gha-workflow\build\modules\imgcodecs\opencv_imgcodecs.vcxproj]

### Pull Request Readiness Checklist

Optional Known Foreground Mask for Background Subtractors #27810

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

### Description
This adds an optional foreground input mask parameter to the MOG2 and KNN background subtractors, in line with issue https://github.com/opencv/opencv/issues/26476

4 tests are added under test_bgfg2.cpp:
2 for each subtractor type (1 with shadow detection and 1 without)
A demo shows the feature with only 3 parameters and with a 4th optional foreground mask for both core subtractor types.

Note: To patch contrib inheritance of the background subtraction class, empty apply method which throws a not implemented error is added to contrib subclasses. This is done to keep the overloaded apply function as pure virtual. Contrib PR to be made and linked shortly.  
Contrib Repo Paired Pull Request: https://github.com/opencv/opencv_contrib/pull/4017
2025-10-14 09:56:06 +03: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 af49e0cc59 Merge pull request #27898 from asmorkalov:as/gapi_warning_fix_more
More warning fixes G-API on Windows
2025-10-13 18:35:06 +03:00
Alexander Smorkalov ca34212b68 More warning fixes iG-API on Windows. 2025-10-13 16:50:55 +03:00
Alexander Smorkalov bcb2f759b6 Merge pull request #27895 from asmorkalov:as/unreachible_gapi
Removed unreachible code reported by MS Visual Studio on Windows
2025-10-13 14:32:11 +03:00
Alexander Smorkalov 34aee6cb28 Removed unreachible code reported by MS Visual Studio on Windows. 2025-10-13 12:13:37 +03:00
Alexander Smorkalov 24640ec65f Merge pull request #27893 from asmorkalov:as/no_return_fix
Fixed -Wretrun-type warning in Highgui
2025-10-13 11:41:36 +03:00
Alexander Smorkalov 029c081719 Fixed -Wretrun-type warning in Highgui. 2025-10-13 10:35:00 +03:00
Maxim Smolskiy 514d362ad8 Merge pull request #27876 from MaximSmolskiy:fix_charuco_board_pattern_in_generate_pattern.py
Fix charuco_board_pattern in generate_pattern.py #27876

### Pull Request Readiness Checklist

Fix #27871 

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-10-13 09:09:56 +03:00
Alexander Smorkalov a74374d1ed Merge pull request #27889 from Xingchen1224:4.x
fix: Refactor tuple creation in nlm.cu for fixing nvcc build…
2025-10-11 17:05:46 +03:00
xcm4 f74d481724 fix: Refactor tuple creation in NLM CUDA kernel for fixing nvcc build error 2025-10-11 14:22:27 +08:00
Alexander Smorkalov 833918781e Merge pull request #27887 from asmorkalov:as/flacky_gapi
Skip LimitedSourceInfer.ReleaseFrameAsync test in CI as it hangs sporadically
2025-10-10 15:14:36 +03:00
Alexander Smorkalov e7d046f31a Skip LimitedSourceInfer.ReleaseFrameAsync test in CI as it hangs sporadically. 2025-10-10 13:43:38 +03:00
Alexander Smorkalov 34f6c0764e Merge pull request #27883 from asmorkalov:as/win32_warning_fix
Fixed warnings produced by x86 builds on Windows.
2025-10-09 13:47:23 +03:00
Alexander Smorkalov b5e96d76eb Fixed warnings produced by x86 builds on Windows. 2025-10-09 11:54:10 +03:00
Maxim Smolskiy 75598e5377 Merge pull request #27877 from MaximSmolskiy:fix_QRCodeDetector_detectAndDecode_crash
Fix QRCodeDetector::detectAndDecode crash #27877

### Pull Request Readiness Checklist

Fix #27807 

The problem is that when we find closest points from hull, we can get same closest point for several different points

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-10-08 08:50:54 +03:00
Maxim Smolskiy b644754226 Merge pull request #27865 from MaximSmolskiy:fix_invalid_memory_access_in_usac
Fix invalid memory access in USAC #27865

### Pull Request Readiness Checklist

Fix #27863 

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-10-06 15:29:44 +03:00
ashish-sriram 19c41c2936 Merge pull request #27822 from amd:fast_blur_simd
Improved blur #27822

* Perform row and column filter operations in a single pass.
* Temporary storage of intermediate results are avoided.
* Impacts 32F and 64F inputs for ksize <=5.

### 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-10-06 11:00:30 +03:00
Alexander Smorkalov aeea707262 Merge pull request #27872 from dkurt:fix_camera_calibration_artifacts
Rename fields in camera calibration results
2025-10-06 09:43:00 +03:00
Dmitry Kurtaev 387afc4eb4 Rename fields in camera calibration results 2025-10-05 21:51:58 +03:00
Peter Rekdal Khan-Sunde 4e94116e7a Merge pull request #27864 from peters:patch-2
Add OPENCV_FFMPEG_SKIP_LOG_CALLBACK to preserve custom FFmpeg logging #27864 
 
OpenCV’s InternalFFMpegRegister overwrites av_log_set_callback, blocking custom FFmpeg log handlers in statically linked apps.

Add `OPENCV_FFMPEG_SKIP_LOG_CALLBACK` to let applications keep their own logging.

### 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-10-04 13:24:28 +03:00
Alexander Smorkalov 14aae55450 Merge pull request #27859 from D00E:fix-psnr-cap
Updated Tutorial PSNR for identical images
2025-10-03 16:59:37 +03:00
pratham-mcw 8f3976ae97 Merge pull request #27785 from pratham-mcw:dnn-lstm-neon
dnn: added neon intrinsics implementation of fastGEMM1T function #27785

### 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

- This PR improves the performance of the LSTM function on ARM64 targets.
- Added a NEON intrinsics implementation of the fastGEMM1T function and enabled its use in fully connected and recurrent layers file. 
- As a result, ARM64 now benefits from vectorized matrix–vector multiplications, leading to measurable performance improvements in the LSTM layer.
- This change is limited to ARM64 and does not affect other architectures.

**Performance impact:**
- The optimization significantly improves the performance of lstm functions on ARM64 targets.
<img width="930" height="313" alt="image" src="https://github.com/user-attachments/assets/92e251cd-dc6c-4cda-9586-acc19bf16dfd" />
2025-10-03 10:50:50 +03:00
Alexander Smorkalov bb45afec28 Merge pull request #27854 from asmorkalov:as/inRange_hal
Added inRange HAL entry point
2025-10-03 10:46:58 +03:00
Alexander Smorkalov aa939b3932 Merge pull request #27860 from asmorkalov:as/python_restored_dbg
Restored PYTHON_DEBUG_LIBRARIES in python bindings
2025-10-03 09:30:08 +03:00
Alexander Smorkalov 4f6dd148e6 Merge pull request #27861 from asmorkalov:as/dlpack_win_warnings
Warning fixes in DLpack integration on Win32
2025-10-02 12:01:54 +03:00
Alexander Smorkalov 80fef356ec Warning fixes in DLpack integration on Win32. 2025-10-02 09:12:05 +03:00
Alexander Smorkalov d5cdad7629 Restored PYTHON_DEBUG_LIBRARIES in python bindings. 2025-10-02 09:00:22 +03:00
D00E acc76304d5 Updated Tutorial PSNR for identical images 2025-10-02 00:03:28 +01:00
Alexander Smorkalov c4763279eb Added inRange HAL entry point. 2025-10-01 12:09:28 +03:00
Alexander Smorkalov e9bded6ff3 Merge pull request #27833 from asmorkalov:as/move_gen_pattern
Moved pattern generator to apps and rewrote tutorial #27833

### 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-01 09:42:22 +03:00
Alexander Smorkalov 7994f88ecb Merge pull request #27850 from asmorkalov:as/python_linkage_update
Dropped depricated PYTHON_DEBUG_LIBRARIES and resolved options clash with Clang
2025-10-01 09:33:16 +03:00
Alexander Smorkalov f699d3c777 Merge pull request #27849 from asmorkalov:as/webp_memory_leak
Fixed memory leak in webp backend of imgcodecs
2025-10-01 08:37:29 +03:00
Alexander Smorkalov 2ba688f23c Merge pull request #27847 from asmorkalov:as/bmp_out_of_bound
Fixed out-of-bound access during extra params handing in BMP encoder.
2025-09-30 19:42:02 +03:00
Alexander Smorkalov 9ee9a47302 Merge pull request #27851 from asmorkalov:as/gdal_version
Output GDAL library version in CMake status output.
2025-09-30 19:38:20 +03:00
Alexander Smorkalov ebb5b3037e Output GDAL library version in CMake status output. 2025-09-30 18:34:10 +03:00
Alexander Smorkalov e69eeb1558 Dropped depricated PYTHON__DEBUG_LIBRARIES and resolved options clash with Clang. 2025-09-30 12:13:34 +03:00
Alexander Smorkalov 8f3f1cd193 Fixed memory leak in webp backend of imgcodecs
WebPMuxAssemble always alloc output buffer and do not reuse provided one.
It overrites provided buffer and it's not freed in the previous version.
WebPDataClear cannot be used with shared pointer as it does not free the object memory itself.
webpFree expects void*, but not const void* that's why const cast is required here.
2025-09-30 10:57:53 +03:00
Alexander Smorkalov 9a82458c43 Fixed out-of-bound access during extra params handing in BMP encoder. 2025-09-30 08:14:38 +03:00
Alexander Smorkalov 0e88b49a53 Merge pull request #27837 from jasseeeem:qr-decode-degenerate-quadrilateral-fix
Fix to prevent QR code decoding from throwing exception on degenerate quadrilaterals
2025-09-29 10:18:18 +03:00
Muhammed Jaseem Pallikkal 5d54e90fa4 fix to prevent QR code decoding from throwing on degenerate source points 2025-09-29 00:51:14 +05:30
Alexander Smorkalov edfa999b93 Merge pull request #27828 from asmorkalov:as/js_extend
Added option to wrap opencv_contrib into JS too.
2025-09-25 23:46:44 +03:00
Alexander Smorkalov 5755d4f224 Added option to wrap opencv_contrib into JS too. 2025-09-25 17:25:04 +03:00
Alexander Smorkalov 939e58f260 Merge pull request #27825 from vrabaud:c_headers
Remove more C code
2025-09-25 16:24:00 +03:00
Vincent Rabaud b88c3dff4f Remove more C code 2025-09-25 13:31:30 +02:00
Alexander Smorkalov 659106a99d Merge pull request #27817 from Kumataro:trial27793
core: verify length check when converting from vector to InputArray
2025-09-25 13:35:11 +03:00
Timi 9282afa0c7 Merge pull request #27726 from DasoTD:fix/string-property-binding
Fix string property bindings in JS generator #27726

Fixes #27712

This PR fixes the binding generation logic in embindgen.py to correctly handle enum and string properties:
Enum properties now use binding_utils::underlying_ptr(&Class::property).
Standard string properties are bound directly with &Class::property.
Other properties continue to use the default template.

Testing:
Verified generated bindings locally to ensure the expected output for enums and strings.
2025-09-25 10:59:27 +03:00
Alexander Smorkalov 255d1d2b0c Merge pull request #27820 from undingen:speedup_charuco
Speedup ChArUco by avoiding temporary copies
2025-09-24 10:50:59 +03:00
Marius Wachtler 6f9f8f49dd Speedup ChArUco by avoiding temporary copies
This speeds up processing a 132x128 board by more than 100 times.
This methods return std::vectors<> which means lots of copies and allocations.
2025-09-23 19:33:15 -05:00
Alexander Smorkalov 6f040337e9 Merge pull request #27818 from asmorkalov:as/win_linkage_hardening
Use /safeseh for x86 32-bit only.
2025-09-23 22:15:41 +03:00
SaraKuhnert 79793e169e Merge pull request #27369 from SaraKuhnert:minEnclosingPolygon
imgproc: add minEnclosingConvexPolygon #27369

### 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
- [ ] 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-09-23 22:14:12 +03:00
Alexander Smorkalov 3492b71dfb Merge pull request #27812 from asmorkalov:as/python_loglevel_constants
Tunned Python bindings for logging.
2025-09-23 15:58:52 +03:00
pratham-mcw 95354f044c Merge pull request #27596 from pratham-mcw:core-kmeans-loop-unroll
core: ARM64 loop unrolling in kmeans to improve Weighted Filter performance #27596

### 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

- This PR improves the performance of the Weighted Filter function from the ximgproc module on Windows on ARM64.
- The optimization is achieved by unrolling two performance-critical loops in the generateCentersPP function in modules/core/src/kmeans.cpp, which is internally used by the Weighted Filter function.
- The unrolling is enabled only for ARM64 builds using #if defined(_M_ARM64) guards to preserve compatibility and maintain performance on other architectures.

**Performance Improvements:** 
- Improves execution time for Weighted Filter performance tests on ARM64 without affecting other platforms.
<img width="772" height="558" alt="image" src="https://github.com/user-attachments/assets/ae28c0af-97d3-460b-ad5a-207d3fc6936f" />
2025-09-23 15:48:10 +03:00
Alexander Smorkalov ceb197b7de Use /safeseh for x86 32-bit only. 2025-09-23 15:24:27 +03:00
Kumataro 6dbf7612f9 core: verify length check from vector to InputArray 2025-09-23 20:56:16 +09:00
Madan mohan Manokar 691b1bdc05 Merge pull request #27795 from amd:fast_gaussian_simd
Improved Gaussian Blur #27795

- Horizontal and vertical kernels of 3N131 and 5N14641 are combined for non-border(inner) regions.
- Temporary storage of intermediate results are avoided by combining the kernels.
- Further refinement of other 3N, 5N to be added later.

### 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
- [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-09-22 17:30:28 +03:00
Alexander Smorkalov ca7f668e6a Tunned Python bindings for logging. 2025-09-22 17:21:51 +03:00
Kumataro 3c3a26b6ab Merge pull request #27811 from Kumataro:fix27789
imgcodecs: bmp: relax decoding size limit to over 1GiB #27811

Close https://github.com/opencv/opencv/issues/27789
Close https://github.com/opencv/opencv/issues/23233

### 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-09-22 11:49:47 +03:00
Kumataro 744d5ecd14 Merge pull request #27806 from Kumataro:fix27784
libtiff upgrade to version 4.7.1 #27806

close https://github.com/opencv/opencv/issues/27784

### 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-09-22 10:11:28 +03:00
Alexander Smorkalov 64bb4ad035 Merge pull request #27802 from opencv-pushbot:gitee/alalek/issue_27724
core: restore parallel name on failure attempt
2025-09-22 08:29:44 +03:00
Alexander Smorkalov a9148b88f3 Merge pull request #27808 from underdevelopedprefrontalcortex:patch-1
fix "algorighm" typo in approxPolyN docstring
2025-09-22 08:20:53 +03:00
underdevelopedprefrontalcortex 3372286c7b Update imgproc.hpp, fix "algorighm" typo in approxPolyN docstring 2025-09-20 19:29:12 -04:00
Alexander Smorkalov 89e767b0d9 Merge pull request #27787 from Kumataro:fix27783
objdetect: enable setEpsY() for QRDetectMulti
2025-09-19 17:57:12 +03:00
pratham-mcw cb659575e8 Merge pull request #27642 from pratham-mcw:perf_arm64_fast_loop_unroll
stitching: enable loop unrolling in fast.cpp to improve ARM64 performance #27642

### 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


- This PR introduces an ARM64-specific performance optimization in the FAST_t function by applying loop unrolling. 
- The optimization is guarded with #if defined(_M_ARM64) to ensure it only affects ARM64 builds. 
- This optimizations lead to performance improvements in stitching module functions.

**Performance Improvements:** 

- This change significantly improved the performance on Windows ARM64 targets.
<img width="935" height="579" alt="image" src="https://github.com/user-attachments/assets/a03833d1-ac9b-408f-916b-243fd6ae2d53" />
2025-09-19 16:49:21 +03:00
pratham-mcw 15d3c56548 Merge pull request #27777 from pratham-mcw:dnn-softmax-loop-unroll
dnn: improve performance of softmax_3d with loop unrolling #27777

### 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

- This PR applies loop unrolling in the softmax function.
- The change does not affect functional correctness.

**Performance Improvements**
- The optimization significantly improves the performance of softmax_3d on Windows ARM64 targets.
<img width="703" height="203" alt="image" src="https://github.com/user-attachments/assets/85997c15-f543-432c-95e5-69099d71fe71" />
2025-09-19 16:45:04 +03:00
Alexander Smorkalov 0ff1452400 Merge pull request #27781 from Kumataro:test27744
imgcodecs: add test to decode a corrupted APNG
2025-09-19 13:02:48 +03:00
Alexander Smorkalov b99c604d02 Merge pull request #27799 from asmorkalov:as/charuco_dict_offset
Added option to define Aruco index offset in pattern generator
2025-09-19 12:20:32 +03:00
Alexander Smorkalov a3814ea237 Added option to define Aruco index offset in pattern generator. 2025-09-19 11:17:21 +03:00
Alexander Alekhin 8ff2d29804 core: restore parallel name on failure attempt 2025-09-19 03:25:40 +00:00
Dimitre 3f603f3232 typo COMPENSACTION -> COMPENSATION 2025-09-18 14:52:48 -03:00
Jie Pan 5c1c39afc1 Merge pull request #27773 from jiepan-intel:wasm-optimization
dnn: Tune CONV_NR_FP32 size for WASM #27773

We can see ~20% inference time reduction on local benchmark.
The local benchmark includes face detection with res10_300x300_ssd_iter_140000_fp16.caffemodel and image classification with squeezenet.onnx .

### 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-09-17 17:24:44 +03:00
Kumataro 61705ea280 objdetect: enable setEpsY() for QRDetectMulti 2025-09-16 21:06:28 +09:00
Kumataro fac647aaeb imgcodecs: add test to decode a corrupted APNG 2025-09-13 06:46:53 +09:00
Alexander Smorkalov 5b1d325530 Merge pull request #27778 from mshabunin:fix-openblas-cmake
build: fix OpenBLAS cmake search
2025-09-12 20:50:18 +03:00
pratham-mcw a7943cef60 Merge pull request #27776 from pratham-mcw:win-arm64-agast-detect-optimization
features2d: performance optimization of detect function on Windows-ARM64 #27776

### 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

- This PR improves the performance of the detect function on Windows ARM64 targets.
- Added the defined(_M_ARM64) macro in agast.cpp and agast_score.cpp files, aligning ARM64 behavior with how x64 selects internal functions for computation.
- As a result, ARM64 now executes the same internal functions as x64 where applicable, leading to measurable performance improvements in detect function.
- This changes is limited to Windows ARM64 and does not affect other architectures

**Performance impact:**
- Detect function shows improved runtime on ARM64 targets due to reuse of existing efficient computation paths.
<img width="1419" height="408" alt="image" src="https://github.com/user-attachments/assets/feab411a-d256-4bff-bec2-22b2583f63d1" />
2025-09-12 17:28:54 +03:00
hyarasi13 b7bc18670b Merge pull request #27774 from qnx-ports:qnx-4.12.0
Skip ARM assembly file on QNX #27774

This fixes build failures on QNX caused by unsupported ARM NEON assembly in arm/filter_neon.S. The QNX environment does not handle this assembly source correctly, resulting in compilation errors.

Build and test instruction for QNX:
https://github.com/qnx-ports/build-files/blob/main/ports/opencv/README.md


### 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-09-12 11:53:17 +03:00
Maksim Shabunin 6d4be10c44 build: fix OpenBLAS cmake search 2025-09-12 10:48:14 +03:00
Kumataro dac243bd26 Merge pull request #27769 from Kumataro:refix27557
Add strict validation for encoding parameters for APNG, Animation WebP #27769

Extra fix for https://github.com/opencv/opencv/issues/27557

- Fix for build errors with libspng library.
- Add strict validation for APNG.
- Add strict validation for Animation WebP.

### 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-09-11 16:50:58 +03:00
Alexander Smorkalov 16c8308674 Merge pull request #27750 from Kumataro:fix27744
png: add setjmp() to detect libpng internal error for APNG
2025-09-11 10:23:46 +03:00
Quaylyn Rimer 1fdff6da75 Merge pull request #27620 from killerdevildog:fix-scalar-typing-issue-27528
Fix Python Scalar typing issue #27528 #27620

- Add ScalarInput and ScalarOutput types for better type safety
- ScalarInput: Union[Sequence[float], float] for function parameters
- ScalarOutput: Sequence[float] for function return values
- Keep original Scalar type for backwards compatibility (deprecated)
- Add refinement functions to apply new types to specific functions
- Functions returning scalars now use ScalarOutput (mean, sumElems, trace)
- Drawing functions now use ScalarInput for color parameters
- Resolves MyPy compatibility issues with scalar return values
- Maintains full backwards compatibility

closes #27528 

### 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-09-10 16:47:12 +03:00
Alexander Smorkalov 1f5d695df3 Merge pull request #27767 from VadimLevin:dev/vlevin/type-hints-for-path-like-arguments
feat: add PathLike type hints for args annotated with CV_WRAP_FILE_PATH
2025-09-10 16:39:13 +03:00
Vadim Levin 1fe128f7b5 feat: add PathLike type hints for args annotated with CV_WRAP_FILE_PATH 2025-09-10 11:25:32 +03:00
Alexander Smorkalov ec015d48d6 Merge pull request #27764 from cudawarped:fix_windows_ffmpeg_preprocessor_compilation_issue
[videoio][ffmpeg] Fix Windows build error
2025-09-10 09:14:49 +03:00
Alexander Smorkalov 307442b30b Merge pull request #27762 from KAVYANSHTYAGI:typo-fixes
Fix typos in Einsum layer and G-API docs
2025-09-10 08:39:57 +03:00
cudawarped 08b84558a2 Move preprocessor directives outside of macro to avoid the following error when compiling with MSVC
D:\repos\opencv\opencv\modules\videoio\src\cap_ffmpeg_impl.hpp(1727): error C2121: '#': invalid character: possibly the result of a macro expansion
D:\repos\opencv\opencv\modules\videoio\src\cap_ffmpeg_impl.hpp(1727): error C2143: syntax error: missing ';' before 'if'
D:\repos\opencv\opencv\modules\videoio\src\cap_ffmpeg_impl.hpp(1727): error C2059: syntax error: '>='
2025-09-10 08:00:41 +03:00
Alexander Smorkalov b3f6c86d47 Merge pull request #27760 from asmorkalov:as/drop_avresample
Remove libavresample from CMake as it's not used in code.
2025-09-09 22:11:12 +03:00
Kavyansh Tyagi eed87abbcf Fix typos in Einsum layer and G-API docs 2025-09-09 23:21:14 +05:30
Alexander Smorkalov ae86b400cc Remove libavresample from CMake as it's not used in code. 2025-09-09 16:13:43 +03:00
Alexander Smorkalov efea09120b Merge pull request #27734 from cudawarped:cuda_double4_dep
[cuda] Add compatibility layer for vector types due for depreciation in CUDA 14.0
2025-09-09 14:49:48 +03:00
Alexander Smorkalov 3a21ed56e3 Merge pull request #27738 from arrzhev:fix_memoryleak_pybindings
Fix memory leaks in pybindings
2025-09-09 14:46:50 +03:00
Dmitry Kurtaev 8e0c0dc347 Merge pull request #27755 from dkurt:ffmpeg/sws_scale_frame
Optimize FFmpeg VideoCapture with swscale threads option #27755

### Pull Request Readiness Checklist

resolves https://github.com/opencv/opencv/issues/21969

* Switch to `sws_scale_from` for `libswscale >= 6.4.100` (FFmpeg >= 5.0)
* Use new context init API with threads option (`libswscale >= 8.12.100`: https://github.com/FFmpeg/FFmpeg/commit/2a091d4f2ee1e367d05a6bbbe96b204257cbda87)
* Replicate `sws_getCachedContext` with threads option for `libswscale < 8.12.100`

1 hour mp4 video every frame reading
| HW | sws_scale | sws_scale_frame + 16 threads | sws_scale_frame + 24 threads (#cpus) | 
|---|---|---|---|
| Intel Core i9-12900 CPU | 45.1 sec | 25.4 sec (x1.77) | 30 sec (x1.50) | 
| NVIDIA GPU 4090 | 232 sec | 89.4 sec (x2.59) | 77 sec (x3.01) |

```
import time
import numpy as np
import os
import cv2 as cv

# os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "hwaccel;cuvid|video_codec;h264_cuvid|vsync;0"

start = time.time()
video = "test.mp4"
cap = cv.VideoCapture(video, cv.CAP_FFMPEG)
while True:
    has_frame, frame = cap.read()
    if not has_frame:
        break

print(time.time() - start)
```

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-09-09 14:21:18 +03:00
Alexander Smorkalov 646e94aad4 Merge pull request #27759 from uilianries:docs/update-conan-url
[docs] Update Conan URL to use official Conan Center
2025-09-09 12:10:07 +03:00
Uilian Ries 7e3550dff8 Update Conan URL to use official Conan Center
Signed-off-by: Uilian Ries <uilianries@gmail.com>
2025-09-09 09:53:08 +02:00
Kumataro 9196edd299 Merge pull request #27559 from Kumataro:fix27555
imgcodecs: bmp: support to write 32bpp BMP with BI_BITFIELDS #27559

### 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-09-09 09:23:43 +03:00
Alexander Smorkalov ee41f46b46 Merge pull request #27758 from asmorkalov:as/stitching_false_overload
Renamed templated BlocksCompensator::feed method to exclude claches with base class pure virtual method
2025-09-08 18:19:10 +03:00
Nadezhda Mizonova 9663b582a2 Merge pull request #27720 from nmizonov:fix_ipp_bilateral_tiling
Set limitation to IPP Bilateral Filter tiles number to avoid too small tiles #27720

### Pull Request Readiness Checklist

This PR fixes the following issue in Bilateral Filter tiling in IPP integration: image ROI can't be closer to the image border than the filter window radius. This issue shows itself during separation of the image to tiles for multithreaded processing. If the tile size small enough, the second tile is closer to the upper image border than the bilateral filter radius, which leads to the incorrect result. To fix this, we need a limitation to the tile size - done in this PR.

_Note: red build status looks like unrelated to the current change_

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-09-08 16:11:20 +03:00
Alexander Smorkalov b28d9bef1d Renamed templated BlocksCompensator::feed method to exclude claches with base class pure virtual method. 2025-09-08 14:52:58 +03:00
cudawarped 54b03cc2f8 Merge pull request #27737 from cudawarped:fix_videowriter_raw_return_code
[videoio][VideoWriter] Fix return code from CvVideoWriter_FFMPEG::writeFrame() when encapsulating encoded video #27737

Currently the return code from `CvVideoWriter_FFMPEG::writeFrame()` when `encode_video==true` (encapsulating raw encoded video) is wrong and results in the following warning implying it has been unsuccessful

> [ WARN:0@15.551] global cap_ffmpeg.cpp:198 write FFmpeg: Failed to write frame

### 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-09-08 12:34:49 +03:00
Alexander Smorkalov 2352436a61 Merge pull request #27735 from cudawarped:cuda_silence_wd4505
[cuda] Silence unreferenced function with internal linkage has been removed warnings in Windows
2025-09-08 11:03:04 +03:00
Kumataro 98a70539cc Merge pull request #27730 from Kumataro:fix27729
doc: fix doxygen warnings for imgcodecs, flann and objdetect #27730

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

### 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-09-08 10:35:01 +03:00
Alexander Smorkalov b52feed94d Merge pull request #27728 from MaximSmolskiy:remove_useless_variables_from_fitEllipse_tests
Remove useless variables from fitEllipse tests
2025-09-08 09:51:49 +03:00
Alexander Smorkalov 3d3e962652 Merge pull request #27745 from nina16448:fix_1
Fix typos in documentation
2025-09-08 09:51:05 +03:00
Dmitry Kurtaev 65cb3fd86c Merge pull request #27741 from dkurt:libpng_1.6.45
libpng upgrade to 1.6.45 and cICP metadata support for PNG imwrite #27741

### Pull Request Readiness Checklist

resolves #24185

libpng docs: https://www.w3.org/TR/png-3/#cICP-chunk
similar code from ffmpeg: https://github.com/FFmpeg/FFmpeg/blob/a700f0f72d1f073e5adcfbb16f4633850b0ef51c/libavcodec/pngenc.c#L452-L456

So issue #24185 can be solved by replacing `cv.imwrite` in user's code to `cv.imwriteWithMetadata`:
```python
cv.imwriteWithMetadata("frame.png", frame, [cv.IMAGE_METADATA_CICP], np.array([[9, 18, 0, 1]], np.uint8))
```
```
$ exiftool /home/d.kurtaev/opencv_build/frames_pr/image_38.png
ExifTool Version Number         : 12.76
File Name                       : image_38.png
Directory                       : /home/d.kurtaev/opencv_build/frames_pr
File Size                       : 3.8 MB
File Modification Date/Time     : 2025:09:02 20:48:22+03:00
File Access Date/Time           : 2025:09:02 20:48:22+03:00
File Inode Change Date/Time     : 2025:09:02 20:48:22+03:00
File Permissions                : -rw-r--r--
File Type                       : PNG
File Type Extension             : png
MIME Type                       : image/png
Image Width                     : 1080
Image Height                    : 1920
Bit Depth                       : 8
Color Type                      : RGB
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Color Primaries                 : BT.2020, BT.2100
Transfer Characteristics        : BT.2100 HLG, ARIB STD-B67
Matrix Coefficients             : Identity matrix
Video Full Range Flag           : 1
Image Size                      : 1080x1920
Megapixels                      : 2.1
```

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-09-08 09:49:26 +03:00
Alexander Smorkalov e22c1065ec Merge pull request #27742 from asmorkalov:as/clang21
Build fix for Clang 21.
2025-09-08 08:57:57 +03:00
Dmitry Kurtaev 443d0ae63f Merge pull request #27746 from dkurt:d.kurtaev/av_packet_side_data_get
fix: FFmpeg 8.0 support #27746

### Pull Request Readiness Checklist

related comment: https://github.com/opencv/opencv/pull/27691#discussion_r2322695640

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-09-08 08:52:56 +03:00
Kumataro d9572861d1 png: add setjmp() to detect libpng internal error 2025-09-05 20:07:56 +09:00
nina16448 92e2c67896 fix typos 2025-09-05 01:00:28 +08:00
Alexander Smorkalov f51f2f6797 Build fix for Clang 21. 2025-09-03 16:43:18 +03:00
Arsenii Rzhevskii e41ce4dbf4 Fix memory leaks in pybindings 2025-09-02 17:35:41 +02: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
cudawarped ca35ed2f1c cuda: add compatibility layer for depreciated vector types 2025-09-01 13:25:50 +03:00
MaximSmolskiy 518735b509 Remove useless variables from fitEllipse tests 2025-08-30 00:42:33 +03:00
Maxim Smolskiy 6d889ee74c Merge pull request #27717 from MaximSmolskiy:improve_fitellipsedirect_tests
Improve fitEllipseDirect tests #27717

### Pull Request Readiness Checklist

Previous `fit_and_check_ellipse` implementation was very weak - it only checks that points center lies inside ellipse.
Current implementation `fit_and_check_ellipse` checks that points RMS (Root Mean Square) algebraic distance is quite small. It means that on average points are near boundary of ellipse. Because for points on ellipse algebraic distance is equal to `0` and for points that are close to boundary of ellipse is quite small

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-08-29 13:16:22 +03:00
Alexander Smorkalov 2ae5a1ee27 Merge pull request #27706 from kallaballa:enable_hog_with_inter_linear
HOG: stay on fast-path by using INTER_LINEAR resize when ALGO_HINT_APPROX is defined
2025-08-29 13:14:20 +03:00
Alexander Smorkalov e4a7bab00e Merge pull request #27677 from kallaballa:data_races_in_ocl_cpp2
Added source comments to mark TSAN false positives
2025-08-29 13:13:03 +03:00
Fanchen Kong bfdd7d5a10 Add large scalar kernel for fastconv 2025-08-28 15:25:06 +08:00
Alexander Smorkalov d9556920dc Merge pull request #27718 from asmorkalov:as/obj_construct_fix
Fixed Subdiv2D constructor overload.
2025-08-27 13:48:58 +03:00
Alexander Smorkalov 0e9c3b5a3b Fixed Subdiv2D constructor overload. 2025-08-27 11:37:39 +03:00
damon-spacemit ad22d482e6 Merge pull request #27378 from spacemit-com:4.x
Add canny, scharr and sobel for riscv-rvv hal. #27378

### 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-08-26 20:05:08 +03:00
Maxim Smolskiy ad560f69f4 Merge pull request #27704 from MaximSmolskiy:fix_checking_that_point_lies_inside_ellipse
Fix checking that point lies inside ellipse #27704

### Pull Request Readiness Checklist

Previous `check_pt_in_ellipse` implementation was incorrect. For points on ellipse `cv::norm(to_pt)` should be equal to `el_dist`.

I tested current implementation with following Python script:
```
import cv2
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse

def check_pt_in_ellipse(pt, el):
    center, axes, angle = ellipse
    to_pt = pt - center
    el_angle = angle * np.pi / 180
    to_pt_r_x = to_pt[0] * np.cos(-el_angle) - to_pt[1] * np.sin(-el_angle)
    to_pt_r_y = to_pt[0] * np.sin(-el_angle) + to_pt[1] * np.cos(-el_angle)
    pt_angle = np.arctan2(to_pt_r_y / axes[1], to_pt_r_x / axes[0])
    x_dist = 0.5 * axes[0] * np.cos(pt_angle)
    y_dist = 0.5 * axes[1] * np.sin(pt_angle)
    el_dist = np.sqrt(x_dist * x_dist + y_dist * y_dist)
    assert abs(np.linalg.norm(to_pt) - el_dist) < 1e-10

# TEST(Imgproc_FitEllipse_Issue_4515, accuracy) {
points = np.array([
    [327, 317],
    [328, 316],
    [329, 315],
    [330, 314],
    [331, 314],
    [332, 314],
    [333, 315],
    [333, 316],
    [333, 317],
    [333, 318],
    [333, 319],
    [333, 320],
])

ellipse = cv2.fitEllipseDirect(points)

center, axes, angle = ellipse

angle_rad = np.deg2rad(angle)
points_on_ellipse = []
for point_angle_deg in range(0, 360, 10):
    point_angle = np.deg2rad(point_angle_deg)
    point = np.array([0., 0.])
    point_x = axes[0] * 0.5 * np.cos(point_angle)
    point_y = axes[1] * 0.5 * np.sin(point_angle)
    point[0] = point_x * np.cos(angle_rad) - point_y * np.sin(angle_rad)
    point[1] = point_x * np.sin(angle_rad) + point_y * np.cos(angle_rad)
    point[0] += center[0]
    point[1] += center[1]
    points_on_ellipse.append(point)

points_on_ellipse = np.array(points_on_ellipse)

for point in points_on_ellipse:
    check_pt_in_ellipse(point, ellipse)

plt.figure(figsize=(8, 8))
plt.scatter(points[:, 0], points[:, 1], c='red', label='points')
plt.scatter(points_on_ellipse[:, 0], points_on_ellipse[:, 1], c='yellow', label='ellipse')
ellipse = Ellipse(xy=center, width=axes[0], height=axes[1], 
                  angle=angle, facecolor='none', edgecolor='b')
plt.gca().add_patch(ellipse)
plt.gca().set_aspect('equal')
plt.legend()
plt.show()
```

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-08-26 14:02:53 +03:00
Alexander Smorkalov ff9da98c7c Merge pull request #27708 from utibenkei:fix_java_wrapper_missing_vector_vector_matshape
Add Java wrapper support for List<List<MatShape>>
2025-08-26 09:42:31 +03:00
eplankin 3e404004e0 Merge pull request #27612 from eplankin:icv_update_2022.2
Update IPP integration (v2022.2.0) #27612

Please merge together with https://github.com/opencv/opencv_3rdparty/pull/102
Supported IPP version was updated to IPP 2022.2.0 for Linux and Windows.

Previous update: https://github.com/opencv/opencv/pull/27354
2025-08-25 18:14:03 +03:00
utibenkei 81b66cf972 Add Java wrapper support for List<List<MatShape>>
- Added vector_MatShape and vector_vector_MatShape to gen_dict.json
- Implemented MatShape_to_vector_MatShape, vector_MatShape_to_MatShape, MatShape_to_vector_vector_MatShape, and vector_vector_MatShape_to_MatShape conversion functions in dnn_converters.h/cpp and Converters.java
- Added testGetLayersShapes test to verify List<List<MatShape>> conversion
2025-08-25 02:09:19 +09:00
Alexander Smorkalov 7a4bd85299 Merge pull request #27705 from utibenkei:fix_java_wrapper_missing_vector_vector_mat
Add Java wrapper support for List<List<Mat>>
2025-08-24 17:16:31 +03:00
Alexander Smorkalov 86df531554 Merge pull request #27691 from asmorkalov:as/fmmpeg_8.0
FFmpeg 8.0 support.
2025-08-24 17:10:41 +03:00
kallaballa f81240f57b stay on fast-path by using INTER_LINEAR resize when ALGO_HINT_APPROX is used 2025-08-23 19:48:04 +02:00
utibenkei fb68223b5c Add Java wrapper support for List<List<Mat>>
- Added vector_vector_Mat to gen_dict.json
- Implemented Mat_to_vector_vector_Mat and vector_vector_Mat_to_Mat conversion functions in converters.h/cpp and Converters.java
- Added DnnForwardAndRetrieve.java test to verify List<List<Mat>> conversion : Reference: C++ test in modules/dnn/test/test_misc.cpp - TEST(Net, forwardAndRetrieve)
2025-08-23 04:57:34 +09:00
utibenkei 28d410cecf Merge pull request #27567 from utibenkei:fix-java-wrapper-missing-vec4i
Enable Java wrapper generation for Vec4i #27567 
 
Fixes an issue where Java wrapper generation skips methods using Vec4i.
Related PR in opencv_contrib: https://github.com/opencv/opencv_contrib/pull/3988

The root cause was the absence of Vec4i in gen_java.json, which led to important methods such as aruco.drawCharucoDiamond() and ximgproc.HoughPoint2Line() being omitted from the Java bindings.

This PR includes the following changes:

- Added Vec4i definition to gen_java.json
- Updated gen_java.py to handle jintArray-based types properly
- ~~Also adjusted jn_args and jni_var for Vec2d and Vec3d to ensure correct JNI behavior~~

The modified Java wrapper generator successfully builds and includes the expected methods using Vec4i.

### 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-08-20 15:06:33 +03:00
Alexander Smorkalov 719b86bd1d Merge pull request #27682 from asmorkalov:as/ios_bindings_fix
Fixed duplicate declaration issue in Swift/ObjC bindings
2025-08-20 12:58:41 +03:00
Alexander Smorkalov 0986022bcb Merge pull request #27689 from asmorkalov:as/pyton_wrap_gridtype
Wrap cicles grid GridType as settings structure is useless without it.
2025-08-20 12:58:14 +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
Alexander Smorkalov 0b84a54a65 Fixed duplicate declaration issue in Swift/ObjC bindings. 2025-08-20 11:14:03 +03:00
Alexander Smorkalov 90c444abd3 FFmpeg 8.0 support. 2025-08-20 10:53:51 +03:00
Alexander Smorkalov 319e8e7a43 Wrap cicles grid GridType as settings structure is useless without it. 2025-08-20 09:06:00 +03:00
Alexander Smorkalov 32c6aee53d Merge pull request #27687 from asmorkalov:as/virtual_warn_fix
Fixed -Wunnecessary-virtual-specifier warning produced latest clang.
2025-08-20 09:03:17 +03:00
Suleyman TURKMEN d9c0ee234f Merge pull request #27679 from sturkmen72:libtiff-4.7.0
libtiff upgrade to version 4.7.0 #27679 
 
### 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-08-19 13:29:17 +03:00
Alexander Smorkalov 13a2919ec0 Fixed -Wunnecessary-virtual-specifier warning produced latest clang. 2025-08-19 12:28:15 +03:00
Alexander Smorkalov 920040d72e Merge pull request #27683 from asmorkalov:as/calib_tutorial_logic_fix
Fixed logical error in camera calibration tutorial.
2025-08-18 17:19:27 +03:00
Alexander Smorkalov 52ae1cfc29 Fixed logical error in camera calibration tutorial. 2025-08-18 13:07:09 +03:00
Alexander Smorkalov a7ff9087f9 Merge pull request #27680 from Kumataro:fix27626
add DEBUG_POSTFIX to ipphal
2025-08-18 11:57:33 +03:00
Kumataro 078563288e add DEBUG_POSTFIX to ipphal 2025-08-17 08:19:52 +09:00
Alexander Smorkalov eab6d5741a Merge pull request #27663 from asmorkalov:as/orbsensor_distortion
Expose Orbbec color camera distortion coefficients as API.
2025-08-15 15:11:47 +03:00
Aditya Jha 7a1ec54c43 Merge pull request #27641 from Ma-gi-cian:subdiv2d-rect2f-clean
Subdiv2d rect2f clean #27641

Closes https://github.com/opencv/opencv/issues/27623

Changes:

- Added Subdiv2D(Rect2f) constructor overload
- Added initDelaunay(Rect2f) method overload

- No changes to the previous implementation to keep it backward compatible
- Added tests for init and testing with edge case of extremely small coordinates

- [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

See original pull request at : https://github.com/opencv/opencv/pull/27631
2025-08-15 15:05:27 +03:00
Alexander Smorkalov 9909d0a7d2 Merge pull request #27675 from dkurt:4.x
Skip test_cuda_copyTo
2025-08-15 10:54:40 +03:00
Alexander Smorkalov c27f5a3905 Merge pull request #27659 from asmorkalov:as/interactive_empty_frames
Skip couple of intro frames in interactive calibration tool, if VideoCapture is opened correctly
2025-08-15 09:32:14 +03:00
kallaballa 056e761bbc added source comments to mark TSAN false positives. see: #27638 2025-08-15 01:17:54 +02:00
Dmitry Kurtaev ae4b4c210d Skip test_cuda_copyTo 2025-08-14 15:41:24 +03:00
Alexander Smorkalov 84dc1e93c5 Merge pull request #27670 from dkurt:skip_py_cuda_test
Skip test_cuda_convertTo
2025-08-14 15:13:17 +03:00
Dmitry Kurtaev fa134b95fd Skip test_cuda_convertTo 2025-08-14 11:56:31 +03:00
Alexander Smorkalov fe874b8f36 Merge pull request #27668 from cudawarped:python_loader_fix_cuda_13_path
[python][cuda] Update CUDA shared library location for CUDA Toolkit 13.0 on Windows
2025-08-14 09:52:47 +03:00
cudawarped 850919e10b [python][cuda] Update CUDA shared library location for CUDA Toolkit 13.0 2025-08-13 21:59:59 +03:00
Alexander Smorkalov a8afdee984 Merge pull request #27664 from ansh1406:fix-opencv-videoio-dshow-missing-override
videoio: add missing CV_OVERRIDE to VideoCapture_DShow::isOpened()
2025-08-13 10:02:43 +03:00
Ansh Swaroop 88fb0bad69 videoio: add missing CV_OVERRIDE to VideoCapture_DShow::isOpened()
This aligns with other virtual method declarations in cap_dshow.hpp
and silences compiler warnings (-Wsuggest-override) while improving
compile-time safety.
2025-08-13 02:28:44 +05:30
Madan mohan Manokar 2762ffe7cc Merge pull request #27433 from amd:fast_bilateral_simd
imgproc: Bilateral filter performance improvement #27433

### 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
- [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-08-12 17:50:44 +03:00
Kumataro c5bb6a014a Merge pull request #27621 from Kumataro:trial27557
Add strict validation for encoding parameters #27621

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

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-08-12 16:04:45 +03:00
Alexander Smorkalov d33999cb6e Merge pull request #27613 from kruid9403:feature/symbol-dispose-support-26157
Support Symbol.dispose for using keyword in OpenCV.js (#26157)
2025-08-12 15:53:26 +03:00
Alexander Smorkalov f4538f5020 Expose Orbbec color camera distortion coefficients as API. 2025-08-12 15:46:28 +03:00
Andrei Tamas 252403bbf2 Merge pull request #27600 from atamas19:ov_output_clamping
G-API: Implement cfgClampOutputs option to OpenVINO Params #27600

Added the option `cfgClampOutputs` to control where output clamping is performed for OpenVINO models. When enabled, output values are clamped in the PrePostProcessor stage instead of by the device or plugin. This provides a consistent and standardized clamping method across devices, helping to maintain accuracy regardless of device-specific clamping behavior.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-08-12 14:34:42 +03:00
Alexander Smorkalov a0639446cc Skip couple of intro frames in interactive calibration tool, if VideoCapture is opened correctly. 2025-08-12 13:58:28 +03:00
Alexander Smorkalov 2ecc22fe03 Merge pull request #27657 from asmorkalov:as/fast_buffer_size
Added heuristic to allocate buffer for FAST features depending on input image resolution
2025-08-12 13:29:26 +03:00
Alexander Smorkalov 84d391aac4 Added heuristic to allocate buffer for FAST features depending on input image resolution. 2025-08-12 11:07:35 +03:00
Haosonn 75d9ac3964 Merge pull request #27391 from Haosonn:pr-rvv-hal-fast
hal/riscv-rvv: implement FAST keypoint detection #27391

An implementation of FAST keypoint detection with NMS/noNMS version.

A new perf test is written, and the perf test is evaluated in two platforms: K1/K230.
Accelaration is achieved when threshold is high, however, weird stat shows that the acceleration doesn't work when threshold is low (the number of keypoint candidates is high).

K1:
```
# GCC

                             Name of Test                               scalar  rvv      rvv
                                                                                          vs
                                                                                        scalar
                                                                                      (x-factor)
detect::Fast_Params::(20, 2, false, "cv/cameracalibration/chess9.png")  22.113 23.721    0.93
detect::Fast_Params::(20, 2, false, "cv/inpaint/orig.png")              4.605  7.168     0.64
detect::Fast_Params::(20, 2, true, "cv/cameracalibration/chess9.png")   26.228 24.689    1.06
detect::Fast_Params::(20, 2, true, "cv/inpaint/orig.png")               7.134  7.561     0.94
detect::Fast_Params::(30, 2, false, "cv/cameracalibration/chess9.png")  19.488 21.407    0.91
detect::Fast_Params::(30, 2, false, "cv/inpaint/orig.png")              3.481  5.404     0.64
detect::Fast_Params::(30, 2, true, "cv/cameracalibration/chess9.png")   22.309 22.145    1.01
detect::Fast_Params::(30, 2, true, "cv/inpaint/orig.png")               4.826  5.654     0.85
detect::Fast_Params::(100, 2, false, "cv/cameracalibration/chess9.png") 14.108 8.205     1.72
detect::Fast_Params::(100, 2, false, "cv/inpaint/orig.png")             2.520  1.072     2.35
detect::Fast_Params::(100, 2, true, "cv/cameracalibration/chess9.png")  14.133 8.410     1.68
detect::Fast_Params::(100, 2, true, "cv/inpaint/orig.png")              2.556  1.097     2.33

# Clang

                             Name of Test                               scalar  rvv      rvv
                                                                                          vs
                                                                                        scalar
                                                                                      (x-factor)
detect::Fast_Params::(20, 2, false, "cv/cameracalibration/chess9.png")  25.130 23.695    1.06
detect::Fast_Params::(20, 2, false, "cv/inpaint/orig.png")              4.987  7.168     0.70
detect::Fast_Params::(20, 2, true, "cv/cameracalibration/chess9.png")   28.035 24.467    1.15
detect::Fast_Params::(20, 2, true, "cv/inpaint/orig.png")               6.760  7.503     0.90
detect::Fast_Params::(30, 2, false, "cv/cameracalibration/chess9.png")  22.954 21.373    1.07
detect::Fast_Params::(30, 2, false, "cv/inpaint/orig.png")              3.838  5.330     0.72
detect::Fast_Params::(30, 2, true, "cv/cameracalibration/chess9.png")   24.523 21.998    1.11
detect::Fast_Params::(30, 2, true, "cv/inpaint/orig.png")               4.795  5.543     0.87
detect::Fast_Params::(100, 2, false, "cv/cameracalibration/chess9.png") 16.799 8.102     2.07
detect::Fast_Params::(100, 2, false, "cv/inpaint/orig.png")             2.874  1.024     2.81
detect::Fast_Params::(100, 2, true, "cv/cameracalibration/chess9.png")  16.950 8.073     2.10
detect::Fast_Params::(100, 2, true, "cv/inpaint/orig.png")              2.899  1.027     2.82
```

K230
```
# GCC

                             Name of Test                               scalar  rvv      rvv
                                                                                          vs
                                                                                        scalar
                                                                                      (x-factor)
detect::Fast_Params::(20, 2, false, "cv/cameracalibration/chess9.png")  21.082 32.090    0.66
detect::Fast_Params::(20, 2, false, "cv/inpaint/orig.png")              4.837  9.157     0.53
detect::Fast_Params::(20, 2, true, "cv/cameracalibration/chess9.png")   25.479 33.576    0.76
detect::Fast_Params::(20, 2, true, "cv/inpaint/orig.png")               7.549  9.716     0.78
detect::Fast_Params::(30, 2, false, "cv/cameracalibration/chess9.png")  18.463 30.087    0.61
detect::Fast_Params::(30, 2, false, "cv/inpaint/orig.png")              3.716  6.544     0.57
detect::Fast_Params::(30, 2, true, "cv/cameracalibration/chess9.png")   21.548 31.374    0.69
detect::Fast_Params::(30, 2, true, "cv/inpaint/orig.png")               5.107  6.928     0.74
detect::Fast_Params::(100, 2, false, "cv/cameracalibration/chess9.png") 13.763 8.712     1.58
detect::Fast_Params::(100, 2, false, "cv/inpaint/orig.png")             2.578  1.284     2.01
detect::Fast_Params::(100, 2, true, "cv/cameracalibration/chess9.png")  13.804 8.831     1.56
detect::Fast_Params::(100, 2, true, "cv/inpaint/orig.png")              2.615  1.289     2.03

# Clang

                             Name of Test                               scalar  rvv      rvv
                                                                                          vs
                                                                                        scalar
                                                                                      (x-factor)
detect::Fast_Params::(20, 2, false, "cv/cameracalibration/chess9.png")  23.424 35.072    0.67
detect::Fast_Params::(20, 2, false, "cv/inpaint/orig.png")              5.284  10.107    0.52
detect::Fast_Params::(20, 2, true, "cv/cameracalibration/chess9.png")   26.487 35.978    0.74
detect::Fast_Params::(20, 2, true, "cv/inpaint/orig.png")               7.146  10.612    0.67
detect::Fast_Params::(30, 2, false, "cv/cameracalibration/chess9.png")  21.155 32.858    0.64
detect::Fast_Params::(30, 2, false, "cv/inpaint/orig.png")              4.101  7.153     0.57
detect::Fast_Params::(30, 2, true, "cv/cameracalibration/chess9.png")   23.321 33.505    0.70
detect::Fast_Params::(30, 2, true, "cv/inpaint/orig.png")               5.106  7.415     0.69
detect::Fast_Params::(100, 2, false, "cv/cameracalibration/chess9.png") 15.597 8.792     1.77
detect::Fast_Params::(100, 2, false, "cv/inpaint/orig.png")             2.922  1.228     2.38
detect::Fast_Params::(100, 2, true, "cv/cameracalibration/chess9.png")  15.626 8.817     1.77
detect::Fast_Params::(100, 2, true, "cv/inpaint/orig.png")              2.963  1.240     2.39
```

### 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
- [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-08-11 13:03:34 +03:00
Alexander Smorkalov a783a1e2d8 Merge pull request #27649 from Kumataro:fix27648
test: gif: to test GIF codec at write_gif_flags
2025-08-11 12:52:38 +03:00
jmackay2 f0888a10e8 Merge pull request #27636 from jmackay2:cuda_13
Cuda 13.0 compatibility #27636

### 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


### Issue
CUDA 13 deprecated some fields, resulting in build failures with CUDA 13. This updates to use the replacement API. 
The reference to the deprecated features is here: https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#id6

### Testing
This was testing by building on the following configurations:
OS: Ubuntu 24.04
CUDA: 12.9, 13.0
2025-08-11 12:15:24 +03:00
Kumataro 12efb8499d test: gif: to test GIF codec at write_gif_flags 2025-08-09 13:10:08 +09:00
Pierre Chatelier e31ff00104 Merge pull request #27599 from chacha21:drawing_stack_alloc
optimize some drawing with stack allocation #27599

Some drawings can try a stack allocation instead of a std::vector

### 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-08-07 17:19:55 +03:00
Alexander Smorkalov 03fbfc7014 Merge pull request #27577 from SamCarlberg:java/automatic-module-name
java: Set Automatic-Module-Name manifest attribute in the built JAR file
2025-08-07 17:09:45 +03:00
Alexander Smorkalov a1f1afa693 Merge pull request #27606 from 402erro:patch-1
Update grammatical error in py_intro.markdown
2025-08-07 17:06:25 +03:00
Suleyman TURKMEN 8d1ec466f0 Merge pull request #27605 from sturkmen72:perf_imgcodecs
Performance tests for writing and reading animations #27605

### Pull Request Readiness Checklist

related : https://github.com/opencv/opencv/pull/27496

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-08-07 17:04:12 +03:00
Alexander Smorkalov 29c73c1d2a Merge pull request #27628 from asmorkalov:as/grayscale_calib
Convert grayscale frames into color in interactive calibration preview
2025-08-07 16:54:54 +03:00
Alexander Smorkalov a265947356 Merge pull request #27629 from asmorkalov:as/added_orbbec_sdk_init_params
Added options to initialize Orbbec cameras with custom fps and resolution
2025-08-06 11:29:48 +03:00
Alexander Smorkalov 9f88e9ae31 Added options to initialize Orbbec cameras with custom fps and resolution. 2025-08-05 17:29:29 +03:00
Alexander Smorkalov 96fdbc58e1 Convert grayscale frames into color in nteractive calibration preview 2025-08-05 10:09:12 +03:00
Alexander Smorkalov 13846de9f6 Merge pull request #27610 from asmorkalov:as/orbbec_sdk_timestamps
Added timestamps support for Orbbec SDK backend in VideoIO.
2025-08-04 13:48:33 +03:00
Alexander Smorkalov bbd8c4cc12 Merge pull request #27622 from Kumataro:fixDocGIFisDefaultON
doc: Enable GIF support by default on documentation
2025-08-04 08:23:40 +03:00
Kumataro 243f74cc8c doc: Enable GIF support by default on documentation 2025-08-03 17:00:26 +09:00
Alexander Smorkalov 8496706216 Added timestamps support for Orbbec SDK backend in VideoIO. 2025-08-01 15:55:03 +03:00
Alexander Smorkalov 52bed3cd78 Merge pull request #27615 from Kumataro:fix27614
imgcodecs: png: adjust value range for IMWRITE_PNG_ZLIBBUFFER_SIZE
2025-08-01 13:25:10 +03:00
Alexander Smorkalov ca053bb8ab Merge pull request #27564 from inventshah:refine-calib3d-distCoeffs-py-type
fix: mark distCoeffs/R/D as optional Python type stubs for calib3d functions
2025-08-01 13:17:05 +03:00
Alexander Smorkalov dbd984a9f6 Merge pull request #27617 from asmorkalov:as/opencvai_copyright
Added OpenCV.AI copyright.
2025-08-01 09:54:53 +03:00
Alexander Smorkalov 83e352dc48 Added OpenCV.AI copyright. 2025-08-01 09:50:10 +03:00
Kumataro 1dd06eb0da imgcodecs: png: adjust value range for IMWRITE_PNG_ZLIBBUFFER_SIZE 2025-08-01 09:49:43 +09:00
Jeremy Kruid 3dec85df71 Update helpers.js to include .dlete 2025-07-31 15:40:59 -05:00
Alexander Smorkalov 8dc4ad3ff3 Merge pull request #27607 from asmorkalov:as/apple_kleidicv
KleidiCV support on Apple devices #27607

Scope:
- Disabled bitcode generation in iPhone framework by default.
- Enabled KleidiCV build for iPhone.
- Added Github Actions log tags to group per-architecture builds and format logs.

### 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-07-31 16:05:37 +03:00
rowdha fakier fb37e14cbf Update py_intro.markdown
Changed line 69 from "Remember, we together" to "Remember, together we..."

I saw that this page encouraged us to contribute no matter how small the contribution is so I decided to "shoot my shot" as a beginner developer and fix a small grammatical error. Would be nice if I could be allowed to be recognized as a contributor with my contribution albeit pretty small, hopefully in the future, more meaningful contributions will be made! :)
2025-07-30 20:37:03 +02:00
Suleyman TURKMEN 7ab4e1bf56 Merge pull request #27583 from sturkmen72:jpeg_iccp
Jpeg Metadata (iccp and xmp) #27583

### 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

to do : 

- [x] consider `m_read_options`
- [x] check if ICCP metadata is suitable to write PNG
- [x] the file `testExifOrientation_3.jpg` used in the test has an ICCP data. this data can be saved in jpg format but could not in PNG and WEBP format. Impovements to check this case with PNGEncoder and WEBPEncoder planned.
2025-07-30 12:07:49 +03:00
Alexander Smorkalov e323e05446 Merge pull request #27598 from asmorkalov:as/png_build_compat
Fixed build with libpng older than 1.5.x and reduced test memory consumption
2025-07-29 18:15:56 +03:00
Alexander Smorkalov eebb15683f Fixed build with libpng older than 1.5.x 2025-07-29 17:08:46 +03:00
Maxim Smolskiy 615ceefd0c Merge pull request #27582 from MaximSmolskiy:take_into_account_overflow_for_connected_components
Take into account overflow for connected components #27582

### Pull Request Readiness Checklist

Fix #27568 

The problem was caused by a label type overflow (`debug_example.npy` contains `92103` labels, that doesn't fit in the `CV_16U` (`unsigned short`) type). If pass `CV_32S` instead of `CV_16U` as `ltype` - everything will be calculated successfully

Added overflow detection to throw exception with a clear error message instead of strange segfault/assertion error

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-07-29 13:10:01 +03:00
Yuantao Feng 07cf36cbb0 Merge pull request #27587 from fengyuentau:4x/core/filestorage_json_support_backslash
core: support parsing back slash \ in parseKey in FileStorage (JSON) #27587

Fixes #27585 

### 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-07-29 12:04:55 +03:00
Kumataro 48b75bc029 Merge pull request #27589 from Kumataro:fix27588
imgcodecs: fix Imgcodecs_Png.write_big test for spng #27589

Close #27588 

### 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-07-29 08:18:21 +03:00
inventshah 4ba3d472ec fix: mark distCoeffs/R/D as optional in calib3d functions 2025-07-28 09:40:07 -04:00
Alexander Smorkalov 8e20ec2f26 Merge pull request #27575 from pratham-mcw:arm64-cvround-fast-math
core: add ARM64 NEON support for cvRound in fast_math.hpp
2025-07-28 12:46:58 +03:00
Yuantao Feng 603d7ded88 Merge pull request #27579 from fengyuentau:4x/core/filestorage
core: support parsing null in json parser in FileStorage #27579

Fixes https://github.com/opencv/opencv/issues/27578

### 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-07-28 08:59:46 +03:00
Alexander Smorkalov 2ab4bd3405 Merge pull request #27571 from asmorkalov:as/calib_tutorial_fix
Use calibration board imperfectness correction only for the cases where it's applicable
2025-07-25 12:58:11 +03:00
Alexander Smorkalov 7835c214eb Merge pull request #27574 from asmorkalov:as/interactive_calibration_flags
More intrinsic calibration flags in integractive calibration tool
2025-07-25 12:55:38 +03:00
Alexander Smorkalov e4fabe393c More intrinsic calibration flags in integractive calibration tool. 2025-07-25 11:31:51 +03:00
Sam Carlberg 84ca221184 Set Automatic-Module-Name manifest attribute
This is a useful property for modularized libraries and applications to be able to use OpenCV

A full module-info.java file for true compatibility with the Java module system would require compiling with Java 9+ and either use a multi-release JAR (which can be tricky to maintain) or compile the entire library with Java 9+ (which would break Android consumers on older SDK versions). In the interest of causing the least disruption, only an automatic module name is set so that modular Java 9+ consumers can use OpenCV but not break anybody else.
2025-07-25 00:28:29 -04:00
Alexander Smorkalov ac9d0e0d0d Removed hack for calibration boards in samples and tutorials. 2025-07-24 11:27:20 +03:00
Alexander Smorkalov ec9b8de3fa Merge pull request #27569 from asmorkalov:as/counters_build_fix
Fixed build issue with some old GCC versions #27569

Fixes build for GCC 4.8.5 at least. Looks like the method default signature differs cross GCC versions or newer version has softer checker.

### 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-07-24 11:23:21 +03:00
Suleyman TURKMEN 32bd8c9632 Merge pull request #27503 from sturkmen72:metadata
[GSOC 2025] PNG&WebP Metadata Reading Writing Improvements #27503

Merge with https://github.com/opencv/opencv_extra/pull/1271

### 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-07-23 14:59:34 +03:00
pratham-mcw 6efca656b8 core: add ARM64 NEON support for cvRound in fast_math.hpp 2025-07-23 14:32:30 +05:30
Andrei Tamas 15e3cf3cc5 Merge pull request #27549 from atamas19:tensor_naming_functionality
G-API: Implement cfgEnsureNamedTensors option to OpenVINO Params #27549

Added the option cfgEnsureNamedTensors to be applied on OpenVINO models with nameless tensors. If a tensor doesn't have a name, it sets a default one. The default name is created using OpenVINO's standard `make_default_tensor_name` . `make_default_tensor_name`  had to be rewritten because it is only available in OpenVINO's dev_api.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-07-22 17:09:39 +03:00
Suleyman TURKMEN ab8a1fa280 Merge pull request #27551 from sturkmen72:png-improvements
Add enum IMWRITE_PNG_ZLIBBUFFER_SIZE #27551

### Pull Request Readiness Checklist

This patch enables users to set the internal zlib compression buffer size for PNG encoding

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
- [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-07-18 20:41:12 +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
Yan Wen f54286b672 Merge pull request #27453 from MELSunny:4.x
Add Raspberry Pi 4 and 5 V4L2 Stateless HEVC Hardware Acceleration with FFmpeg #27453

This PR enables V4L2 stateless HEVC hardware acceleration for Raspberry Pi 5 within OpenCV's videoio module. It leverages FFmpeg's drm acceleration ([FFmpeg API changes](https://github.com/FFmpeg/FFmpeg/blob/ee1f79b0fa4c82da9c19328b049b593c71611402/doc/APIchanges#L1529)), significantly improving HEVC decoding performance on RPi5 for robotics and embedded vision applications.

I have a working proof-of-concept with local benchmarks showing clear gains.

Checklist Status:

Ready: License, branch (4.x), FFmpeg reference, and (linked) related issue (#27452).
Seeking Guidance: Need help with formal C++ performance/accuracy tests, opencv_extra integration, and full documentation/examples.
As a Python developer, I welcome C++ best practice feedback and assistance with testing setup.

### 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:19:58 +03:00
Alexander Smorkalov 4813d1cd32 Merge pull request #27546 from asmorkalov:as/interactive_calib_backend
Added command line option to select VideoCapture backend
2025-07-16 12:02:49 +03:00
Alexander Smorkalov f59a955bea Added command line option to select VideoCapture backend. 2025-07-16 10:09:23 +03:00
Aakash Preetam 8366a2e506 Merge pull request #27525 from CodeLinaro:apreetam_7thPost
Update FastCV lib hash for Linux and Android

Updated libs PR [opencv/opencv_3rdparty#101](https://github.com/opencv/opencv_3rdparty/pull/101)
### 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-07-16 10:01:00 +03:00
Alexander Smorkalov f734de08ca Merge pull request #27544 from inventshah:fix-detect-and-compute-py-type
fix: mark Feature2D.detectAndCompute mask as optional in Python type stubs
2025-07-15 15:07:01 +03:00
Alexander Smorkalov 1342ca2f95 Merge pull request #27545 from vrabaud:png
Replace deprecated proto2::FieldDescriptor::is_optional
2025-07-15 13:03:40 +03:00
Vincent Rabaud 61a3d7d25d Replace deprecated proto2::FieldDescriptor::is_optional
It has been marked for inlining, cf
https://github.com/protocolbuffers/protobuf/blob/930036a8cf4a489521ea78ea47510a3a6fb9d7c0/src/google/protobuf/descriptor.h#L936
2025-07-15 09:17:57 +02:00
inventshah 10ce4d406d fix: mark Feature2D.detectAndCompute mask as optional in Python type stubs 2025-07-14 21:35:58 -04: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
xaos-cz 69b2024a3d imgcodecs: OpenEXR multispectral read:write support (#27485)
imgcodecs: OpenEXR multispectral read/write support #27485

OpenCV Extra: https://github.com/opencv/opencv_extra/pull/1262/

Adds capability to read and write multispectral (>4 channels) images in OpenEXR format.

### 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
- [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-07-14 16:04:25 +03:00
Sachin Shah 4c024c35fb Merge pull request #27523 from inventshah:fix-set-then-get-pos
FIX: CvCapture_FFMPEG::setProperty(CAP_PROP_POS_*) followed by getProperty #27523

Partially fixes #23088 and #23472. This PR fixes `get(CAP_PROP_POS_MSEC)` calls after a `set(CAP_PROP_POS_*)` without calling `read` first.

Since `seek` calls `grabFrame` which already sets `picture_pts`, manually setting `picture_pts` anywhere else in the call stack should not be necessary (except for the special case of seeking to frame 0).

Minimal example from #23088
```cpp
for(int i = 0; i < 3; i++) cap.read(img);
printf("at: %f frames, %f msec\n", cap.get(CAP_PROP_POS_FRAMES), cap.get(CAP_PROP_POS_MSEC));

cap.set(CAP_PROP_POS_FRAMES, 3);
printf("at: %f frames, %f msec\n", cap.get(CAP_PROP_POS_FRAMES), cap.get(CAP_PROP_POS_MSEC));
```

Current
```txt
at: 3.000000 frames, 80.000000 msec
at: 3.000000 frames, 0.234375 msec
```

PR
```txt
at: 3.000000 frames, 80.000000 msec
at: 3.000000 frames, 80.000000 msec
```

It similarly helps with `CAP_PROP_POS_MSEC`:

Current
```txt
at: 3.000000 frames, 80.000000 msec
at: 2.000000 frames, 6.250000 msec
```

PR
```txt
at: 3.000000 frames, 80.000000 msec
at: 2.000000 frames, 40.000000 msec
```

Note the seek operation is still inconsistent between the `CAP_PROP_POS_*` options as mentioned by #23088, and VFR video seeking has issues discussed in #9053. For fixed-frame rate video, we could change 0.5 to 1 in `void CvCapture_FFMPEG::seek(double sec);` to align `CAP_PROP_POS_MSEC` with `CAP_PROP_POS_FRAMES`, but `CAP_POS_AVI_RATIO` and VFR video would still be broken.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-07-14 11:59:44 +03:00
Alexander Smorkalov 0a1a07d62e Merge pull request #27506 from vrabaud:avif
Fix XMP write and discarded return value.
2025-07-14 09:37:06 +03:00
Alexander Smorkalov 875c112f9a Merge pull request #27519 from ekharkov:dev/reamp
Move IPP Remap to HAL
2025-07-14 09:20:16 +03:00
Alexander Smorkalov 09309523da Merge pull request #27529 from vrabaud:png
Fix potential crashes found by fuzzer.
2025-07-14 09:17:09 +03:00
Alexander Smorkalov 824cbf51ec Merge pull request #27532 from eplankin:warp_fix
Fixed memory leak in ipp_warp function
2025-07-14 08:54:44 +03:00
eplankin 1ecdb39fde fixed memory leak in ipp_warp function 2025-07-11 10:57:36 +02:00
Vincent Rabaud deaf58689a Fix potential crashes found by fuzzer.
Namely 429429085, 429645379, 430091585
2025-07-10 15:05:56 +02:00
Dmytro Dadyka 80b7ef85dc [video][ECC] Add multichannel support and extend ECC tests and docs 2025-07-10 01:25:30 +03:00
ekharkov d19dd94dee Moved IPP remap to HAL 2025-07-08 12:31:40 +02:00
Alexander Smorkalov 9cdd525bc5 Merge pull request #27518 from ClaudioMartino:fix_hist_comp_doc
Fix: Removed '*/' from equation in histogram comparison doc
2025-07-08 11:12:26 +03:00
ClaudioMartino 3001db4776 Fix: Removed '*/' from equation in histogram comparison doc 2025-07-07 15:35:35 +02:00
Alexander Smorkalov 478040c408 Merge pull request #27516 from ClaudioMartino:norm_KL_div
New normalization in histogram comparison tutorial to use Kullback-Leibler divergence
2025-07-07 12:10:21 +03:00
Alexander Smorkalov d53531500a Merge pull request #27514 from Kumataro:fix27513
js: remove deprecated DEMANGLE_SUPPORT option
2025-07-07 09:44:39 +03:00
ClaudioMartino 6a5884c04f New normalization in histogram comparison tutorial to use KV divergence
The Kullback-Leibler divergence works with histogram that have integral = 1,
otherwise it can return negative values. The normalization of the histograms
have been changed accordingly, and all the six comparison methods have been
used in the histogram comparison tutorial.
2025-07-07 08:43:16 +02:00
Kumataro 8d426718c6 js: remove deprecated DEMANGLE_SUPPORT option 2025-07-06 08:06:20 +09:00
eplankin c48dad1d9d Merge pull request #27324 from eplankin:warp_hal_4x
* Moved IPP impl of warpAffine to HAL
Co-authored-by: victorget <victor.getmanskiy@intel.com>
2025-07-04 12:04:31 +03:00
Alexander Smorkalov d5f1a5d9e8 Merge pull request #27509 from vrabaud:videoio
Include opencv2/videoio.hpp
2025-07-04 11:59:49 +03:00
Vincent Rabaud 2d60f3c63b Fix XMP write and discarded return value. 2025-07-03 16:34:23 +02:00
Vincent Rabaud 1cdb76c8e3 Include opencv2/videoio.hpp
In my configuration with bazel, when building the Java bindings,
it is not like building C++ and including videio/videoio.hpp
triggers:
error this is a compatibility header which should not be used inside the OpenCV library
2025-07-03 13:14:48 +02:00
Alexander Smorkalov d75323f8a5 Merge branch 'release_4.12.0' into 4.x 2025-07-02 15:46:12 +03:00
Alexander Smorkalov 49486f61fb release: OpenCV 4.12.0 2025-07-02 10:54:13 +03:00
Alexander Smorkalov 6b55ae0319 Merge pull request #27504 from asmorkalov:as/optional_gdal
Made some GDAL specific tests optional
2025-07-02 10:53:47 +03:00
Alexander Smorkalov 7a0d6559c3 Made some GDAL specific tests optional. 2025-07-02 10:07:13 +03:00
Vadim Pisarevsky 66e5fce928 Merge pull request #27499 from vpisarev:image_io_with_metadata
Extend image I/O API with metadata support #27499

Covered with the PR:
* AVIF encoder can write exif, xmp, icc
* AVIF decoder can read exif
* JPEG encoder can write exif
* JPEG decoder can read exif
* PNG encoder can write exif
* PNG decoder can read exif

This PR is a sort of preamble for #27488. I suggest to merge this one first to OpenCV 4.x, then promote this change to OpenCV 5.x and then provide extra API to read and write metadata in 5.x (or maybe 4.x) in a style similar to #27488. Maybe in that PR exif packing/unpacking should be done using a separate external API. That is, metadata reading and writing can/should be done in 2 steps:

 * [1] pack and then [2] embed exif into image at the encoding stage.
 * [1] extract and then [2] unpack exif at the decoding stage.

### 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-07-01 18:38:22 +03:00
Alexander Smorkalov 677c4ee42f Merge pull request #27492 from krikera:4.x
Add MORPH_DIAMOND support to samples and tutorials
2025-06-30 11:38:15 +03:00
Martin 43112409ef Merge pull request #26974 from klosteraner:Fix-IntersectConvexConvex
Issue 26972: Proper treatment of float values in intersectConvexConvex #26974

As outlined in https://github.com/opencv/opencv/issues/26972 the function `intersectConvexConvex()` may not work as expected in the corner case, where two polygons intersect at a corner. A concrete example is given that I added as unit test. The unit test would fail without the proposed bug fix. I recommend porting the fix to all versions.

Now concerning the fix: When digging into the implementation I found, that when the line intersections are computed, openCV currently does not apply floating point comparison syntax, but pretends that line end points are exact. Instead I replaced the formulation using the eps that is already used in another component of the function in line.277: `epx=1e-5`. IMO that is solid enough, definitely better than assuming an exact floating point comparison is possible.

As a follow up I would suggest to use a scalable eps, s.t. also cases with high floating point numbers would be less error prone. However that would need to be done in all relevant sub steps, not just the line intersection code. So for me outside the scope of this fix.



### 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-06-28 22:06:42 +03:00
krikera 27867cc72c Add MORPH_DIAMOND support to samples and tutorials 2025-06-27 21:09:53 +05:30
Alexander Smorkalov 5ee8919139 Merge pull request #27441 from KAVYANSHTYAGI:codex/find-feature-to-add-for-library
Add Support for Diamond-Shaped Structuring Element in Morphological Operations
2025-06-27 09:39:44 +03:00
Alexander Smorkalov 3ff2ce3291 Merge pull request #27486 from asmorkalov:as/qrcode_encode_java_ub_fix
Fixed out-of-bound access issue in QR Encoder Java warappers
2025-06-27 08:17:32 +03:00
Alexander Smorkalov 64ef095314 Merge pull request #27484 from xaos-cz:cygwin_filesystem_support
filesystem support under Cygwin
2025-06-26 17:38:41 +03:00
Alexander Smorkalov d9e2b4c650 Fixed out-of-bound access issue in QR Encoder Java warappers. 2025-06-26 17:19:10 +03:00
xaos-cz 611d69aae1 filesystem support under Cygwin
add support for enabling filesystem under Cygwin environment
2025-06-26 14:45:19 +02:00
Alexander Smorkalov d2d90dd1cd Merge pull request #26354 from onuralpszr:fix/kotlin-internal-error
fix(android): Kotlin 2.0 internal error for unsafe coercions
2025-06-26 12:08:44 +03:00
Alexander Smorkalov f6697558ce Merge pull request #27483 from valgur:patch-2
system.cpp: add missing #include <exception>
2025-06-26 10:03:27 +03:00
Alexander Smorkalov 856a497209 Merge pull request #27481 from opencv-pushbot:gitee/alalek/update_ffmpeg_4.x
ffmpeg/4.x: update FFmpeg wrapper 2025.06
2025-06-26 08:26:49 +03:00
Alexander Smorkalov 117801e136 Merge pull request #27482 from mshabunin:normalize-doc
doc: added note to normalize function
2025-06-26 08:23:37 +03:00
Martin Valgur 1d45a63598 system.cpp: add missing #include <exception> 2025-06-26 07:51:04 +03:00
Maksim Shabunin 029030095c doc: added note to normalize function 2025-06-25 20:48:14 +03:00
Alexander Alekhin 2e54a1f14f videoio(test): re-enable FFmpeg tests on WIN32
- PR26800
2025-06-25 17:38:03 +00:00
Alexander Alekhin 83309580f4 ffmpeg/4.x: update FFmpeg wrapper 2025.06 2025-06-25 17:29:26 +00:00
Alexander Smorkalov e9f1da7e8e Merge pull request #27463 from asmorkalov:as/new_atomics
Switch to standard C11 atomics on android and with nvcc.
2025-06-25 15:11:08 +03:00
Alexander Smorkalov c363303d0a Merge pull request #27480 from asmorkalov:as/haveImageReader_doc
Documentaion update for haveImageReader function
2025-06-25 15:10:41 +03:00
Alexander Smorkalov 42ec439d5a Documentaion update for haveImageReader function. 2025-06-25 13:34:49 +03:00
Alexander Smorkalov 5ee1a53d1e Merge pull request #27478 from asmorkalov:as/old_python_operators_eval
Fixed ifdef logic operators evaluation with some old python versions.
2025-06-25 12:29:42 +03:00
Alexander Smorkalov 359a005d82 Merge pull request #27477 from valgur:patch-1
imgcodecs: fix a minor bug in CMake for JPEG-XL
2025-06-25 11:41:04 +03:00
Alexander Smorkalov 288471f559 Fixed ifdef logic operators evaluation with some old python versions. 2025-06-25 10:35:53 +03:00
Alexander Smorkalov 91be7d3ce6 Merge pull request #24756 from fengyuentau:more_cann_operators
dnn cann: support more operators for SAM
2025-06-25 10:01:21 +03:00
Alexander Smorkalov a55eca9fb5 Merge pull request #27475 from s-trinh:update_calib3d_doc
Reduce the size of the checkerboard_radon.png image in the doc
2025-06-25 09:15:45 +03:00
fengyuentau 77d2a5868a feat: support more cann operators 2025-06-25 04:57:01 +00:00
Martin Valgur 0fac0e760f imgcodecs: fix a minor bug in CMake for JPEG-XL
Remove a likely copy-paste error.
2025-06-24 23:33:30 +03:00
Alexander Smorkalov e392b3843e Merge pull request #27476 from s-trinh:LSD_drawSegments_avoid_exception_empty_vec
Check for empty vector to avoid throwing an exception in LineSegmentDetectorImpl::drawSegments()
2025-06-24 12:22:47 +03:00
Souriya Trinh ba70d1104f Check for empty vector to avoid throwing an exception in LineSegmentDetectorImpl::drawSegments() function. 2025-06-24 04:58:54 +02:00
Souriya Trinh 7dfd1226ce Reduce the size of the checkerboard_radon.png image in the doc. Add references to the perspective camera model figure for solvePnP and related functions for better explanation. 2025-06-24 03:55:14 +02:00
Alexander Smorkalov 6ed29bdd39 Merge pull request #27472 from asmorkalov:as/norm_table_asan
Fixed out-of-bound access to function table in cv::norm for HORM_HAMING
2025-06-23 19:26:46 +03:00
Alexander Smorkalov a122f83374 Merge pull request #27470 from asmorkalov:as/phaseCorrelate_docs
phaseCorrelate documentation improvement
2025-06-23 16:51:59 +03:00
Alexander Smorkalov c3400603d0 Fixed out-of-bound access to function table in cv::norm for HORM_HAMING. 2025-06-23 15:42:23 +03:00
Suleyman TURKMEN 4629299163 Merge pull request #27469 from sturkmen72:png-fixes
Fix for 2 channel PNGs #27469

closes #26825

### 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-06-23 12:47:21 +03:00
Alexander Smorkalov 54fe519ae0 phaseCorrelate documentation imrpovement. 2025-06-23 12:28:09 +03:00
Suleyman TURKMEN afe5b226b4 Merge pull request #27113 from sturkmen72:spng-CV_16U
Fixing imread() function 16 bit reading png problem with libspng #27113

The purpose of the PR was to load bit-exact compatible results with libspng and libpng. To test this, `Imgcodecs_Png_PngSuite `was improved. Files containing gamma correction were moved to a separate test called `Imgcodecs_Png_PngSuite_Gamma `because the logic created for the other files did not apply to those with gamma correction. As a result, libspng now works in bit-exact compatibility with libpng. The code can be refactored later.

### 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
- [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-06-22 15:43:09 +03:00
cudawarped 1950c4dbb9 Merge pull request #27379 from cudawarped:fix_cuda_convertTo
cuda: Fix GpuMat::convertTo issues described in 27373 #27379

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

1. `GpuMat::convertTo` uses `convertToScale` due to incorrect overload.
2. There are no runtime checks to prevent the use of `CV_16U` data types in Release builds.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-06-21 16:32:31 +03:00
Alexander Smorkalov 2ffca501e7 Merge pull request #26824 from futurewasfree:fix-chAruco
Charuco detector: stop-gap measure for poor detection rate on tough perspective
2025-06-21 16:31:12 +03:00
Suleyman TURKMEN 850b686f8a Merge pull request #27127 from sturkmen72:apng_has_hidden_frame
Changes about when APNG has a hidden frame #27127

closes : #27074

### 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-06-21 10:22:10 +03:00
Alexander Smorkalov 89289ecaa5 Switch to standard C11 atomics on android and with nvcc. 2025-06-20 12:38:11 +03:00
Yuantao Feng 3259863924 Merge pull request #27368 from fengyuentau:4x/imgproc/CreateHanningWindow-simd
imgproc: vectorize cv::createHanningWindow #27368

### 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-06-20 12:00:37 +03:00
Alexander Smorkalov 7f4c89c7cc Merge pull request #27461 from fengyuentau:4x/hal/riscv-rvv/imgproc/disable_integral
hal/riscv-rvv: disable integral for now
2025-06-20 11:32:07 +03:00
xaos-cz f24f6b8d4e Merge pull request #27458 from xaos-cz:4.x
imread: GDAL multi-channel support #27458 

- tested on 30-channel FITS and 186-channel ENVI files

### 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-06-20 10:43:53 +03:00
Yuantao Feng 98ed06c339 fix: disable integral due to accuracy issue #27407 2025-06-20 15:09:21 +08:00
Suleyman TURKMEN 23d812187e Merge pull request #27457 from sturkmen72:WebP-bugfix
fix for the issue #27456 #27457 

closes #27456

### 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-19 21:49:21 +03:00
Alexander Smorkalov 9bb20c0174 Merge pull request #27459 from asmorkalov:update_version_4.12.0-pre
pre: OpenCV 4.12.0 (version++)
2025-06-19 15:38:56 +03:00
Sergei Nikiforov a4a253ea2b Charuco detector: stop-gap measure for poor detection rate on tough perspective
add checkMarkers flag to charucoParameters to control board verification
(post-detection)
2025-06-19 12:16:09 +02:00
Alexander Smorkalov 7cb7a6fd20 pre: OpenCV 4.12.0 (version++). 2025-06-19 11:03:59 +03:00
Alexander Smorkalov 972e135479 Merge pull request #26703 from MaximSmolskiy:fix-matchTemplate-with-mask-crash
Fix matchTemplate with mask crash
2025-06-19 10:15:33 +03:00
Dmitry Kurtaev 1c53fd3777 Merge pull request #24426 from dkurt:qrcode_eci_encoding
Consider QRCode ECI encoding #24426

### Pull Request Readiness Checklist

related: https://github.com/opencv/opencv/pull/24350#pullrequestreview-1661658421

1. Add `getEncoding` method to obtain ECI number
2. Add `detectAndDecodeBytes`, `decodeBytes`, `decodeBytesMulti`, `detectAndDecodeBytesMulti` methods in Python (return `bytes`) and Java (return `byte[]`)
3. Allow Python bytes to std::string conversion in general and add `encode(byte[] encoded_info, Mat qrcode)` in Java


    Python example with Kanji encoding:
    ```python
    img = cv.imread("test.png")
    detect = cv.QRCodeDetector()
    data, points, straight_qrcode = detect.detectAndDecodeBytes(img)
    print(data)
    print(detect.getEncoding(), cv.QRCodeEncoder_ECI_SHIFT_JIS)
    print(data.decode("shift-jis"))
    ```
    ```
    b'\x82\xb1\x82\xf1\x82\xc9\x82\xbf\x82\xcd\x90\xa2\x8aE'
    20 20
    こんにちは世界
    ```

    source: https://github.com/opencv/opencv/blob/ba4d6c859d21536f84e0328c16f4cc3e96bf3065/modules/objdetect/test/test_qrcode_encode.cpp#L332

    ![test](https://github.com/opencv/opencv/assets/25801568/0b5eefa8-918a-4c42-9acb-830f23c0ea9f)


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-06-19 10:12:15 +03:00
eplankin 210203090e Merge pull request #27454 from eplankin:norm
Added define disabling ippiNorm_Inf_16u_C1MR #27454

Workaround for #27380. Fix will be available in the next ICV package update based on IPP 2022.2.0.
2025-06-19 08:39:28 +03:00
leopardracer bbaed6f377 Merge pull request #27455 from leopardracer:4.x
Fix Typos in Comments and Documentation #27455

Description:
This pull request corrects minor typos in comments and documentation within the codebase:
- Replaces "representitive" with "representative" in kmeans.cpp.
- Replaces "indices" with the correct spelling in a comment in main.cu.
2025-06-18 15:28:25 +03:00
Manolis Lourakis d1b4b46dc6 Merge pull request #27437 from mlourakis:4.x
Fixed bugs in orthogonalization; simplified column vectors copying #27437

This PR mirrors to OpenCV a bug fix addressed by commit [a03d34b](https://github.com/terzakig/sqpnp/commit/a03d34b641ebba2986cf457cd910218cc8d3cc8c) in SQPnP

It also fixes bugs in the orthogonalization introduced during the porting to OpenCV  and simplifies column vectors copying, eliminating double loops.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-06-17 17:11:19 +03:00
Alexander Smorkalov 0755c512e7 Merge pull request #27450 from wuwuzhijing:fix-float-conversion-warning
Fix float-conversion warnings in FLANN by using float literals
2025-06-17 16:17:51 +03:00
sight 37a3eddd53 Fix float-conversion warnings in FLANN by using float literals 2025-06-17 09:59:44 +00:00
Alexander Smorkalov 30130cdc86 Merge pull request #27448 from maximevtush:4.x
Fix Typo in Function Docstring: "Forword" → "Forward" in person_reid.py
2025-06-16 13:50:01 +03:00
Maxim Evtush f09de671be Update person_reid.py 2025-06-16 12:09:29 +03:00
Alexander Smorkalov 40e3aee3d6 Merge pull request #27447 from asmorkalov:as/kleidicv_0.5
KleidiCV update to version 0.5
2025-06-16 11:59:58 +03:00
Alexander Smorkalov c0fdb1145e KleidiCV update to version 0.5 2025-06-16 09:55:08 +03:00
fuder.eth 664230091e Merge pull request #27444 from vtjl10:4.x
Fix Typos and Improve Clarity in Documentation #27444

Description:  
This pull request addresses minor typographical errors and improves the clarity of documentation in several markdown files. Specifically:
- Corrected spelling mistakes such as "traslation" to "translation".
- Improved phrasing for better readability and understanding.
- Added references to specific setter methods in the StereoBM documentation for more detailed guidance.

These changes are limited to documentation and do not affect any code functionality.
2025-06-16 09:28:07 +03:00
Rita Melo 439b6af379 feat: G-API: Custom stream sources in Python (#27276)
Implemented:

- A C++ proxy class PythonCustomStreamSource that implements the
  IStreamSource interface. This class acts as a bridge between
  G-API’s internal streaming engine and user-defined Python
  objects. Internally, it stores a reference to a Python object
  (PyObject*) and is responsible for: calling the Python object’s
  pull() method to retrieve the next frame, calling the descr_of()
  method to obtain the frame format description, acquiring and
  releasing the Python GIL as needed, converting the returned
  numpy.ndarray into cv::Mat, and handling any exceptions or
  conversion errors with proper diagnostics.

- A Python-facing factory function, cv.gapi.wip.make_py_src(),
  which takes a Python object as an argument and wraps it into a
  cv::Ptr<IStreamSource>. Internally, this function constructs a
  PythonCustomStreamSource instance and passes the Python object to
  it. This design allows Python users to define any class that
  implements two methods: pull() and descr_of(). No subclassing or
  special decorators are required on the Python side. The user
  simply needs to implement the expected interface.

Co-authored-by: Leonor Francisco <leonor.francisco@tecnico.ulisboa.pt>
2025-06-13 14:11:20 +01:00
Alexander Smorkalov 8ffcd60538 Merge pull request #27440 from kilavvy:4.x
Fix Typo in CMakeLists.txt Comment
2025-06-13 12:58:08 +03:00
kilavvy c5ef3948cf Update CMakeLists.txt 2025-06-12 17:03:07 +02: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
eplankin 287dad8102 Merge pull request #27354 from eplankin:ipp_update22.1
Update IPP integration #27354

Please merge together with https://github.com/opencv/opencv_3rdparty/pull/96
Supported IPP version was updated to IPP 2022.1.0 for Linux and Windows. Bugs in norm() function which caused failure of sanity check in performance tests were fixed, IPP calls were enabled.

Previous update: https://github.com/opencv/opencv/pull/26463
2025-06-12 15:23:49 +03:00
Dmitry Kurtaev d750d43aa2 Merge pull request #27432 from dkurt:d.kurtaev/ipp_distTransform
Correct IPP distanceTransform results with single thread #27432

### Pull Request Readiness Checklist

resolves #24082

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-06-11 17:37:18 +03:00
leopardracer b395a2e307 Merge pull request #27434 from leopardracer:4.x
Fix Typos in Comments and Error Messages Across Multiple Files #27434
 
Description:  
This pull request corrects several typographical errors in comments and error messages in the following files:
- `samples/directx/d3d11_interop.cpp`: Fixed typo in the error message ("betweem" → "between").
- `samples/dnn/yolo_detector.cpp`: Fixed typo in a comment ("elemets" → "elements").
- `samples/winrt/ImageManipulations/MediaExtensions/OcvTransform.cpp`: Fixed typo in a comment ("peferred" → "preferred").

These changes improve code readability and maintain consistency in documentation and error reporting. No functional code was modified.
2025-06-11 16:19:05 +03:00
Kavyansh Tyagi 452882c007 Add diamond structuring element 2025-06-11 15:54:29 +05:30
Aakash Preetam fcc76c120f Merge pull request #27430 from CodeLinaro:dsp_markdown
Document Qualcomm's FastCV DSP based OpenCV Extension APIs and usage instructions #27430

This PR updates the documentation by:

- Adding a new section: Qualcomm's FastCV DSP based OpenCV Extension APIs list, detailing the OpenCV APIs under the cv::fastcv::dsp namespace and their corresponding Qualcomm's FastCV DSP accelerated implementations.

- Providing a step-by-step guide on how to use the Qualcomm's FastCV DSP APIs.

- Update resizeDown and warpAffine mappings

### 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-06-11 09:23:34 +03:00
Alexander Smorkalov 85b45656fa Merge pull request #27428 from phanirithvij:dnn-cmake-protobuf-generate
Cmake protobuf_generate_cpp deprecated use protobuf_generate
2025-06-10 16:23:13 +03:00
phanirithvij bbe2f50b5d Cmake protobuf_generate_cpp deprecated use protobuf_generate
Signed-off-by: phanirithvij <phanirithvij2000@gmail.com>
2025-06-10 18:03:32 +05:30
FleeOvernight 6b4f5b48b1 Merge pull request #27419 from FleeOvernight:fixUpdCameraId
Fixed Android setCameraIndex issue. #27419

Fixed camera switching issue on Android devices: When a device has more than two cameras, the setCameraIndex method failed to switch to non-default cameras.

Root cause: The original code only considered two default camera IDs when updating camera IDs, ignoring all others. This fix ensures all camera IDs are properly handled.

### 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-06-10 15:02:39 +03:00
Dmitry Kurtaev 809090f203 Merge pull request #27421 from dkurt:dkurt-patch-1
Cover all seek directions in VideoCapture Java test #27421

### Pull Request Readiness Checklist

required for https://github.com/opencv/opencv/pull/27370

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-06-10 14:51:32 +03:00
Alexander Smorkalov 4b69cc53e6 Merge pull request #27422 from KAVYANSHTYAGI:codex/find-and-fix-major-repo-issue
Fix incorrect Y-coordinate sampling in drawing primitives (circle, text, ellipse)
2025-06-10 10:59:12 +03:00
Kavyansh Tyagi b13704b583 Fix coordinate generation in drawing sample 2025-06-09 23:43:34 +05:30
Kavyansh Tyagi 7ca36d9c50 Merge pull request #27408 from KAVYANSHTYAGI:Umat-vector-contructor
Deprecate copyData Parameter in UMat Construction from std::vector and Always Copy Data #27408

Overview

This PR simplifies and modernizes the construction of cv::UMat from std::vector by removing the legacy copyData parameter, always copying the data, and ensuring clearer, safer semantics. This brings UMat in line with current best practices and paves the way for the upcoming OpenCV 5.x series.

What Changed?

1. Header Documentation Update

    Removed confusing or obsolete documentation about copyData and clarified the behavior:

        Old: builds matrix from std::vector with or without copying the data

        New: builds matrix from std::vector. The data is always copied. The copyData parameter is deprecated and will be removed in OpenCV 5.0.

2. Implementation Update

    In UMat::UMat(const std::vector<_Tp>& vec, bool copyData), the copyData parameter:

        Is now ignored and marked as deprecated.

        Marked with CV_UNUSED(copyData) for backward compatibility and to avoid warnings.

    The constructor always copies the data from the input vector, regardless of the value of copyData.

    All branching logic around copyData has been removed. Any code for "not copying" was not implemented and is now dropped.

    This guarantees data safety and predictable behavior.

3. Test Added

    A new test construct_from_vector in test_umat_from_vector.cpp:

        Verifies that UMat copies the vector data, not referencing it.

        Modifies the source vector after construction to confirm that the UMat is unaffected (proving copy, not reference).

        Checks matrix shape, type, and content to ensure correctness.

Why This Change?

1. Safety and Predictability

    Always copying avoids dangling references and hard-to-debug lifetime issues with stack/heap-allocated vectors.

    Removes an undocumented, unimplemented branch (copyData=false).

2. Backward Compatibility

    The constructor signature remains for now, but the copyData parameter is marked as deprecated and ignored.

    Codebases that pass the parameter will still compile and run as before (but always copy).

3. API Clarity and Maintenance

    Documentation now matches the real implementation.

    No misleading expectations about zero-copy.

    Code is cleaner, future-proof, and easier to maintain.

4. Preparation for OpenCV 5.0

    The copyData parameter is deprecated and will be removed in OpenCV 5.x.

    Prepares users and downstream libraries for the planned change.



How This Helps OpenCV Users and Developers

    Guarantees data safety and makes behavior explicit.

    Removes legacy/ambiguous code.

    Provides a clear path to OpenCV 5.x.

    Minimizes future migration pain.

    Ensures all users see the same, reliable behavior (copy semantics).


Refer:#27409
2025-06-09 16:02:38 +03:00
Alexander Smorkalov ebfee90c30 Merge pull request #27414 from amane-ame:remap_fix
Fix RISC-V HAL Imgproc_WarpPerspective.accuracy
2025-06-09 10:35:30 +03:00
Francisco Mónica 62b36495cc Merge pull request #27153 from 03kiko:fix-videowriter-writing-colorless-images-26276
fix #26276: cv::VideoWriter fails writing colorless images #27153

When writing grayscale images (`isColor=false`), `cv::VideoWriter` failed as FFmpeg backend requires input frames to be in a grayscale format. Unlike other backends, FFmpeg doesn't perform this conversion internally and expects the input to be pre-converted. To fix this, I inserted a check in the `CvVideoWriter_FFMPEG_proxy::write` to convert input frames to grayscale when the input has more than 1 channel. If this is true, then the input is converted to a gray image using `cv::cvtColor` (with `cv::COLOR_BGR2GRAY`).
Additionally, as suggested in the issue comments, I have correctly propagated the return value of `CvVideoWriter_FFMPEG::writeFrame` back to the `CvVideoWriter_FFMPEG_proxy::write`. This return value wasn't being used, and `writeFrame` was always returning false since the FFmeg's return code `AVERROR(EAGAIN)` was mistakenly being treated as an error. Now it's handled as a signal for additional input (current input was successfully written, and a new frame should be sent. [See FFmpeg documentation for  `avcodec_receive_packet`](https://ffmpeg.org/doxygen/6.1/group__lavc__decoding.html)). A warning is displayed if  `CvVideoWriter_FFMPEG::writeFrame` returns false. Alternatively, this could be propagated back up to the user, making cv::VideoWriter::write a boolean.
Finally, I added a test case to verify if the grayscale conversion is being done correctly. 

Fixes #26276

### 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-09 10:05:02 +03:00
Dmitry Kurtaev d6864cdd22 Merge pull request #27418 from dkurt:fix_valgrind_warnings
Fix valgrind warnings in tests #27418

### Pull Request Readiness Checklist

https://pullrequest.opencv.org/buildbot/builders/4_x_valgrind-lin64-debug/builds/100131/steps/test_calib3d/logs/valgrind%20summary
https://pullrequest.opencv.org/buildbot/builders/4_x_valgrind-lin64-debug/builds/100131/steps/test_imgproc/logs/valgrind%20summary

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-06-09 09:23:04 +03:00
amane-ame b9cab7e4af Fix remap16s to pass Imgproc_WarpPerspective. 2025-06-08 15:09:37 +08:00
Aakash Preetam d97e926f70 Merge pull request #27403 from CodeLinaro:apreetam_6thPost
FastCV latest libs hash update #27403

Update hash for the fastcv libs for Linux

Updated libs PR: https://github.com/opencv/opencv_3rdparty/pull/97

### 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-06-06 12:27:13 +03:00
Alexander Smorkalov a503070e01 Merge pull request #27406 from asmorkalov:as/revert_android_ipp
Use older version of IPP for Android x86 32bit to resolve linkage issues
2025-06-06 10:54:13 +03:00
Alexander Smorkalov beeda17483 Merge pull request #27362 from vrabaud:tsan
Fix empty ND-array construction
2025-06-06 09:17:07 +03:00
Alexander Smorkalov 987548d041 Use older version of IPP for Android x86 32bit to resolve linkage issues. 2025-06-05 13:11:05 +03:00
Abhishek Gola aef6ae4872 Merge pull request #27396 from abhishek-gola:hdr_bug_fix
Fix NaNs in HDR Triangle Weights and Tonemapping and Update LDR Ground Truth in tutorial #27396

The PR closes #27392 

Updated the triangle weights to use a small epsilon value instead of zero to prevent NaN issues in HDR processing.
Also fixed a float-to-double division issue by explicitly casting double values to float, which was previously producing garbage values and leading to NaNs in tonemapping.

The current LDR ground truth image used in the tutorial [ldr.png](https://github.com/opencv/opencv/blob/4.x/doc/tutorials/others/images/ldr.png) was originally generated using TonemapDurand (check this commit https://github.com/opencv/opencv/commit/833f8d16fab5e57c5e800a55fa0fb08c7a31c3b1), which was moved to opencv_contrib a long time ago in this commit: https://github.com/opencv/opencv/commit/742f22c09bd0c27b450f141bc984f280c8cde98e. However, the current Tonemap implementation in OpenCV main only performs normalization and gamma correction, which produces noticeably different results. This PR updates the LDR grouth truth image in tutorial with the result of TonemapDrago, and tutorials to use TonemapDrago as Tonemap gives a darker image.

Tonemap output:
![ldr2](https://github.com/user-attachments/assets/e4f0cb97-ee4f-47b9-8962-2020ff211fd5)

TonemapDrago output:
![ldr](https://github.com/user-attachments/assets/4a898101-22bd-49e5-8db0-9e1062974ba3)


### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-06-05 09:02:58 +03:00
Alexander Smorkalov 9e18169959 Merge pull request #27355 from asmorkalov:as/gapi_control_msmf
Check MS Media Foundation availability in G-API too #27355

Tries to address https://github.com/opencv/opencv-python/issues/771

### 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-06-04 16:30:50 +03:00
Alexander Smorkalov a2c381a82b Merge pull request #27398 from asmorkalov:as/relax_remap_relative
Relax remap relative test to handle the case when HAL implements not all remap options
2025-06-04 16:29:21 +03:00
s-trinh e258f2595e Merge pull request #26299 from s-trinh:feat/getClosestEllipsePoints_2
Add getClosestEllipsePoints() function to get the closest point on an ellipse #26299

Following https://github.com/opencv/opencv/issues/26078, I was thinking that a function to get for a considered 2d point the corresponding closest point (or maybe directly the distance?) on an ellipse could be useful.
This would allow computing the fitting error with `fitEllipse()` for instance.

Code is based from:
- https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse/46007540#46007540
- https://blog.chatfield.io/simple-method-for-distance-to-ellipse/
- https://github.com/0xfaded/ellipse_demo

---

Demo code:

<details>
  <summary>code</summary>
 
```cpp
#include <iostream>
#include <opencv2/opencv.hpp>

namespace
{
void scaleApplyColormap(const cv::Mat &img_float, cv::Mat &img)
{
  cv::Mat img_scale = cv::Mat::zeros(img_float.size(), CV_8UC3);

  double min_val = 0, max_val = 0;
  cv::minMaxLoc(img_float, &min_val, &max_val);
  std::cout << "min_val=" << min_val << " ; max_val=" << max_val << std::endl;

  if (max_val - min_val > 1e-2) {
    float a = 255 / (max_val - min_val);
    float b = -a * min_val;

    cv::convertScaleAbs(img_float, img_scale, a, b);
    cv::applyColorMap(img_scale, img, cv::COLORMAP_TURBO);
  }
  else {
    std::cerr << "max_val - min_val <= 1e-2" << std::endl;
  }
}

cv::Mat drawEllipseDistanceMap(const cv::RotatedRect &ellipse_params)
{
  float bb_rect_w = ellipse_params.center.x + ellipse_params.size.width;
  float bb_rect_h = ellipse_params.center.y + ellipse_params.size.height;

  std::vector<cv::Point2f> points_list;
  points_list.resize(1);
  cv::Mat pointsf;
  cv::Mat closest_pts;
  cv::Mat dist_map = cv::Mat::zeros(bb_rect_h*1.5, bb_rect_w*1.5, CV_32F);
  for (int i = 0; i < dist_map.rows; i++) {
    for (int j = 0; j < dist_map.cols; j++) {
      points_list[0].x = j;
      points_list[0].y = i;
      cv::Mat(points_list).convertTo(pointsf, CV_32F);
      cv::getClosestEllipsePoints(ellipse_params, pointsf, closest_pts);
      dist_map.at<float>(i, j) = std::hypot(closest_pts.at<cv::Point2f>(0).x-j, closest_pts.at<cv::Point2f>(0).y-i);
    }
  }

  cv::Mat dist_map_8u;
  scaleApplyColormap(dist_map, dist_map_8u);
  return dist_map_8u;
}
}

int main()
{
  std::vector<cv::Point2f> points_list;

  // [1434, 308], [1434, 309], [1433, 310], [1427, 310], [1427, 312], [1426, 313], [1422, 313], [1422, 314],
  points_list.push_back(cv::Point2f(1434, 308));
  points_list.push_back(cv::Point2f(1434, 309));
  points_list.push_back(cv::Point2f(1433, 310));
  points_list.push_back(cv::Point2f(1427, 310));
  points_list.push_back(cv::Point2f(1427, 312));
  points_list.push_back(cv::Point2f(1426, 313));
  points_list.push_back(cv::Point2f(1422, 313));
  points_list.push_back(cv::Point2f(1422, 314));

  // [1421, 315], [1415, 315], [1415, 316], [1414, 317], [1408, 317], [1408, 319], [1407, 320], [1403, 320],
  points_list.push_back(cv::Point2f(1421, 315));
  points_list.push_back(cv::Point2f(1415, 315));
  points_list.push_back(cv::Point2f(1415, 316));
  points_list.push_back(cv::Point2f(1414, 317));
  points_list.push_back(cv::Point2f(1408, 317));
  points_list.push_back(cv::Point2f(1408, 319));
  points_list.push_back(cv::Point2f(1407, 320));
  points_list.push_back(cv::Point2f(1403, 320));

  // [1403, 321], [1402, 322], [1396, 322], [1396, 323], [1395, 324], [1389, 324], [1389, 326], [1388, 327],
  points_list.push_back(cv::Point2f(1403, 321));
  points_list.push_back(cv::Point2f(1402, 322));
  points_list.push_back(cv::Point2f(1396, 322));
  points_list.push_back(cv::Point2f(1396, 323));
  points_list.push_back(cv::Point2f(1395, 324));
  points_list.push_back(cv::Point2f(1389, 324));
  points_list.push_back(cv::Point2f(1389, 326));
  points_list.push_back(cv::Point2f(1388, 327));

  // [1382, 327], [1382, 328], [1381, 329], [1376, 329], [1376, 330], [1375, 331], [1369, 331], [1369, 333],
  points_list.push_back(cv::Point2f(1382, 327));
  points_list.push_back(cv::Point2f(1382, 328));
  points_list.push_back(cv::Point2f(1381, 329));
  points_list.push_back(cv::Point2f(1376, 329));
  points_list.push_back(cv::Point2f(1376, 330));
  points_list.push_back(cv::Point2f(1375, 331));
  points_list.push_back(cv::Point2f(1369, 331));
  points_list.push_back(cv::Point2f(1369, 333));

  // [1368, 334], [1362, 334], [1362, 335], [1361, 336], [1359, 336], [1359, 1016], [1365, 1016], [1366, 1017],
  points_list.push_back(cv::Point2f(1368, 334));
  points_list.push_back(cv::Point2f(1362, 334));
  points_list.push_back(cv::Point2f(1362, 335));
  points_list.push_back(cv::Point2f(1361, 336));
  points_list.push_back(cv::Point2f(1359, 336));
  points_list.push_back(cv::Point2f(1359, 1016));
  points_list.push_back(cv::Point2f(1365, 1016));
  points_list.push_back(cv::Point2f(1366, 1017));

  // [1366, 1019], [1430, 1019], [1430, 1017], [1431, 1016], [1440, 1016], [1440, 308]
  points_list.push_back(cv::Point2f(1366, 1019));
  points_list.push_back(cv::Point2f(1430, 1019));
  points_list.push_back(cv::Point2f(1430, 1017));
  points_list.push_back(cv::Point2f(1431, 1016));
  points_list.push_back(cv::Point2f(1440, 1016));
  points_list.push_back(cv::Point2f(1440, 308));

  cv::Mat pointsf;
  cv::Mat(points_list).convertTo(pointsf, CV_32F);

  cv::RotatedRect ellipse_params = cv::fitEllipseAMS(pointsf);
  std::cout << "ellipse_params, center=" << ellipse_params.center << " ; size=" << ellipse_params.size
    << " ; angle=" << ellipse_params.angle << std::endl;

  cv::TickMeter tm;
  tm.start();
  cv::Mat dist_map_8u = drawEllipseDistanceMap(ellipse_params);
  tm.stop();
  std::cout << "Elapsed time: " << tm.getAvgTimeSec() << " sec" << std::endl;

  cv::Point center(ellipse_params.center.x, ellipse_params.center.y);
  cv::Point axis(ellipse_params.size.width/2, ellipse_params.size.height/2);
  std::vector<cv::Point> ellipse_pts_list;
  cv::ellipse2Poly(center, axis, ellipse_params.angle, 0, 360, 1, ellipse_pts_list);
  cv::polylines(dist_map_8u, ellipse_pts_list, false, cv::Scalar(0, 0, 0), 3);

  // Points to be fitted
  cv::Mat closest_pts;
  cv::getClosestEllipsePoints(ellipse_params, pointsf, closest_pts);
  for (int i = 0; i < closest_pts.rows; i++) {
    cv::Point pt;
    pt.x = closest_pts.at<cv::Point2f>(i).x;
    pt.y = closest_pts.at<cv::Point2f>(i).y;
    cv::circle(dist_map_8u, pt, 8, cv::Scalar(0, 0, 255), 2);
  }

  cv::imwrite("dist_map_8u.png", dist_map_8u);

  return EXIT_SUCCESS;
}
```
</details>

![image](https://github.com/user-attachments/assets/3345cc86-ba83-44f9-ac78-74058a33a7dc)

---

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-06-03 17:12:16 +03:00
Alexander Smorkalov 0ccbd21c0a Relax remap relative test to handle the case when HAL implements not remap options. 2025-06-03 11:24:07 +03:00
Alexander Smorkalov 17d94277f0 Merge pull request #27393 from asmorkalov:as/elseif_hdr_parser
Fixed bug in ifdef state machine in header parser for bindings
2025-06-03 10:23:26 +03:00
Alexander Smorkalov 5205e26663 Fixed bug in ifdef state machine in header parser for bindings. 2025-06-02 12:41:39 +03:00
Kumataro cd0699a338 Merge pull request #27384 from Kumataro:fix27382
imgcodecs: jpegxl: support lossless compression #27384

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

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-06-02 11:23:38 +03:00
Vincent Rabaud 4033043488 Fix empty ND-array construction 2025-06-02 10:13:49 +02:00
Maxim Smolskiy e92cfb35f6 Merge pull request #27389 from MaximSmolskiy:add_HoughCirclesWithAccumulator_binding
Add HoughCirclesWithAccumulator binding #27389

### Pull Request Readiness Checklist

Fix #27377 

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-06-02 10:23:17 +03:00
Alexander Smorkalov a39f61b6e1 Merge pull request #27390 from MaximSmolskiy:update_HoughLinesWithAccumulator_binding
Update HoughLinesWithAccumulator binding
2025-06-02 09:41:33 +03:00
MaximSmolskiy e1f6e85c88 Update HoughLinesWithAccumulator binding 2025-06-01 19:19:21 +03:00
Alexander Smorkalov b3cb517cac Merge pull request #27385 from CodeLinaro:doc_update
Updating doc markdown to include API in FastCV gemm HAL
2025-05-30 15:24:15 +03:00
Liane Lin 8a0ea789e7 Merge pull request #27149 from liane-lin:4.x
Fix #25696: Solved the problem in Subdiv2D, empty delaunay triangulation #27149

Detailed description

Expected behaviour:
Given 4 points, where no three points are collinear, the Delaunay Triangulation Algorithm should return 2 triangles.

Actual:
The algorithm returns zero triangles in this particular case.

Fix:
The radius of the circumcircle tends to infinity when the points are closer to form collinear points, so the problem occurs because the super-triangles are not large enough,
which then results in certain edges are not swapped. The proposed solution just increases the super triangle, duplicating the value of constant for example.

### 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-05-30 15:20:01 +03:00
Aditi Sharma d26aa99a05 Updating doc markdown to include API in FastCV gemm HAL 2025-05-30 17:01:07 +05:30
Alexander Smorkalov 9f7793cdae Merge pull request #27375 from CodeLinaro:doc_update
Updating doc markdown to include newly added FastCV HAL and Extension…
2025-05-28 16:06:42 +03:00
Aditi Sharma 47d0bedeb2 Updating doc markdown to include newly added FastCV HAL and Extension APIs 2025-05-28 15:43:04 +05:30
Myron Rodrigues 344f8c6400 Merge pull request #27363 from MRo47:openvino-npu-support
Feature: Add OpenVINO NPU support #27363

## Why
- OpenVINO now supports inference on integrated NPU devices in intel's Core Ultra series processors.
- Sometimes as fast as GPU, but should use considerably less power.

## How
- The NPU plugin is now available as "NPU" in openvino `ov::Core::get_available_devices()`.
- Removed the guards and checks for NPU in available targets for Inference Engine backend.

## Test example

### Pre-requisites
- Intel [Core Ultra series processor](https://www.intel.com/content/www/us/en/products/details/processors/core-ultra/edge.html#tab-blade-1-0)
- [Intel NPU driver](https://github.com/intel/linux-npu-driver/releases)
- OpenVINO 2023.3.0+ (Tested on 2025.1.0)

### Example
```cpp
#include <opencv2/dnn.hpp>
#include <iostream>

int main(){
    cv::dnn::Net net = cv::dnn::readNet("../yolov8s-openvino/yolov8s.xml", "../yolov8s-openvino/yolov8s.bin");
    cv::Size net_input_shape = cv::Size(640, 480);
    std::cout << "Setting backend to DNN_BACKEND_INFERENCE_ENGINE and target to DNN_TARGET_NPU" << std::endl;
    net.setPreferableBackend(cv::dnn::DNN_BACKEND_INFERENCE_ENGINE);
    net.setPreferableTarget(cv::dnn::DNN_TARGET_NPU);

    cv::Mat image(net_input_shape, CV_8UC3);
    cv::randu(image, cv::Scalar(0, 0, 0), cv::Scalar(255, 255, 255));
    cv::Mat blob = cv::dnn::blobFromImage(
        image, 1, net_input_shape, cv::Scalar(0, 0, 0), true, false, CV_32F);
    net.setInput(blob);
    std::cout << "Running forward" << std::endl;
    cv::Mat result = net.forward();
    std::cout << "Output shape: " << result.size << std::endl; // Output shape: 1 x 84 x 6300
}
```

model files [here](https://limewire.com/d/bPgiA#BhUeSTBnMc)

docker image used to build opencv: [ghcr.io/mro47/opencv-builder](https://github.com/MRo47/opencv-builder/blob/main/Dockerfile)

Closes #26240

### 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-05-27 14:13:49 +03:00
Alexander Smorkalov a23baceb06 Merge pull request #27367 from CodeLinaro:xuezha_markdown
update building_fastcv.markdown
2025-05-27 14:10:36 +03:00
Xue Zhang 17f399f475 update building_fastcv.markdown 2025-05-27 13:34:29 +05:30
Alexander Smorkalov 575e3adc01 Merge pull request #27345 from asmorkalov:as/android_sdk_fastcv
Fixed FastCV linkage in OpenCV4AndroidSDK
2025-05-25 10:13:00 +03:00
Alexander Smorkalov 7578007d23 Merge pull request #27356 from asmorkalov:as/ipp_hal_copyright
Added default copyright header to IPP HAL
2025-05-24 18:54:27 +03:00
Alexander Smorkalov 0806124ac7 Try to add FastCV to OpenCV4AndroidSDK 2025-05-24 18:49:11 +03:00
Alexander Smorkalov b4944c9375 Added default copyright header to IPP HAL. 2025-05-24 16:57:49 +03:00
Alexander Smorkalov 0a5352ee27 Merge pull request #27346 from asmorkalov:as/ipp_hal_sum
New HAL entry for cv::sum and IPP adoption
2025-05-24 16:53:42 +03:00
Myron Rodrigues 374ad41420 Merge pull request #27353 from MRo47:fix/segfault-on-forward#27352
Fix #27352: Add checks before getting latest pin in Net::Impl::getLatestLayerPin() #27353 

### Pull Request Readiness Checklist

Fixes #27352 

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-05-24 10:07:45 +03:00
Maxim Smolskiy 023d14ecc4 Merge pull request #27347 from MaximSmolskiy:improve-solveCubic-accuracy
Improve solveCubic accuracy #27347

### Pull Request Readiness Checklist

Fix #27323 

```
2e-13 * x^3 + x^2 - 2 * x + 1 = 0 -> x^3 + 5e12 * x^2 - 1e13 * x + 5e12 = 0
```

The problem that coefficients have quite big magnitudes and current calculations are subject to round-off error

```
Q = (a1 * a1 - 3 * a2) * (1./9)
R = (2 * a1 * a1 * a1 - 9 * a1 * a2 + 27 * a3) * (1./54)
Qcubed = Q * Q * Q = a1^6/729 - (a1^4 a2)/81 + (a1^2 a2^2)/27 - a2^3/27
R * R = R^2 = a1^6/729 - (a1^4 a2)/81 + (a1^2 a2^2)/36 + (a1^3 a3)/27 - (a1 a2 a3)/6 + a3^2/4
d = Qcubed - R * R
```

Let `a1`, `a2`, `a3` have quite big same magnitudes, then we see that `Qcubed` and `R * R` have same terms `a1^6/729` and `-(a1^4 a2)/81` (which will be reduced in `d`), but they level out the other terms (these terms have `6`th and `5`th degree and other terms - less or equal than `4`th degree).
So, if these terms will participate in the calculation, this will lead to a huge round-off error.
But if we expand the expression, then round-off error should be less
```
d = Qcubed - R * R = 1/108 (a1^2 a2^2 - 4 a2^3 - 4 a1^3 a3 + 18 a1 a2 a3 - 27 a3^2)
```

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-05-24 09:56:48 +03:00
Alexander Smorkalov 388b6dd81f New HAL entry for cv::sum and IPP adoption. 2025-05-23 12:35:11 +03:00
Alexander Smorkalov b8099d3cc2 Merge pull request #27348 from fengyuentau:4x/hal/riscv_rvv/faster_div_f32
hal/riscv-rvv: further optimize div
2025-05-23 11:31:16 +03:00
Alexander Smorkalov 5a457842f1 Merge pull request #27351 from mshabunin:fix-intrin-legacy-ops-2
core: legacy intrin operators - fixed version warning condition
2025-05-23 07:50:39 +03:00
Maksim Shabunin e6fb6c290c core: legacy intrin operators - fixed version warning condition 2025-05-22 21:00:49 +03:00
Yuantao Feng 2c4eab0969 perf: speed up vfdiv by Newton-Raphson routine 2025-05-22 12:58:40 +08:00
Alexander Smorkalov aee828ac6e Merge pull request #27344 from asmorkalov:as/kleidicv_no_cv_namespace
Disabled cv namespace usage inside KleidiCV.
2025-05-21 16:13:48 +03:00
Yuantao Feng c37f54aeed Merge pull request #27343 from fengyuentau:4x/build/fix_more_warnings
build: fix more warnings from recent gcc versions after #27337 #27343

More fixings after https://github.com/opencv/opencv/pull/27337

### 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-05-21 16:12:09 +03:00
Alexander Smorkalov 7ecb1d8cab Disabled cv namespace usage inside KleidiCV. 2025-05-21 13:04:23 +03:00
omahs 0bc95d9256 Merge pull request #27338 from omahs:patch-1
Fix typos #27338

### 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-05-21 12:13:50 +03:00
Alexander Smorkalov dc610867e1 Merge pull request #27342 from MaximSmolskiy:fix-bug-in-solvePoly-test
Fix bug in solvePoly test
2025-05-21 11:19:01 +03:00
Alexander Smorkalov 5177c4a25a Merge pull request #27341 from dkurt:vit_ov_test
Higher threshold for ViT on OpenVINO
2025-05-21 11:00:52 +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
MaximSmolskiy d4c4493413 Fix bug in solvePoly test 2025-05-21 09:31:43 +03:00
Dmitry Kurtaev 3ff6c7f9fe Higher threshold for ViT on OpenVINO 2025-05-21 09:31:40 +03:00
Yuantao Feng 166f76d224 Merge pull request #27337 from fengyuentau:4x/build/riscv/fix_warnings
build: fix warnings from recent gcc versions #27337

This PR addresses the following found warnings:
- [x] -Wmaybe-uninitialized
- [x] -Wunused-variable
- [x] -Wsign-compare

Tested building with GCC 14.2 (RISC-V 64).

### 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-05-21 09:28:29 +03:00
Gursimar Singh c3fe92d813 Merge pull request #27270 from gursimarsingh:bug_fix_unstable_crf
Bug fix unstable crf #27270

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake

The PR resolves the issue for triangle Weights used by debevec algorithm being non zero at extremes. 
It resolves #24966 

The fix needs ground truth data to be changed in order to pass existing tests. PR to opencv_extra: https://github.com/opencv/opencv_extra/pull/1253
2025-05-21 08:40:11 +03:00
Maxim Smolskiy d00738d97c Merge pull request #27331 from MaximSmolskiy:add-test-for-solveCubic
Add tests for solveCubic #27331

### Pull Request Readiness Checklist

Related to #27323 

I found only randomized tests with number of roots always equal to `1` or `3`, `x^3 = 0` and some simple test for Java and Swift.
Obviously, they don't cover all cases (implementation has strong branching and number of roots can be equal to `-1`, `0` and `2` additionally).
So, I think it will be useful to try explicitly cover more cases (and implementation branches correspondingly)

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-05-21 08:36:35 +03:00
Alexander Smorkalov 79a5e5276a Merge pull request #27334 from fengyuentau:4x/imgproc/compareHist_chisqr_simd
imgproc: vectorize mode CHISQR and CHISQR_ALT in compareHist
2025-05-21 07:07:57 +03:00
Yuantao Feng 9b08167769 hal/imgproc: add hal for calcHist and implement in hal:riscv-rvv (#27332)
hal/imgproc: add hal for calcHist and implement in hal/riscv-rvv #27332

### 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-05-21 07:07:22 +03:00
Alexander Smorkalov 23f8e523a0 Merge pull request #27325 from VadimLevin/dev:vlevin/header-parser-conditional-inclusion-directives-handling
feat: add conditional inclusion support to header parser
2025-05-20 18:11:12 +03:00
Yuantao Feng 7fe8ce19d9 perf: vectorize mode CHISQR and CHISQR_ALT in compareHist 2025-05-19 17:09:33 +08:00
Dmitry Kurtaev 1e3ab44cff Merge pull request #27307 from dkurt:tflite_face_blendshape_model
TFLite fixes for Face Blendshapes V2 #27307

### Pull Request Readiness Checklist

* Scalars support
* Better handling of 1D tensors
* New ops import: SUB, SQRT, DIV, NEG, SQUARED_DIFFERENCE, SUM
* Number of NHWC<->NCHW layouts compatibility improvements

resolves #27211

**Merge with extra**: https://github.com/opencv/opencv_extra/pull/1257

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-05-19 10:45:18 +03:00
Vadim Levin b3e17ea9d4 feat: add conditional inclusion support to header parser 2025-05-19 10:11:52 +03:00
Alexander Smorkalov eae77dae86 Merge pull request #27327 from mshabunin:fix-intrin-legacy-ops
Restored legacy intrinsics operators in a separate header
2025-05-19 09:19:35 +03:00
Alexander Smorkalov 9d2d927fa9 Merge pull request #27326 from dkurt:handle_multi_output_eltwise_fusion
CUDA: Handle fusion of conv+eltwise in case of multi-output node (i.e. Split)
2025-05-19 09:12:38 +03:00
Madan mohan Manokar 84ea77a4be Merge pull request #27299 from amd:fast_medianblur_simd
imgproc: medianblur: Performance improvement #27299

* Bottleneck in non-vectorized path reduced.
* AVX512 dispatch added for medianblur.

### 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-05-19 08:56:57 +03:00
Maksim Shabunin a9b298eb47 Restored legacy intrinsics operators in a separate header 2025-05-17 16:44:07 +03:00
Dmitry Kurtaev fd5b33bb00 Handle fusion of conv+eltwise in case of multi-output node (i.e. Split) 2025-05-17 11:31:01 +03:00
chengolivia 250b5003ee Merge pull request #27305 from chengolivia:add-check-sgbm-nondeterminism
Add image dimension check to avoid StereoSGBM non-determinism #27305 
 
Addresses #25828 

Users noticed that StereoSGBM would occasionally give non-deterministic results for `.compute(imgL, imgR)`.

I and others traced the cause to out-of-bounds access that was not being caught when the input images were not wide enough for the input block size and number of disparities to StereoSGBM. The specific math and logic can be found in the above issue's discussion.

This PR adds a CV_Check to make sure images are wider than 1/2 of the block size + the max disparity the algorithm will search.

The check was only added to the regular `compute` method for StereoSGBM and not to the other modes, as I did not observe the non-deterministic behavior with the other compute modes like HH.

In addition, this PR adds a test case to Calib3d to make sure the check is being thrown in the problem case and that the results are deterministic in the good case.

### 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-05-17 10:19:09 +03:00
Vincent Rabaud 9201ca1af1 Merge pull request #27321 from vrabaud:norm
Make sure to not access outside normDiffTabMake sure to not access outside normDiffTab #27321 

If the norm is outside the array (e.g. Hamming), memory is read outside of the array, which does not matter because the invalid pointer is not used oustide of the function (e.g. the Hamming path is taken) but it triggers the sanitizer.

### 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-05-17 09:59:08 +03:00
Alexander Smorkalov f3cffcd85d Merge pull request #27322 from vrabaud:zeros
Add missing Mat_<_Tp>::zeros(int _ndims, const int* _sizes)
2025-05-17 09:55:05 +03:00
Alexander Smorkalov 1c421be489 Merge pull request #27288 from ruisv:ruisv-cuda1209-npp-patch-1
CUDA 12.9 support: build NppStreamContext manually
2025-05-16 12:20:55 +03:00
Alexander Smorkalov 80a8c97dd7 Merge pull request #27317 from asmorkalov:as/disable_ipp_x86_android
Disable IPP for x86 32bit Android as it's incompatible with modern NDK.
2025-05-16 12:16:16 +03:00
Vincent Rabaud 1a624efc0f Add missing Mat_<_Tp>::zeros(int _ndims, const int* _sizes) 2025-05-16 10:50:15 +02:00
Alexander Smorkalov 2af8d0317e Merge pull request #27311 from asmorkalov:as/draw_axes_warning
Added warning if projected axes are out of camera frame in drawAxes
2025-05-16 10:32:41 +03:00
Alexander Smorkalov 7e12c397d0 Disable IPP for x86 32bit Android as it's incompatible with modern NDK. 2025-05-16 08:34:28 +03:00
Yuantao Feng f016c728f5 Merge pull request #27315 from fengyuentau:4x/hal/riscv-rvv/refactor_functab_elemsize
python3 "/opencv/platforms/android/build_sdk.py" --build_doc --config "/opencv/platforms/android/default.config.py" --sdk_path "$ANDROID_HOME" --ndk_path "$ANDROID_NDK_HOME" /build | tee /build/build-log.txt

python3 "/opencv/platforms/android/build_java_shared_aar.py" --offline --ndk_location="$ANDROID_NDK_HOME" --cmake_location=$(dirname $(dirname $(which cmake))) /build/OpenCV-android-sdk

hal/riscv-rvv: make use of function tab in copyToMasked and CV_ELEM_SIZE1 in place of elem_size_tab #27315

### 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-05-15 09:57:05 +03:00
Alexander Smorkalov 8ceddbff68 Merge pull request #27314 from parona-source:fix-libspng-pkgconfig
cmake: set SPNG_LIBRARY for pkgconfig as well
2025-05-15 09:27:57 +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 5d3a9788eb Merge pull request #27309 from abhishek-gola:bilateral_filter_bug_fix
Fixed bilateral filter's sigma color and sigma space issue
2025-05-14 17:12:11 +03:00
Dmitry Kurtaev 67ba045e3b Merge pull request #27284 from dkurt:java_video_capture_read
Java VideoCapture buffered stream constructor #27284

### Pull Request Readiness Checklist

resolves #26809

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-05-14 17:01:45 +03:00
Alexander Smorkalov e1a74e6d1b Added warning if projected axes are out of camera frame in drawAxes function. 2025-05-14 15:34:51 +03:00
Yuantao Feng 547cef4e88 Merge pull request #27301 from fengyuentau:4x/hal/riscv_rvv/refactor_build
hal/riscv-rvv: refactor the building process #27301

Current hal/riscv-rvv is built with all headers without building an object. This slows down the compilation progress, especially when re-compiling for minor changes in those headers (~170 files need to be re-compiled). This patch solves the problem.

### 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-05-14 14:04:58 +03:00
Abhishek Gola 838babe351 Fixed bilateral filter's sigma color and sigma space issue 2025-05-14 14:22:05 +05:30
Alexander Smorkalov 868fc5c581 Merge pull request #27302 from asmorkalov:as/openjpeg_status
Cherry-pick OpenJPEG deconding status fix.
2025-05-13 10:34:36 +03:00
Alexander Smorkalov a39db41390 Cherry-pick OpenJPEG deconding status fix. 2025-05-13 08:56:14 +03:00
Alexander Smorkalov 90e7119ce0 Merge pull request #27293 from shirriff:patch-1
Update match_template.py to fix doc bug
2025-05-12 17:48:15 +03:00
Ken Shirriff d5a5b0e85f Update match_template.py to fix doc bug
shape has Y first, then X. See issue #27292
2025-05-12 17:06:24 +03:00
Alexander Smorkalov ce4c3f64e0 Merge pull request #27300 from asmorkalov:as/license_update
License update in CPack generated packages
2025-05-12 12:55:24 +03:00
Alexander Smorkalov 2364056aa3 License update in CPack generated packages. 2025-05-12 11:46:51 +03:00
Kumataro 3a69b11b6d Merge pull request #27297 from Kumataro:fix27295
imgcodecs: png: add log if first chunk is not IHDR #27297

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

To optimize for the native pixel format of the iPhone's early PowerVR GPUs, Apple implemented a non-standard PNG format.

Details: https://theapplewiki.com/wiki/PNG_CgBI_Format

### 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-05-12 10:44:54 +03:00
Alexander Smorkalov 8035aade11 Merge pull request #27296 from sturkmen72:bugfix-gif
Fix a bug on rendering some animated gif
2025-05-12 09:14:07 +03:00
Alexander Smorkalov 59a17bc41a Merge pull request #27287 from asmorkalov:as/hsv_init
Reworked HSV color conversion tables initialization for OpenCL branch
2025-05-12 09:09:04 +03:00
Alexander Smorkalov 11aefa2338 Merge pull request #27291 from asmorkalov:as/js_charuco_corners
Fixed std::vector<Point3f> handling in JS wrappers
2025-05-12 09:06:29 +03:00
Alexander Smorkalov 306204089f Reworked HSV color conversion tables initialization for OpenCL branch. 2025-05-12 09:02:47 +03:00
Suleyman TURKMEN 9d07c25175 Update grfmt_gif.cpp 2025-05-10 16:06:06 +03:00
Alexander Smorkalov 2f97718bc1 Fixed std::vector<Point3f> handling in JS wrappers. 2025-05-07 16:03:12 +03:00
ruisv 9ab3a249c2 remove private.cuda.hpp:158 space 2025-05-07 11:46:43 +08:00
ruisv 8a2903c190 CUDA 12.9 support: build NppStreamContext manually 2025-05-06 23:47:12 +08:00
Alexander Smorkalov 16a3d37dc1 Merge pull request #27282 from asmorkalov:as/qt_resize
Fixed QT window resize logic
2025-05-06 15:13:33 +03:00
Alexander Smorkalov 7d66431f8e Fixed QT window resize logic. 2025-05-05 14:52:15 +03:00
Alexander Smorkalov c248d47110 Merge pull request #27268 from Kumataro:fix27267
doc: hal: replace C++ operators with wrapper functions
2025-05-05 09:20:46 +03:00
Dmitry Kurtaev 0ea3c156a4 Merge pull request #27273 from dkurt:dnn_tflite_slice
* TFLite StridedSllice (without strides but just Slice)

* Enable strides for TF importers. Update OpenVINO backend for StridedSlice
2025-05-03 14:47:45 +03:00
Alexander Smorkalov 806eb4767c Merge pull request #27274 from opencv-pushbot:gitee/alalek/fix_26328
core(OCL): fix POWN OpenCL implementation
2025-05-03 14:44:39 +03:00
Alexander Alekhin 7a9ce585f0 core(ocl): fix POWN OpenCL implementation 2025-05-01 20:57:23 +00:00
Kumataro 37be2a2a68 doc: hal: replace C++ operators with wrapper functions 2025-04-30 05:40:16 +09:00
Alexander Smorkalov 4ad4bd5dc0 Merge pull request #27227 from s-trinh:improve_calib3d_doc_homogeneous_transformation
Add additional information about homogeneous transformations in the calib3d doc
2025-04-28 19:51:34 +03:00
Alexander Smorkalov 956f583b69 Merge pull request #27263 from fengyuentau:4x/hal_rvv/rotate
hal/riscv_rvv: implemented flip_inplace to boost cv::rotate
2025-04-28 11:03:23 +03:00
fengyuentau ab5a65b5a2 perf: implemented flip_inplace in hal_rvv to boost cv::rotate on RISC-V platforms 2025-04-28 14:18:48 +08:00
Alexander Smorkalov fe5bd15cdd Merge pull request #27260 from utibenkei:add_cv_wrap_to_dnn_registeroutput
Add CV_WRAP to registerOutput for language bindings support
2025-04-26 15:07:42 +03:00
Alexander Smorkalov c9a73061ca Merge pull request #27258 from asmorkalov:as/gif_on
Enable GIF support by default
2025-04-26 11:16:05 +03:00
Yuantao Feng 2fb786532a Merge pull request #27257 from fengyuentau:4x/hal_rvv/flip_opt
hal_rvv: further optimized flip #27257

Checklist:
- [x] flipX
- [x] flipY
- [x] flipXY

### 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-04-26 11:08:29 +03:00
utibenkei c774dd41cf Add CV_WRAP to registerOutput for language bindings support 2025-04-26 01:32:11 +09:00
Alexander Smorkalov 55a063f025 Enable GIF support by default. 2025-04-25 15:03:22 +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 9533c5633d Merge pull request #27255 from nina16448:houghcircles_fix
Update houghcircles.py
2025-04-25 11:58:51 +03:00
Kumataro 86a963cec9 Merge pull request #27226 from Kumataro:fix27225
imgproc: cvtColor: remove to copy edge pixels for COLOR_Bayer*_VNGs. #27226 

Close https://github.com/opencv/opencv/issues/27225
Close https://github.com/opencv/opencv/issues/5089
Related https://github.com/opencv/opencv_extra/pull/1249

### 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-04-25 11:29:22 +03:00
adsha-quic edccfa7961 Merge pull request #27184 from CodeLinaro:gemm_fastcv_hal
FastCV gemm hal #27184

FastCV hal for gemm 32f

### 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 11:07:26 +03:00
sirudoi 485c7d5be7 Merge pull request #27230 from sirudoi:4.x
videoio: add Orbbec Gemini 330 camera support #27230

### 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] The feature is well documented and sample code can be built with the project CMake

### Description of Changes
#### motivated:
- Orbbec has launched a new RGB-D camera — the Gemini 330. To fully leverage the capabilities of the Gemini 330, Orbbec simultaneously released version 2 of the open-source OrbbecSDK. This PR adapts the support for the Gemini 330 series cameras to better meet and respond to users’ application requirements.
#### change:
- Add support for the Orbbec Gemini330 camera.
- Fixed an issue with Femto Mega on Windows 10/11; for details, see [issue](https://github.com/opencv/opencv/pull/23237#issuecomment-2242347295).
- When enabling `HAVE_OBSENSOR_ORBBEC_SDK`, the build now fetches version 2 of the OrbbecSDK, and the sample API calls have been updated to the v2 format.

### Testing
|     OS     |                Compiler                 |      Camera       | Result |
|:----------:|:---------------------------------------:|:-----------------:|:------:|
| Windows 11 | (VS2022) MSVC runtime library version 14.40       | Gemini 335/336L   | Pass   |
| Windows 11 | (VS2022) MSVC runtime library version 14.19       | Gemini 335/336L   | Pass   |
| Ubuntu22.04| GCC 11.4                               | Gemini 335/336L   | Pass   |
| Ubuntu18.04| GCC 7.5                                | Gemini 335/336L   | Pass   |

### Acknowledgements
Thank you to the OpenCV team for the continuous support and for creating such a robust open source project. I appreciate the valuable feedback from the community and reviewers, which has helped improve the quality of this contribution!
2025-04-25 11:04:19 +03:00
nina16448 6f8f846288 Update houghcircles.py 2025-04-25 15:39:50 +08:00
Alexander Smorkalov 829495355d Merge pull request #27253 from asmorkalov:as/kleidicv_release_check
Added KleidiCV check for Android SDK release builds
2025-04-24 09:47:14 +03:00
Alexander Smorkalov 9241e0a9f6 Added KleidiCV check for Android SDK release builds. 2025-04-24 07:30:16 +03:00
Yuantao Feng 325e59bd4c Merge pull request #27229 from fengyuentau:4x/hal_rvv/transpose
HAL: implemented cv_hal_transpose in hal_rvv #27229

Checklists:

- [x] transpose2d_8u
- [x] transpose2d_16u
- [ ] ~transpose2d_8uC3~
- [x] transpose2d_32s
- [ ] ~transpose2d_16uC3~
- [x] transpose2d_32sC2
- [ ] ~transpose_32sC3~
- [ ] ~transpose_32sC4~
- [ ] ~transpose_32sC6~
- [ ] ~transpose_32sC8~
- [ ] ~inplace transpose~


### 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-04-22 11:03:26 +03:00
Alexander Smorkalov cd5a636459 Merge pull request #27249 from fengyuentau:4x/hal_rvv/bugfix-norm2-int
HAL: aligned behavior of normDiff 32s kernels in hal_rvv in 4.x
2025-04-22 10:54:04 +03:00
fengyuentau a7749c3813 aligned behavior in normDiff in hal_rvv for 4.x 2025-04-22 14:44:42 +08:00
Skreg e37819c2ac Merge pull request #27221 from shyama7004:docChanges
Minor changes in calib3d docs for clarity #27221

### 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-04-21 21:15:37 +03:00
Alexander Smorkalov 29ef2a1da3 Merge pull request #27245 from utibenkei:fix_java_wrapper_get_set_blobColor
Enable Java bindings for SimpleBlobDetector::blobColor
2025-04-21 20:53:35 +03:00
utibenkei 97f73ba0b5 Merge pull request #27228 from utibenkei:fix_java_enum_wrapper
Explicitly specify enum type scopes to improve Java wrapper generation #27228 

Changed DataLayout and ImagePaddingMode to dnn::DataLayout and dnn::ImagePaddingMode to explicitly specify their scopes. This allows gen_java.py to correctly register  disc_type, preventing constructors and methods using these enum types from being skipped during Java wrapper generation.

Similarly updated QRCodeEncoder::CorrectionLevel and QRCodeEncoder::EncodeMode with explicit scope declarations.

Also added a new Java test class `DnnBlobFromImageWithParamsTest` based on: https://github.com/opencv/opencv/blob/4.x/modules/dnn/test/test_misc.cpp#L133-L243

Related issues
#23753 

### 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-04-21 20:51:38 +03:00
Adrian Kretz a08b1b6566 Merge pull request #27244 from akretz:fix_issue_27183
Fix QR code encoder with autoversion #27244

The autodetected version is not honored in the `QRCodeEncoderImpl::encode*` methods. This fixes #27183

### 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-04-21 17:40:33 +03:00
Ivan Avdeev a8a3b93043 Merge pull request #27239 from avdivan:4.x
Android-SDK: check flag IPP package #27239

### 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-21 17:33:14 +03:00
Alexander Smorkalov 0bea67f57b Merge pull request #27224 from fengyuentau:4x/hal_rvv/compare
HAL: implemented cv_hal_cmp* in hal_rvv
2025-04-21 15:48:31 +03:00
fengyuentau 8eb9d27a31 implemented cv_hal_cmp* in hal_rvv 2025-04-21 18:09:57 +08:00
YooLc f20facc60a Merge pull request #27060 from YooLc:hal-rvv-integral
[hal_rvv] Add cv::integral implementation and more types of input for test #27060

This patch introduces an RVV-optimized implementation of `cv::integral()` in hal_rvv, along with performance and accuracy tests for all valid input/output type combinations specified in `modules/imgproc/src/hal_replacement.hpp`:
https://github.com/opencv/opencv/blob/2a8d4b8e43f6e499c5553edd26056caed284d5a6/modules/imgproc/src/hal_replacement.hpp#L960-L974

The vectorized prefix sum algorithm follows the approach described in [Prefix Sum with SIMD - Algorithmica](https://en.algorithmica.org/hpc/algorithms/prefix/).

I intentionally omitted support for the following cases by returning `CV_HAL_ERROR_NOT_IMPLEMENTED`, as they are harder to implement or show limited performance gains:
1. **Tilted Sum**: The data access pattern for tilted sums requires multi-row operations, making effective vectorization difficult.
2. **3-channel images (`cn == 3`)**: Current implementation requires `VLEN/SEW` (a.k.a. number of elements in a vector register) to be a multiple of channel count, which 3-channel formats typically cannot satisfy.
    - Support for 1, 2 and 4 channel images is implemented
4. **Small images (`!(width >> 8 || height >> 8)`)**: The scalar implementation demonstrates better performance for images with limited dimensions. 
    - This is the same as `3rdparty/ndsrvp/src/integral.cpp` https://github.com/opencv/opencv/blob/09c71aed141210bf2b14582974ed9d231c24edd5/3rdparty/ndsrvp/src/integral.cpp#L24-L26

Test configuration:

- Platform: SpacemiT Muse Pi (K1 @ 1.60 Ghz)
- Toolchain: GCC 14.2.0
- `integral_sqsum_full` test is disabled by default, so `--gtest_also_run_disabled_tests` is needed

Test results:

```plaintext
Geometric mean (ms)

                                     Name of Test                                       imgproc-gcc-scalar imgproc-gcc-hal  imgproc-gcc-hal  
                                                                                                                                   vs        
                                                                                                                           imgproc-gcc-scalar
                                                                                                                               (x-factor)      
integral::Size_MatType_OutMatDepth::(640x480, 8UC1, CV_32F)                                   1.973             1.415             1.39       
integral::Size_MatType_OutMatDepth::(640x480, 8UC1, CV_32S)                                   1.343             1.351             0.99       
integral::Size_MatType_OutMatDepth::(640x480, 8UC1, CV_64F)                                   2.021             2.756             0.73       
integral::Size_MatType_OutMatDepth::(640x480, 8UC2, CV_32F)                                   4.695             2.874             1.63       
integral::Size_MatType_OutMatDepth::(640x480, 8UC2, CV_32S)                                   4.028             2.801             1.44       
integral::Size_MatType_OutMatDepth::(640x480, 8UC2, CV_64F)                                   5.965             4.926             1.21       
integral::Size_MatType_OutMatDepth::(640x480, 8UC4, CV_32F)                                   9.970             4.440             2.25       
integral::Size_MatType_OutMatDepth::(640x480, 8UC4, CV_32S)                                   7.934             4.244             1.87       
integral::Size_MatType_OutMatDepth::(640x480, 8UC4, CV_64F)                                   14.696            8.431             1.74       
integral::Size_MatType_OutMatDepth::(1280x720, 8UC1, CV_32F)                                  5.949             4.108             1.45       
integral::Size_MatType_OutMatDepth::(1280x720, 8UC1, CV_32S)                                  4.064             4.080             1.00       
integral::Size_MatType_OutMatDepth::(1280x720, 8UC1, CV_64F)                                  6.137             7.975             0.77       
integral::Size_MatType_OutMatDepth::(1280x720, 8UC2, CV_32F)                                  13.896            8.721             1.59       
integral::Size_MatType_OutMatDepth::(1280x720, 8UC2, CV_32S)                                  10.948            8.513             1.29       
integral::Size_MatType_OutMatDepth::(1280x720, 8UC2, CV_64F)                                  18.046           15.234             1.18       
integral::Size_MatType_OutMatDepth::(1280x720, 8UC4, CV_32F)                                  35.105           13.778             2.55       
integral::Size_MatType_OutMatDepth::(1280x720, 8UC4, CV_32S)                                  27.135           13.417             2.02       
integral::Size_MatType_OutMatDepth::(1280x720, 8UC4, CV_64F)                                  43.477           25.616             1.70       
integral::Size_MatType_OutMatDepth::(1920x1080, 8UC1, CV_32F)                                 13.386            9.281             1.44       
integral::Size_MatType_OutMatDepth::(1920x1080, 8UC1, CV_32S)                                 9.159             9.194             1.00       
integral::Size_MatType_OutMatDepth::(1920x1080, 8UC1, CV_64F)                                 13.776           17.836             0.77       
integral::Size_MatType_OutMatDepth::(1920x1080, 8UC2, CV_32F)                                 31.943           19.435             1.64       
integral::Size_MatType_OutMatDepth::(1920x1080, 8UC2, CV_32S)                                 24.747           18.946             1.31       
integral::Size_MatType_OutMatDepth::(1920x1080, 8UC2, CV_64F)                                 35.925           33.943             1.06       
integral::Size_MatType_OutMatDepth::(1920x1080, 8UC4, CV_32F)                                 66.493           29.692             2.24       
integral::Size_MatType_OutMatDepth::(1920x1080, 8UC4, CV_32S)                                 54.737           28.250             1.94       
integral::Size_MatType_OutMatDepth::(1920x1080, 8UC4, CV_64F)                                 91.880           57.495             1.60            
integral_sqsum::Size_MatType_OutMatDepth::(640x480, 8UC1, CV_32F)                             4.384             4.016             1.09       
integral_sqsum::Size_MatType_OutMatDepth::(640x480, 8UC1, CV_32S)                             3.676             3.960             0.93       
integral_sqsum::Size_MatType_OutMatDepth::(640x480, 8UC1, CV_64F)                             5.620             5.224             1.08       
integral_sqsum::Size_MatType_OutMatDepth::(640x480, 8UC2, CV_32F)                             9.971             7.696             1.30       
integral_sqsum::Size_MatType_OutMatDepth::(640x480, 8UC2, CV_32S)                             8.934             7.632             1.17       
integral_sqsum::Size_MatType_OutMatDepth::(640x480, 8UC2, CV_64F)                             9.927             9.759             1.02       
integral_sqsum::Size_MatType_OutMatDepth::(640x480, 8UC4, CV_32F)                             21.556           12.288             1.75       
integral_sqsum::Size_MatType_OutMatDepth::(640x480, 8UC4, CV_32S)                             21.261           12.089             1.76       
integral_sqsum::Size_MatType_OutMatDepth::(640x480, 8UC4, CV_64F)                             23.989           16.278             1.47       
integral_sqsum::Size_MatType_OutMatDepth::(1280x720, 8UC1, CV_32F)                            15.232           11.752             1.30       
integral_sqsum::Size_MatType_OutMatDepth::(1280x720, 8UC1, CV_32S)                            12.976           11.721             1.11       
integral_sqsum::Size_MatType_OutMatDepth::(1280x720, 8UC1, CV_64F)                            16.450           15.627             1.05       
integral_sqsum::Size_MatType_OutMatDepth::(1280x720, 8UC2, CV_32F)                            25.932           23.243             1.12       
integral_sqsum::Size_MatType_OutMatDepth::(1280x720, 8UC2, CV_32S)                            24.750           23.019             1.08       
integral_sqsum::Size_MatType_OutMatDepth::(1280x720, 8UC2, CV_64F)                            28.228           29.605             0.95       
integral_sqsum::Size_MatType_OutMatDepth::(1280x720, 8UC4, CV_32F)                            61.665           37.477             1.65       
integral_sqsum::Size_MatType_OutMatDepth::(1280x720, 8UC4, CV_32S)                            61.536           37.126             1.66       
integral_sqsum::Size_MatType_OutMatDepth::(1280x720, 8UC4, CV_64F)                            73.989           48.994             1.51       
integral_sqsum::Size_MatType_OutMatDepth::(1920x1080, 8UC1, CV_32F)                           49.640           26.529             1.87       
integral_sqsum::Size_MatType_OutMatDepth::(1920x1080, 8UC1, CV_32S)                           35.869           26.417             1.36       
integral_sqsum::Size_MatType_OutMatDepth::(1920x1080, 8UC1, CV_64F)                           34.378           35.056             0.98       
integral_sqsum::Size_MatType_OutMatDepth::(1920x1080, 8UC2, CV_32F)                           82.138           52.661             1.56       
integral_sqsum::Size_MatType_OutMatDepth::(1920x1080, 8UC2, CV_32S)                           54.644           52.089             1.05       
integral_sqsum::Size_MatType_OutMatDepth::(1920x1080, 8UC2, CV_64F)                           75.073           66.670             1.13       
integral_sqsum::Size_MatType_OutMatDepth::(1920x1080, 8UC4, CV_32F)                          143.283           83.943             1.71       
integral_sqsum::Size_MatType_OutMatDepth::(1920x1080, 8UC4, CV_32S)                          156.851           82.378             1.90       
integral_sqsum::Size_MatType_OutMatDepth::(1920x1080, 8UC4, CV_64F)                          521.594           111.375            4.68            
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC1, DEPTH_32F_32F))          3.529             2.787             1.27       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC1, DEPTH_32F_64F))          4.396             3.998             1.10       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC1, DEPTH_32S_32F))          3.229             2.774             1.16       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC1, DEPTH_32S_32S))          2.945             2.780             1.06       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC1, DEPTH_32S_64F))          3.857             3.995             0.97       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC1, DEPTH_64F_64F))          5.872             5.228             1.12       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (16UC1, DEPTH_64F_64F))         6.075             5.277             1.15       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (16SC1, DEPTH_64F_64F))         5.680             5.296             1.07       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (32FC1, DEPTH_32F_32F))         3.355             2.896             1.16       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (32FC1, DEPTH_32F_64F))         4.183             4.000             1.05       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (32FC1, DEPTH_64F_64F))         6.237             5.143             1.21       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (64FC1, DEPTH_64F_64F))         4.753             4.783             0.99       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC2, DEPTH_32F_32F))          8.021             5.793             1.38       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC2, DEPTH_32F_64F))          9.963             7.704             1.29       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC2, DEPTH_32S_32F))          7.864             5.720             1.37       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC2, DEPTH_32S_32S))          7.141             5.699             1.25       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC2, DEPTH_32S_64F))          9.228             7.646             1.21       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC2, DEPTH_64F_64F))          9.940             9.759             1.02       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (16UC2, DEPTH_64F_64F))         10.606            9.716             1.09       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (16SC2, DEPTH_64F_64F))         9.933             9.751             1.02       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (32FC2, DEPTH_32F_32F))         7.986             5.962             1.34       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (32FC2, DEPTH_32F_64F))         9.243             7.598             1.22       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (32FC2, DEPTH_64F_64F))         10.573            9.425             1.12       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (64FC2, DEPTH_64F_64F))         11.029            8.977             1.23       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC4, DEPTH_32F_32F))          17.236            8.881             1.94       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC4, DEPTH_32F_64F))          20.905           12.322             1.70       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC4, DEPTH_32S_32F))          16.011            8.666             1.85       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC4, DEPTH_32S_32S))          15.932            8.507             1.87       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC4, DEPTH_32S_64F))          20.713           12.115             1.71       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (8UC4, DEPTH_64F_64F))          23.953           16.284             1.47       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (16UC4, DEPTH_64F_64F))         25.127           16.341             1.54       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (16SC4, DEPTH_64F_64F))         24.950           16.441             1.52       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (32FC4, DEPTH_32F_32F))         17.261            8.906             1.94       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (32FC4, DEPTH_32F_64F))         21.944           12.073             1.82       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (32FC4, DEPTH_64F_64F))         25.921           15.539             1.67       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(640x480, (64FC4, DEPTH_64F_64F))         27.938           14.824             1.88       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC1, DEPTH_32F_32F))         11.156            8.260             1.35       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC1, DEPTH_32F_64F))         14.777           11.869             1.24       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC1, DEPTH_32S_32F))         9.693             8.221             1.18       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC1, DEPTH_32S_32S))         9.023             8.256             1.09       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC1, DEPTH_32S_64F))         13.276           11.821             1.12       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC1, DEPTH_64F_64F))         15.406           15.618             0.99       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (16UC1, DEPTH_64F_64F))        16.799           15.749             1.07       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (16SC1, DEPTH_64F_64F))        15.054           15.806             0.95       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (32FC1, DEPTH_32F_32F))        10.055            7.999             1.26       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (32FC1, DEPTH_32F_64F))        13.506           11.253             1.20       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (32FC1, DEPTH_64F_64F))        14.952           15.021             1.00       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (64FC1, DEPTH_64F_64F))        13.761           14.002             0.98       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC2, DEPTH_32F_32F))         22.677           17.330             1.31       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC2, DEPTH_32F_64F))         26.283           23.237             1.13       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC2, DEPTH_32S_32F))         20.126           17.118             1.18       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC2, DEPTH_32S_32S))         19.337           17.041             1.13       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC2, DEPTH_32S_64F))         24.973           23.004             1.09       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC2, DEPTH_64F_64F))         29.959           29.585             1.01       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (16UC2, DEPTH_64F_64F))        33.598           29.599             1.14       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (16SC2, DEPTH_64F_64F))        46.213           29.741             1.55       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (32FC2, DEPTH_32F_32F))        33.077           17.556             1.88       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (32FC2, DEPTH_32F_64F))        33.960           22.991             1.48       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (32FC2, DEPTH_64F_64F))        41.792           28.803             1.45       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (64FC2, DEPTH_64F_64F))        34.660           28.532             1.21       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC4, DEPTH_32F_32F))         52.989           27.659             1.92       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC4, DEPTH_32F_64F))         62.418           37.515             1.66       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC4, DEPTH_32S_32F))         50.902           27.310             1.86       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC4, DEPTH_32S_32S))         47.301           27.019             1.75       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC4, DEPTH_32S_64F))         61.982           37.140             1.67       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (8UC4, DEPTH_64F_64F))         79.403           49.041             1.62       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (16UC4, DEPTH_64F_64F))        86.550           49.180             1.76       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (16SC4, DEPTH_64F_64F))        85.715           49.468             1.73       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (32FC4, DEPTH_32F_32F))        63.932           28.019             2.28       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (32FC4, DEPTH_32F_64F))        68.180           36.858             1.85       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (32FC4, DEPTH_64F_64F))        83.063           46.483             1.79       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1280x720, (64FC4, DEPTH_64F_64F))        91.990           44.545             2.07       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC1, DEPTH_32F_32F))        25.503           18.609             1.37       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC1, DEPTH_32F_64F))        29.544           26.635             1.11       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC1, DEPTH_32S_32F))        22.581           18.514             1.22       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC1, DEPTH_32S_32S))        20.860           18.547             1.12       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC1, DEPTH_32S_64F))        26.046           26.373             0.99       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC1, DEPTH_64F_64F))        34.831           34.997             1.00       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (16UC1, DEPTH_64F_64F))       36.428           35.214             1.03       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (16SC1, DEPTH_64F_64F))       32.435           35.314             0.92       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (32FC1, DEPTH_32F_32F))       22.548           18.845             1.20       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (32FC1, DEPTH_32F_64F))       28.589           25.790             1.11       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (32FC1, DEPTH_64F_64F))       32.625           33.791             0.97       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (64FC1, DEPTH_64F_64F))       30.158           31.889             0.95       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC2, DEPTH_32F_32F))        53.374           38.938             1.37       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC2, DEPTH_32F_64F))        73.892           52.747             1.40       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC2, DEPTH_32S_32F))        47.392           38.572             1.23       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC2, DEPTH_32S_32S))        45.638           38.225             1.19       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC2, DEPTH_32S_64F))        69.966           52.156             1.34       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC2, DEPTH_64F_64F))        68.560           66.963             1.02       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (16UC2, DEPTH_64F_64F))       71.487           65.420             1.09       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (16SC2, DEPTH_64F_64F))       68.127           65.718             1.04       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (32FC2, DEPTH_32F_32F))       72.967           39.987             1.82       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (32FC2, DEPTH_32F_64F))       63.933           51.408             1.24       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (32FC2, DEPTH_64F_64F))       73.334           63.354             1.16       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (64FC2, DEPTH_64F_64F))       80.983           60.778             1.33       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC4, DEPTH_32F_32F))       116.981           59.908             1.95       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC4, DEPTH_32F_64F))       155.085           83.974             1.85       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC4, DEPTH_32S_32F))       109.567           58.525             1.87       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC4, DEPTH_32S_32S))       105.457           57.124             1.85       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC4, DEPTH_32S_64F))       157.325           82.485             1.91       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (8UC4, DEPTH_64F_64F))       265.776           111.577            2.38       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (16UC4, DEPTH_64F_64F))      585.218           110.583            5.29       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (16SC4, DEPTH_64F_64F))      585.418           111.302            5.26       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (32FC4, DEPTH_32F_32F))      126.456           60.415             2.09       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (32FC4, DEPTH_32F_64F))      169.278           81.460             2.08       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (32FC4, DEPTH_64F_64F))      281.256           104.732            2.69       
integral_sqsum_full::Size_MatType_OutMatDepthArray::(1920x1080, (64FC4, DEPTH_64F_64F))      620.885           99.953             6.21       
```

The vectorized implementation shows progressively better acceleration for larger image sizes and higher channel counts, achieving up to 6.21× speedup for 64FC4 (1920×1080) inputs with `DEPTH_64F_64F` configuration.

This is my first time proposing patch for the OpenCV Project 🥹, if there's anything that can be improved, please tell me.

### 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
- [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-04-21 09:50:13 +03:00
Yuantao Feng 11e46cda86 Merge pull request #27201 from fengyuentau:4x/hal_rvv/dotprod
HAL: implemented cv_hal_dotProduct in hal_rvv #27201

### 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-04-21 09:05:52 +03:00
utibenkei d42b6f438e Enable Java bindings for SimpleBlobDetector::blobColor
The C++ uchar type is properly mapped to Java byte type.
2025-04-20 15:57:41 +09:00
quic-xuezha b5d38ea4cb Merge pull request #27217 from CodeLinaro:gaussianBlur_hal_fix
Optimize gaussian blur performance in FastCV HAL #27217

### 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-17 09:56:58 +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
adsha-quic 6ffc515b2a Merge pull request #27182 from CodeLinaro:boxFilter_hal_changes
Parallel_for in box Filter and support for 32f box filter in Fastcv hal #27182

Added parallel_for in box filter hal and support for 32f box filter

### 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-16 18:33:38 +03:00
Alexander Smorkalov 3962803e7a Merge pull request #27216 from CodeLinaro:xuezha_3rdPost
Add SVD into FastCV HAL
2025-04-16 17:48:36 +03:00
Alexander Smorkalov 5170f56a1e Merge pull request #27234 from asmorkalov:fastcv_lib_hash_update
CMake tuning after FastCV binaries update
2025-04-16 17:23:28 +03:00
Alexander Smorkalov 250ea3d7c6 Fixed Android build with FastCV. 2025-04-16 16:26:05 +03:00
adsha-quic ba6eb8d952 Merge pull request #27214 from CodeLinaro:fastcv_lib_hash_update
Adding latest FastCV static libs
updated libs PR: [opencv/opencv_3rdparty/pull/94](https://github.com/opencv/opencv_3rdparty/pull/94)


### 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-16 16:24:40 +03:00
Alexander Smorkalov 050dfab749 Merge pull request #27218 from gfrankliu:tbb-lib-upgrade
upgrade tbb to version 2022.1.0
2025-04-16 15:29:09 +03:00
Souriya Trinh 7f7be9bab0 Add additional information about homogeneous transformations. Add quick formulas for conversions between physical focal length, sensor size, fov and camera intrinsic params. 2025-04-13 22:28:11 +02:00
Alexander Smorkalov 6ef5746391 Merge pull request #27194 from asmorkalov:as/ipp_transpose
Migrated IPP impl for flip and transpose to HAL
2025-04-10 21:04:46 +03:00
Kumataro c1d71d5375 Merge pull request #27220 from Kumataro:fix24757
imgproc: disable SIMD for compareHist(INTERSECT) if f64 is unsupported #27220

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

### 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-04-10 17:24:01 +03:00
Frank Liu 70ab545b90 upgrade tbb to version 2022.1.0
upgrade tbb from version 2021.11.0 to 2022.1.0 to fix https://github.com/opencv/opencv/issues/25187
2025-04-09 22:57:08 -07:00
Alexander Smorkalov fa7a0c1e12 Migrated IPP impl for flip and transpose to HAL. 2025-04-10 08:51:12 +03:00
Xue Zhang 0d092c7b1e Add SVD into HAL 2025-04-10 10:51:25 +05:30
Alexander Smorkalov db9df33d33 Merge pull request #27213 from asmorkalov:as/ipp_cart_polar
Transfer IPP polarToCart to HAL
2025-04-10 07:48:42 +03:00
Alexander Smorkalov 78662ac085 Transfer IPP polarToCart to HAL. 2025-04-09 19:13:18 +03:00
Alexander Smorkalov 09a85e97aa Merge pull request #27196 from FurkanTahaSaranda:patch-1
Update js_houghcircles_HoughCirclesP.html
2025-04-08 09:10:39 +03:00
Alexander Smorkalov e826a41eeb Merge pull request #27202 from asmorkalov:as/drop_ipp_lut
Dropped inefficient (disabled) IPP integration for LUT.
2025-04-08 09:07:52 +03:00
Alexander Smorkalov e148a2c4aa Merge pull request #27203 from asmorkalov:as/drop_dead_ipp_convertTo
Drop commented out convertTo impl with IPP.
2025-04-08 09:07:13 +03:00
Alexander Smorkalov 8f74086d3f Drop commented out convertTo impl with IPP. 2025-04-07 14:18:37 +03:00
Alexander Smorkalov 91e078be93 Dropped inefficient (disabled) IPP integration for LUT. 2025-04-07 14:11:13 +03:00
Yuantao Feng 1b3db545a3 Merge pull request #27145 from fengyuentau:4x/core/copyMask-simd
core: further vectorize copyTo with mask #27145

Merge with https://github.com/opencv/opencv_extra/pull/1247.

### 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-04-07 10:56:02 +03:00
Yuantao Feng 81859255ca Merge pull request #27175 from fengyuentau:4x/hal_rvv/div_recip
HAL: implemented cv_hal_div* and cv_hal_recip* in hal_rvv #27175

### 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-04-07 10:36:19 +03:00
FurkanTahaSaranda 55a4a713fd Update js_houghcircles_HoughCirclesP.html 2025-04-04 17:36:42 +03:00
Alexander Smorkalov 0b3155980a Merge pull request #25394 from Gao-HaoYuan:in_place_convertTo
Added reinterpret() method to Mat to convert meta-data without actual data conversion
2025-04-04 10:40:33 +03:00
Alexander Smorkalov d49dee83bf Merge pull request #27193 from mshabunin:fix-v4l-size
videoio: fixed V4L frame size for non-BGR output
2025-04-03 09:49:36 +03:00
Maksim Shabunin 3f9ed93da2 videoio: fixed V4L frame size for non-BGR output 2025-04-03 07:09:52 +03:00
Dan Dennedy cb8030809e Fix configuring with CMake version 4
fixes #27122
2025-04-02 13:45:08 -07:00
Maxim Smolskiy c8e88d8984 Merge pull request #27185 from MaximSmolskiy:specify_dls_and_upnp_mappings_to_epnp_in_all_places_for_solvepnp_tests
Specify DLS and UPnP mappings to EPnP in all places for solvePnP* tests #27185

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-04-02 21:21:56 +03:00
Alexander Smorkalov 8b4b382fa4 Merge pull request #27029 from mshabunin:fix-openblas
build: fix OpenBLAS detection on Linux
2025-04-01 08:13:48 +03: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
Kumataro 1f468dd586 Merge pull request #27169 from Kumataro:fix27168
Imgcodec: gif: remove unnecessary warning #27169

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

### 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-03-31 11:01:22 +03:00
Yuantao Feng ec1cbe294a Merge pull request #27162 from fengyuentau:4x/hal_rvv/copyMask
HAL: added copyToMask and implemented in hal_rvv #27162

### 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-03-31 10:49:37 +03:00
sujal 8c7288676e Merge pull request #26682 from 5usu:4.x
Adding AddRgbFeature(), and improving robustness in ComputeRgbDistance().

### 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-03-31 09:47:34 +03:00
Alexander Smorkalov 9d34a88597 Merge pull request #27174 from MaximSmolskiy:more_elegant_skipping_SOLVEPNP_IPPE_methods_in_non_planar-accuracy-tests-for_solvePnP
More elegant skipping SOLVEPNP_IPPE* methods in non-planar accuracy tests for solvePnP*
2025-03-31 09:09:35 +03:00
Alexander Smorkalov d0c5a04ddb Merge pull request #27170 from Osse:qt-fix-closing-window
Fix closing of windows when using the Qt backend
2025-03-31 08:58:23 +03:00
天音あめ 14e1f6ce96 Merge pull request #27160 from amane-ame:resize_hal_rvv
Add RISC-V HAL implementation for cv::resize #27160

This patch implements `cv_hal_resize` using native intrinsics, optimizing the performance of `cv::resize` for `CV_INTER_NEAREST/CV_INTER_NEAREST_EXACT/CV_INTER_LINEAR/CV_INTER_LINEAR_EXACT/CV_INTER_AREA` modes.

Tested on MUSE-PI (Spacemit X60) for both gcc 14.2 and clang 20.1.

```
$ ./opencv_test_imgproc --gtest_filter="*Resize*:*resize*"
$ ./opencv_perf_imgproc --gtest_filter="*Resize*:*resize*" --perf_min_samples=300 --perf_force_samples=300
```

View the full perf table here: [hal_rvv_resize.pdf](https://github.com/user-attachments/files/19480756/hal_rvv_resize.pdf)

### 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-31 08:19:18 +03:00
MaximSmolskiy 289884adc5 More elegant skipping SOLVEPNP_IPPE* methods in non-planar accuracy tests for solvePnP* 2025-03-30 17:00:11 +03:00
Ryan Wong afc7c0a89c Merge pull request #27154 from kinchungwong:logging_callback_simple_c
User-defined logger callback, C-style. #27154

This is a competing PR, an alternative to #27140 

Both functions accept C-style pointer to static functions. Both functions allow restoring the OpenCV built-in implementation by passing in a nullptr.
- replaceWriteLogMessage
- replaceWriteLogMessageEx

This implementation is not compatible with C++ log handler objects.

This implementation has minimal thread safety, in the sense that the function pointer are stored and read atomically. But otherwise, the user-defined static functions must accept calls at all times, even after having been deregistered, because some log calls may have started before deregistering.

### 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-30 16:17:07 +03:00
Alexander Smorkalov 767407e711 Merge pull request #27164 from cudawarped:cmake_add_comment_for_cmp0104
cuda:: Add comment describing code around enable_language(CUDA) in CMakeLists.txt
2025-03-30 13:36:29 +03:00
Øystein Walle 6b4ef1dccd Fix closing of windows when using the Qt backend
Notify the main GUI thread upon receiving a close event instead of when
the windows is destroyed. Additionally there was a logic error in in
GuiReceiver::isLastWindow() that is corrected.

Fixes #6479 and #20822
2025-03-28 14:59:15 +01:00
cudawarped 3d5ab56a68 Add comment for CMake 3.18+: if CMAKE_CUDA_ARCHITECTURES is empty enable_language(CUDA) sets it to the default architecture chosen by the compiler, to trigger the OpenCV custom CUDA architecture search an empty value needs to be respected see https://github.com/opencv/opencv/pull/25941. 2025-03-27 16:40:01 +02:00
Vincent Rabaud 42a132088c Merge pull request #27138 from vrabaud:lzw
Fix heap buffer overflow and use after free in imgcodecs #27138

This fixes:
- https://g-issues.oss-fuzz.com/issues/405243132
- https://g-issues.oss-fuzz.com/issues/405456349

### 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-03-26 17:14:50 +03:00
Alexander Smorkalov 8e2826ddd6 Merge pull request #27142 from asmorkalov:as/cuda_standard_all
Set C++ standard for all CUDA configurations
2025-03-26 08:53:16 +03:00
Alexander Smorkalov 9a1f71c14b Merge pull request #27148 from Kumataro:fix27129
doc: js: unwrap promise-typed cv object
2025-03-26 08:50:53 +03:00
Kumataro 8948faa394 doc: unwrap promise-typed cv object 2025-03-25 23:16:19 +09:00
Alexander Smorkalov 68a595d88b Set C++ standard for all CUDA configurations. 2025-03-25 16:47:12 +03:00
Alexander Smorkalov c72c527bfe Merge pull request #27144 from asmorkalov:as/fix_doc_stereobm
Fixed JavaDoc generation for StereoBM.
2025-03-25 16:36:33 +03:00
Alexander Smorkalov ae443a904b Fixed JavaDoc generation for StereoBM. 2025-03-25 12:33:58 +03:00
天音あめ fa58c1205b Merge pull request #27119 from amane-ame:warp_hal_rvv
Add RISC-V HAL implementation for cv::warp series #27119

This patch implements `cv_hal_remap`, `cv_hal_warpAffine` and `cv_hal_warpPerspective` using native intrinsics, optimizing the performance of `cv::remap/cv::warpAffine/cv::warpPerspective` for `CV_HAL_INTER_NEAREST/CV_HAL_INTER_LINEAR/CV_HAL_INTER_CUBIC/CV_HAL_INTER_LANCZOS4` modes.

Tested on MUSE-PI (Spacemit X60) for both gcc 14.2 and clang 20.0.

```
$ ./opencv_test_imgproc --gtest_filter="*Remap*:*Warp*"
$ ./opencv_perf_imgproc --gtest_filter="*Remap*:*remap*:*Warp*" --perf_min_samples=200 --perf_force_samples=200
```

View the full perf table here: [hal_rvv_warp.pdf](https://github.com/user-attachments/files/19403718/hal_rvv_warp.pdf)

### 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-25 11:57:47 +03:00
Gianluca Nordio 931af518d9 Merge pull request #27139 from GianlucaNordio:patch-4
Fix minAreaRect and boxPoints docs (#26799) #27139

As requested from issue #26799 the docs regarding minAreaRect and boxPoints are extended specifying the order of the corners for boxPoints and the way the angle is computed for the rotated rect returned by minAreaRect
2025-03-25 09:30:56 +03:00
Yuantao Feng a2a2f37ebb Merge pull request #27115 from fengyuentau:4x/hal_rvv/normDiff
core: refactored normDiff in hal_rvv and extended with support of more data types #27115 

Merge wtih https://github.com/opencv/opencv_extra/pull/1246.

### 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-03-25 07:59:59 +03:00
Alexander Smorkalov 7d87f3cda6 Merge pull request #27132 from MaximSmolskiy:add_planar_accuracy_tests_for_solvePnPRansac
Add planar accuracy tests for solvePnPRansac
2025-03-24 10:46:08 +03:00
Alexander Smorkalov 4f4767cb9c Merge pull request #27125 from asmorkalov:as/ipp_minmax
Move IPP minMaxIdx to HAL
2025-03-24 10:33:32 +03:00
Alexander Smorkalov bc5545c3e6 Merge pull request #27133 from shyama7004:fix-ptp
minor changes : Replace ndarray.ptp() with np.ptp() for NumPy 2.0 Compatibility
2025-03-24 10:11:44 +03:00
Alexander Smorkalov d6966f82a3 Merge pull request #27130 from Ma-gi-cian:add-stereobm-docs
Add documentation for StereoBM parameters (fixes #26816)
2025-03-24 09:31:03 +03:00
Alexander Smorkalov a77623a32b Move IPP minMaxIdx to HAL. 2025-03-24 09:21:22 +03:00
Alexander Smorkalov 0944f7ad26 Merge pull request #27128 from asmorkalov:as/ipp_norm
Move IPP norm and normDiff to HAL #27128

Continues https://github.com/opencv/opencv/pull/26880

### 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-24 09:17:22 +03:00
shyama7004 ef474e06fc minor changes : Replace ndarray.ptp() with np.ptp() for NumPy 2.0 Compatibility 2025-03-23 23:38:33 +05:30
MaximSmolskiy 5db60e1621 Add planar accuracy tests for solvePnPRansac 2025-03-23 18:24:10 +03:00
Aditya Jha 64535757df Add documentation for StereoBM parameters (fixes #26816) 2025-03-23 13:18:17 +05:30
Onuralp SEZER ce1398882d fix(android): Kotlin 2.0 internal error for unsafe coercions
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2025-03-22 18:34:26 +03:00
Alexander Smorkalov 01ef38dcad Merge pull request #26880 from asmorkalov:as/ipp_hal
Initial version of IPP-based HAL for x86 and x86_64 platforms #26880

### 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-22 09:31:42 +03:00
Alexander Smorkalov 8566930922 Merge pull request #27114 from CyberWarrior5466:4.x
Update old URL
2025-03-21 15:23:54 +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
Alexander Smorkalov afc4a9ac51 Merge pull request #25027 from opencv-pushbot:gitee/alalek/tests_filter_debug
video(test): filter very long debug tests
2025-03-21 10:22:17 +03:00
天音あめ 46bd22abad Fix RISC-V HAL solve:SVD and BGRtoLab (#27046)
Fix RISC-V HAL solve/SVD and BGRtoLab #27046

Closes #27044.

Also suppressed some warnings in other HAL.

### 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 10:18:51 +03:00
Ali Saleem 4e488a0b16 Update old URL 2025-03-20 19:45:58 +00:00
Scorpion1234567 2e9345570f Merge pull request #27108 from Scorpion1234567:Multithreading-wrapPolar
When WARP_INVERSE_MAP is used, accelerate the calculation with multi-threading #27108

### 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-20 17:46:18 +03:00
Vincent Rabaud c10b800837 Merge pull request #27081 from vrabaud:lzw
GIF: Make sure to resize lzwExtraTable before each block #27081

This fixes https://g-issues.oss-fuzz.com/issues/403364362

### 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-03-20 17:31:47 +03:00
Alexander Smorkalov 41e3fcc73e Merge pull request #27087 from sturkmen72:apng_CV_16U
Fixing imread() function 16 bit APNG reading problem
2025-03-20 17:29:45 +03:00
天音あめ ec5f7bb9f1 Merge pull request #27097 from amane-ame:blur_hal_rvv
Add RISC-V HAL implementation for cv::blur series #27097

This patch implements `cv_hal_gaussianBlurBinomial`, `cv_hal_medianBlur`, `cv_hal_boxFilter` and `cv_hal_bilateralFilter` using native intrinsics, optimizing the performance of `cv::GaussianBlur/cv::medianBlur/cv::boxFilter/cv::bilateralFilter` for `3x3/5x5` kernels.

Tested on MUSE-PI (Spacemit X60) for both gcc 14.2 and clang 20.0.

```
$ ./opencv_test_imgproc --gtest_filter="*Filter*:*Blur*"
$ ./opencv_perf_imgproc --gtest_filter="*gauss*:*box*:*Bilateral*:*median*" --perf_min_samples=2000 --perf_force_samples=2000
```

View the full perf table here: [hal_rvv_blur.pdf](https://github.com/user-attachments/files/19335582/hal_rvv_blur.pdf)

### 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-20 12:59:59 +03:00
Alexander Smorkalov 50072f8d4f Merge pull request #27089 from amane-ame:hist_hal_rvv
Add RISC-V HAL implementation for cv::equalizeHist
2025-03-20 12:21:00 +03:00
天音あめ 46fbe1895a Merge pull request #27096 from amane-ame:moments_hal_rvv
Add RISC-V HAL implementation for cv::moments #27096

This patch implements `cv_hal_imageMoments` using native intrinsics, optimizing the performance of `cv::moments` for data types `CV_16U/CV_16S/CV_32F/CV_64F`.

Tested on MUSE-PI (Spacemit X60) for both gcc 14.2 and clang 20.0.

```
$ ./opencv_test_imgproc --gtest_filter="*Moments*"
$ ./opencv_perf_imgproc --gtest_filter="*Moments*" --perf_min_samples=1000 --perf_force_samples=1000
```

![image](https://github.com/user-attachments/assets/0efbae10-c022-4f15-a81c-682514cdb372)

### 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-20 10:50:06 +03:00
Alexander Smorkalov 67ffb230f1 Merge pull request #27104 from JavaTypedScript:fix#27092
fixed typo
2025-03-20 08:59:02 +03:00
Suleyman TURKMEN 0ed5556cee Add a test to check whether cv::imread successfully reads 16-bit APNG images.
Make proper fixes to pass the test
2025-03-19 21:08:01 +03:00
JavaTypedScript 259ec3674d fixed typo 2025-03-19 21:38:08 +05:30
Kumataro 3e43d0cfca Merge pull request #26971 from Kumataro:fix26970
imgcodecs: gif: support animated gif without loop #26971

Close #26970

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-03-19 14:24:08 +03:00
amane-ame b902a8e792 Add equalize_hist.
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
2025-03-18 15:53:05 +08:00
Yuantao Feng 8207549638 Merge pull request #26991 from fengyuentau:4x/core/norm2hal_rvv
core: improve norm of hal rvv #26991

Merge with https://github.com/opencv/opencv_extra/pull/1241

### 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
- [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-03-18 09:42:55 +03:00
天音あめ 0142231e4d Merge pull request #27072 from amane-ame:thresh_hal_rvv
Add RISC-V HAL implementation for cv::threshold and cv::adaptiveThreshold #27072

This patch implements `cv_hal_threshold_otsu` and `cv_hal_adaptiveThreshold` using native intrinsics, optimizing the performance of `cv::threshold(THRESH_OTSU)` and `cv::adaptiveThreshold`.

Since UI is as fast as HAL `cv_hal_rvv::threshold::threshold` so `cv_hal_threshold` is not redirected, but this part of HAL is keeped because `cv_hal_threshold_otsu` depends on it.

Tested on MUSE-PI (Spacemit X60) for both gcc 14.2 and clang 20.0.

```
$ ./opencv_test_imgproc --gtest_filter="*thresh*:*Thresh*"
$ ./opencv_perf_imgproc --gtest_filter="*otsu*:*adaptiveThreshold*" --perf_min_samples=1000 --perf_force_samples=1000
```

![image](https://github.com/user-attachments/assets/4bb953f8-8589-4af1-8f1c-99e2c506be3c)

### 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-18 09:24:00 +03:00
iiiuhuy 855f20fdfe Merge pull request #27082 from iiiuhuy:fix_bug
displayOverlay doesn't disappear after timeout #27082

Fixes #26555

### Expected Behaviour
An overlay should be displayed atop an image and then disappear after `delayms` has timed out, but it doesn't. Also, `displayStatusBar` doesn't appear to set any text on the window.

### Actual Behaviour
The overlay appears but doesn't disappear unless a mouse move event happens on the image.

### Changes
- Fixed the issue with `displayOverlay` not disappearing after the timeout.

### 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.
- [ ] There is accuracy test, performance test, and test data in the opencv_extra repository, if applicable.
- [ ] The feature is well documented, and sample code can be built with the project CMake.
2025-03-17 19:36:06 +03:00
GenshinImpactStarts 2090407002 Merge pull request #26999 from GenshinImpactStarts:polar_to_cart
[HAL RVV] unify and impl polar_to_cart | add perf test #26999

### Summary

1. Implement through the existing `cv_hal_polarToCart32f` and `cv_hal_polarToCart64f` interfaces.
2. Add `polarToCart` performance tests
3. Make `cv::polarToCart` use CALL_HAL in the same way as `cv::cartToPolar`
4. To achieve the 3rd point, the original implementation was moved, and some modifications were made.

Tested through:
```sh
opencv_test_core --gtest_filter="*PolarToCart*:*Core_CartPolar_reverse*" 
opencv_perf_core --gtest_filter="*PolarToCart*" --perf_min_samples=300 --perf_force_samples=300
```

### HAL performance test

***UPDATE***: Current implementation is no more depending on vlen.

**NOTE**: Due to the 4th point in the summary above, the `scalar` and `ui` test is based on the modified code of this PR. The impact of this patch on `scalar` and `ui` is evaluated in the next section, `Effect of Point 4`.

Vlen 256 (Muse Pi):
```
                   Name of Test                     scalar    ui     rvv       ui        rvv    
                                                                               vs         vs    
                                                                             scalar     scalar  
                                                                           (x-factor) (x-factor)
PolarToCart::PolarToCartFixture::(127x61, 32FC1)     0.315  0.110  0.034     2.85       9.34   
PolarToCart::PolarToCartFixture::(127x61, 64FC1)     0.423  0.163  0.045     2.59       9.34   
PolarToCart::PolarToCartFixture::(640x480, 32FC1)   13.695  4.325  1.278     3.17      10.71   
PolarToCart::PolarToCartFixture::(640x480, 64FC1)   17.719  7.118  2.105     2.49       8.42   
PolarToCart::PolarToCartFixture::(1280x720, 32FC1)  40.678  13.114 3.977     3.10      10.23   
PolarToCart::PolarToCartFixture::(1280x720, 64FC1)  53.124  21.298 6.519     2.49       8.15   
PolarToCart::PolarToCartFixture::(1920x1080, 32FC1) 95.158  29.465 8.894     3.23      10.70   
PolarToCart::PolarToCartFixture::(1920x1080, 64FC1) 119.262 47.743 14.129    2.50       8.44   
```

### Effect of Point 4

To make `cv::polarToCart` behave the same as `cv::cartToPolar`, the implementation detail of the former has been moved to the latter's location (from `mathfuncs.cpp` to `mathfuncs_core.simd.hpp`).

#### Reason for Changes:

This function works as follows:  
$y = \text{mag} \times \sin(\text{angle})$ and $x = \text{mag} \times \cos(\text{angle})$. The original implementation first calculates the values of $\sin$ and $\cos$, storing the results in the output buffers $x$ and $y$, and then multiplies the result by $\text{mag}$. 

However, when the function is used as an in-place operation (one of the output buffers is also an input buffer), the original implementation allocates an extra buffer to store the $\sin$ and $\cos$ values in case the $\text{mag}$ value gets overwritten. This extra buffer allocation prevents `cv::polarToCart` from functioning in the same way as `cv::cartToPolar`.

Therefore, the multiplication is now performed immediately without storing intermediate values. Since the original implementation also had AVX2 optimizations, I have applied the same optimizations to the AVX2 version of this implementation.

***UPDATE***: UI use v_sincos from #25892 now. The original implementation has AVX2 optimizations but is slower much than current UI so it's removed, and AVX2 perf test is below. Scalar implementation isn't changed because it's faster than using UI's method.

#### Test Result

`scalar` and `ui` test is done on Muse PI, and AVX2 test is done on Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz.

`scalar` test:
```
                   Name of Test                      orig     pr        pr    
                                                                        vs    
                                                                       orig   
                                                                    (x-factor)
PolarToCart::PolarToCartFixture::(127x61, 32FC1)     0.333   0.294     1.13   
PolarToCart::PolarToCartFixture::(127x61, 64FC1)     0.385   0.403     0.96   
PolarToCart::PolarToCartFixture::(640x480, 32FC1)   14.749  12.343     1.19   
PolarToCart::PolarToCartFixture::(640x480, 64FC1)   19.419  16.743     1.16   
PolarToCart::PolarToCartFixture::(1280x720, 32FC1)  44.155  37.822     1.17   
PolarToCart::PolarToCartFixture::(1280x720, 64FC1)  62.108  50.358     1.23   
PolarToCart::PolarToCartFixture::(1920x1080, 32FC1) 99.011  85.769     1.15   
PolarToCart::PolarToCartFixture::(1920x1080, 64FC1) 127.740 112.874    1.13   
```

`ui` test:
```
                   Name of Test                      orig     pr        pr    
                                                                        vs    
                                                                       orig   
                                                                    (x-factor)
PolarToCart::PolarToCartFixture::(127x61, 32FC1)     0.306  0.110     2.77   
PolarToCart::PolarToCartFixture::(127x61, 64FC1)     0.455  0.163     2.79   
PolarToCart::PolarToCartFixture::(640x480, 32FC1)   13.381  4.325     3.09   
PolarToCart::PolarToCartFixture::(640x480, 64FC1)   21.851  7.118     3.07   
PolarToCart::PolarToCartFixture::(1280x720, 32FC1)  39.975  13.114    3.05   
PolarToCart::PolarToCartFixture::(1280x720, 64FC1)  67.006  21.298    3.15   
PolarToCart::PolarToCartFixture::(1920x1080, 32FC1) 90.362  29.465    3.07   
PolarToCart::PolarToCartFixture::(1920x1080, 64FC1) 129.637 47.743    2.72   
```

AVX2 test:
```
                   Name of Test                     orig   pr       pr    
                                                                    vs    
                                                                   orig   
                                                                (x-factor)
PolarToCart::PolarToCartFixture::(127x61, 32FC1)    0.019 0.009    2.11   
PolarToCart::PolarToCartFixture::(127x61, 64FC1)    0.022 0.013    1.74   
PolarToCart::PolarToCartFixture::(640x480, 32FC1)   0.788 0.355    2.22   
PolarToCart::PolarToCartFixture::(640x480, 64FC1)   1.102 0.618    1.78   
PolarToCart::PolarToCartFixture::(1280x720, 32FC1)  2.383 1.042    2.29   
PolarToCart::PolarToCartFixture::(1280x720, 64FC1)  3.758 2.316    1.62   
PolarToCart::PolarToCartFixture::(1920x1080, 32FC1) 5.577 2.559    2.18   
PolarToCart::PolarToCartFixture::(1920x1080, 64FC1) 9.710 6.424    1.51   
```

A slight performance loss occurs because the check for whether $mag$ is nullptr is performed with every calculation, instead of being done once per batch. This is to reuse current `SinCos_32f` function.

### 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-17 14:16:09 +03:00
Maxim Smolskiy b6f213a8c7 Merge pull request #27079 from MaximSmolskiy:add-test-for-ArucoDetector-detectMarkers
Add test for ArucoDetector::detectMarkers #27079

### Pull Request Readiness Checklist

Related to #26968 and #26922

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-03-17 11:24:46 +03:00
Alexander Smorkalov 0a39f98bee Merge pull request #27067 from amane-ame:sepfilter_optimize
Optimize RISC-V HAL cv::sepFilter
2025-03-17 09:21:33 +03:00
Liutong HAN 6eaaaa410e Merge pull request #27056 from hanliutong:rvv-hal-copyright
[RVV HAL] Add copyright and replace '#pragma once'. #27056

Add copyright and in RVV HAL, since other companies or teams may join the development and add their copyright.

And the '#pragma once' are replaced.

### 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-15 17:25:31 +03:00
amane-ame 2c16f3b7d2 Optimize cv::sepFilter.
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
2025-03-14 18:33:57 +08:00
Alexander Smorkalov 14396b8029 Merge pull request #27047 from vrabaud:lzw
Move the CV_Assert above the << operation to not trigger the fuzzer
2025-03-14 09:01:15 +03:00
GenshinImpactStarts 2a8d4b8e43 Merge pull request #27000 from GenshinImpactStarts:cart_to_polar
[HAL RVV] reuse atan | impl cart_to_polar | add perf test #27000

Implement through the existing `cv_hal_cartToPolar32f` and `cv_hal_cartToPolar64f` interfaces.

Add `cartToPolar` performance tests.

cv_hal_rvv::fast_atan is modified to make it more reusable because it's needed in cartToPolar.

**UPDATE**: UI enabled. Since the vec type of RVV can't be stored in struct. UI implementation of `v_atan_f32` is modified. Both `fastAtan` and `cartToPolar` are affected so the test result for `atan` is also appended. I have tested the modified UI on RVV and AVX2 and no regressions appears.

Perf test done on MUSE-PI. AVX2 test done on Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz.

```sh
$ opencv_test_core --gtest_filter="*CartToPolar*:*Core_CartPolar_reverse*:*Phase*" 
$ opencv_perf_core --gtest_filter="*CartToPolar*:*phase*" --perf_min_samples=300 --perf_force_samples=300
```

Test result between enabled UI and HAL:
```
                   Name of Test                       ui    rvv      rvv    
                                                                      vs    
                                                                      ui    
                                                                  (x-factor)
CartToPolar::CartToPolarFixture::(127x61, 32FC1)    0.106  0.059     1.80   
CartToPolar::CartToPolarFixture::(127x61, 64FC1)    0.155  0.070     2.20   
CartToPolar::CartToPolarFixture::(640x480, 32FC1)   4.188  2.317     1.81   
CartToPolar::CartToPolarFixture::(640x480, 64FC1)   6.593  2.889     2.28   
CartToPolar::CartToPolarFixture::(1280x720, 32FC1)  12.600 7.057     1.79   
CartToPolar::CartToPolarFixture::(1280x720, 64FC1)  19.860 8.797     2.26   
CartToPolar::CartToPolarFixture::(1920x1080, 32FC1) 28.295 15.809    1.79   
CartToPolar::CartToPolarFixture::(1920x1080, 64FC1) 44.573 19.398    2.30   
phase32f::VectorLength::128                         0.002  0.002     1.20   
phase32f::VectorLength::1000                        0.008  0.006     1.32   
phase32f::VectorLength::131072                      1.061  0.731     1.45   
phase32f::VectorLength::524288                      3.997  2.976     1.34   
phase32f::VectorLength::1048576                     8.001  5.959     1.34   
phase64f::VectorLength::128                         0.002  0.002     1.33   
phase64f::VectorLength::1000                        0.012  0.008     1.58   
phase64f::VectorLength::131072                      1.648  0.931     1.77   
phase64f::VectorLength::524288                      6.836  3.837     1.78   
phase64f::VectorLength::1048576                     14.060 7.540     1.86   
```

Test result before and after enabling UI on RVV:
```
                   Name of Test                      perf   perf     perf   
                                                      ui     ui       ui    
                                                     orig    pr       pr    
                                                                      vs    
                                                                     perf   
                                                                      ui    
                                                                     orig   
                                                                  (x-factor)
CartToPolar::CartToPolarFixture::(127x61, 32FC1)    0.141  0.106     1.33   
CartToPolar::CartToPolarFixture::(127x61, 64FC1)    0.187  0.155     1.20   
CartToPolar::CartToPolarFixture::(640x480, 32FC1)   5.990  4.188     1.43   
CartToPolar::CartToPolarFixture::(640x480, 64FC1)   8.370  6.593     1.27   
CartToPolar::CartToPolarFixture::(1280x720, 32FC1)  18.214 12.600    1.45   
CartToPolar::CartToPolarFixture::(1280x720, 64FC1)  25.365 19.860    1.28   
CartToPolar::CartToPolarFixture::(1920x1080, 32FC1) 40.437 28.295    1.43   
CartToPolar::CartToPolarFixture::(1920x1080, 64FC1) 56.699 44.573    1.27   
phase32f::VectorLength::128                         0.003  0.002     1.54   
phase32f::VectorLength::1000                        0.016  0.008     1.90   
phase32f::VectorLength::131072                      2.048  1.061     1.93   
phase32f::VectorLength::524288                      8.219  3.997     2.06   
phase32f::VectorLength::1048576                     16.426 8.001     2.05   
phase64f::VectorLength::128                         0.003  0.002     1.44   
phase64f::VectorLength::1000                        0.020  0.012     1.60   
phase64f::VectorLength::131072                      2.621  1.648     1.59   
phase64f::VectorLength::524288                      10.780 6.836     1.58   
phase64f::VectorLength::1048576                     22.723 14.060    1.62   
```

Test result before and after modifying UI on AVX2:
```
                   Name of Test                     perf  perf     perf   
                                                    avx2  avx2     avx2   
                                                    orig   pr       pr    
                                                                    vs    
                                                                   perf   
                                                                   avx2   
                                                                   orig   
                                                                (x-factor)
CartToPolar::CartToPolarFixture::(127x61, 32FC1)    0.006 0.005    1.14   
CartToPolar::CartToPolarFixture::(127x61, 64FC1)    0.010 0.009    1.08   
CartToPolar::CartToPolarFixture::(640x480, 32FC1)   0.273 0.264    1.03   
CartToPolar::CartToPolarFixture::(640x480, 64FC1)   0.511 0.487    1.05   
CartToPolar::CartToPolarFixture::(1280x720, 32FC1)  0.760 0.723    1.05   
CartToPolar::CartToPolarFixture::(1280x720, 64FC1)  2.009 1.937    1.04   
CartToPolar::CartToPolarFixture::(1920x1080, 32FC1) 1.996 1.923    1.04   
CartToPolar::CartToPolarFixture::(1920x1080, 64FC1) 5.721 5.509    1.04   
phase32f::VectorLength::128                         0.000 0.000    0.98   
phase32f::VectorLength::1000                        0.001 0.001    0.97   
phase32f::VectorLength::131072                      0.105 0.111    0.95   
phase32f::VectorLength::524288                      0.402 0.402    1.00   
phase32f::VectorLength::1048576                     0.775 0.767    1.01   
phase64f::VectorLength::128                         0.000 0.000    1.00   
phase64f::VectorLength::1000                        0.001 0.001    1.01   
phase64f::VectorLength::131072                      0.163 0.162    1.01   
phase64f::VectorLength::524288                      0.669 0.653    1.02   
phase64f::VectorLength::1048576                     1.660 1.634    1.02   
```

### 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-13 15:56:56 +03:00
Alexander Smorkalov b129abfdaa Merge pull request #27055 from hanliutong:UI-loop-condition
Fix some vectorized loop conditions.
2025-03-13 14:12:30 +03:00
Vincent Rabaud 186537a315 Move the CV_Assert above the << operation to not trigger the fuzzer 2025-03-13 10:00:49 +01:00
Liutong HAN fd62bd0991 Relax the loop condition to process the final batch. 2025-03-13 07:54:41 +00:00
GenshinImpactStarts e30697fd42 Merge pull request #27002 from GenshinImpactStarts:magnitude
[HAL RVV] impl magnitude | add perf test #27002

Implement through the existing `cv_hal_magnitude32f` and `cv_hal_magnitude64f` interfaces.

**UPDATE**: UI is enabled. The only difference between UI and HAL now is HAL use a approximate `sqrt`.

Perf test done on MUSE-PI.

```sh
$ opencv_test_core --gtest_filter="*Magnitude*"
$ opencv_perf_core --gtest_filter="*Magnitude*" --perf_min_samples=300 --perf_force_samples=300
```

Test result between enabled UI and HAL:
```
                 Name of Test                     ui    rvv      rvv    
                                                                  vs    
                                                                  ui    
                                                              (x-factor)
Magnitude::MagnitudeFixture::(127x61, 32FC1)    0.029  0.016     1.75   
Magnitude::MagnitudeFixture::(127x61, 64FC1)    0.057  0.036     1.57   
Magnitude::MagnitudeFixture::(640x480, 32FC1)   1.063  0.648     1.64   
Magnitude::MagnitudeFixture::(640x480, 64FC1)   2.261  1.530     1.48   
Magnitude::MagnitudeFixture::(1280x720, 32FC1)  3.261  2.118     1.54   
Magnitude::MagnitudeFixture::(1280x720, 64FC1)  6.802  4.682     1.45   
Magnitude::MagnitudeFixture::(1920x1080, 32FC1) 7.287  4.738     1.54   
Magnitude::MagnitudeFixture::(1920x1080, 64FC1) 15.226 10.334    1.47   
```

Test result before and after enabling UI:
```
                 Name of Test                    orig    pr       pr    
                                                                  vs    
                                                                 orig   
                                                              (x-factor)
Magnitude::MagnitudeFixture::(127x61, 32FC1)    0.032  0.029     1.11   
Magnitude::MagnitudeFixture::(127x61, 64FC1)    0.067  0.057     1.17   
Magnitude::MagnitudeFixture::(640x480, 32FC1)   1.228  1.063     1.16   
Magnitude::MagnitudeFixture::(640x480, 64FC1)   2.786  2.261     1.23   
Magnitude::MagnitudeFixture::(1280x720, 32FC1)  3.762  3.261     1.15   
Magnitude::MagnitudeFixture::(1280x720, 64FC1)  8.549  6.802     1.26   
Magnitude::MagnitudeFixture::(1920x1080, 32FC1) 8.408  7.287     1.15   
Magnitude::MagnitudeFixture::(1920x1080, 64FC1) 18.884 15.226    1.24   
```

### 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-13 08:34:11 +03:00
Vincent Rabaud 71fe903121 Merge pull request #27040 from vrabaud:png_leak
Make sure there are enough channels to check for opacity #27040

### 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-03-12 21:06:01 +03:00
Alexander Smorkalov 7481cb50b5 Merge pull request #27013 from asmorkalov:as/imencode_animation
Test for in-memory animation encoding and decoding #27013
 
Tests for https://github.com/opencv/opencv/pull/26964

### 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-12 18:10:06 +03:00
Alexander Smorkalov bbcdbca872 Merge pull request #27041 from asmorkalov:as/decolor_opt
Local decolor pipeline optimization
2025-03-12 18:03:13 +03:00
Pierre Chatelier d83df66ff0 Merge pull request #26834 from chacha21:findContours_speedup
Find contours speedup #26834

It is an attempt, as suggested by #26775, to restore lost speed when migrating `findContours()` implementation from C to C++

The patch adds an "Arena" (a pool) of pre-allocated memory so that contours points (and TreeNodes) can be picked from the Arena.
The code of `findContours()` is mostly unchanged, the arena usage being implicit through a utility class Arena::Item that provides C++ overloaded operators and construct/destruct logic.

As mentioned in #26775, the contour points are allocated and released in order, and can be represented by ranges of indices in their arena. No range subset will be released and drill a hole, that's why the internal representation as a range of indices makes sense.

The TreeNodes use another Arena class that does not comply to that range logic.

Currently, there is a significant improvement of the run-time on the test mentioned in #26775, but it is still far from the `findContours_legacy()` performance.


- [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-03-12 18:00:01 +03:00
Pierre Chatelier 0db6a496ba Merge pull request #26842 from chacha21:threshold_with_mask
Added optional mask to cv::threshold #26842
 
Proposal for #26777

To avoid code duplication, and keep performance when no mask is used, inner implementation always propagate the const cv::Mat& mask, but they use a template<bool useMask> parameter that let the compiler optimize out unnecessary tests when the mask is not to be used.

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-03-12 17:55:07 +03:00
Alexander Smorkalov 49ab8121b7 Merge pull request #27050 from hanliutong:rvv-fix-27003
RISC-V: Fix #27003.
2025-03-12 17:32:19 +03:00
Yuantao Feng eefa327f30 Merge pull request #27042 from fengyuentau:4x/core/normDiff_simd
core: vectorize normDiff with universal intrinsics #27042

Merge with https://github.com/opencv/opencv_extra/pull/1242.

Performance results on Desktop Intel i7-12700K, Apple M2, Jetson Orin and SpaceMIT K1:

[perf-normDiff.zip](https://github.com/user-attachments/files/19178689/perf-normDiff.zip)


### 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
- [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-03-12 16:43:10 +03:00
Liutong HAN 2969b67bd7 Fix 27003. 2025-03-12 12:15:05 +00:00
Maxim Smolskiy 46dbc57a86 Merge pull request #26968 from MaximSmolskiy:fix-Aruco-marker-incorrect-detection-near-image-edge
Fix Aruco marker incorrect detection near image edge #26968

### Pull Request Readiness Checklist

Fix #26922 

As I understood the algorithm, at the first stage we search for the contours of the marker several times (adaptive threshold with different windows sizes). Therefore, for the same marker, we get several contours (inner and outer with different sizes due to the different windows sizes). In the second stage, we group the contours for the same marker into one group, from which we take the largest contour as the best candidate (which should best match the border of the marker).

The problem is that using the `minDistanceToBorder` parameter, we discard contours at the first stage. Thus, we discard the best candidates most appropriate to the marker border, and inner contours may remain, representing a significantly smaller marker border (which we observe in the issue).

But if we use the `minDistanceToBorder` parameter to discard the best candidate of the group at the second stage, then there will be no such problems and we will completely discard markers located too close to the border of the image.

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-12 09:47:49 +03:00
GenshinImpactStarts 60de3ff24f Merge pull request #27015 from GenshinImpactStarts:sqrt
[HAL RVV] impl sqrt and invSqrt #27015

Implement through the existing interfaces `cv_hal_sqrt32f`, `cv_hal_sqrt64f`, `cv_hal_invSqrt32f`, `cv_hal_invSqrt64f`.

Perf test done on MUSE-PI and CanMV K230. Because the performance of scalar is much worse than universal intrinsic, only ui and hal rvv is compared.

In RVV's UI, `invSqrt` is computed using `1 / sqrt()`. This patch first uses `frsqrt` and then applies the Newton-Raphson method to achieve higher precision. For the initial value, I tried using the famous [fast inverse square root algorithm](https://en.wikipedia.org/wiki/Fast_inverse_square_root), which involves one bit shift and one subtraction. However, on both MUSE-PI and CanMV K230, the performance was slightly lower (about 3%), so I chose to use `frsqrt` for the initial value instead. 

BTW, I think this patch can directly replace RVV's UI.

**UPDATE**: Due to strange vector registers allocation strategy in clang, for `invSqrt`, clang use LMUL m4 while gcc use LMUL m8, which leads to some performance loss in clang. So the test for clang is appended.

```sh
$ opencv_test_core --gtest_filter="Core_HAL/mathfuncs.*"
$ opencv_perf_core --gtest_filter="SqrtFixture.*" --perf_min_samples=300 --perf_force_samples=300
```

CanMV K230:
```
              Name of Test                 ui    rvv      rvv    
                                                           vs    
                                                           ui    
                                                       (x-factor)
Sqrt::SqrtFixture::(127x61, 5, false)    0.052  0.027     1.96   
Sqrt::SqrtFixture::(127x61, 5, true)     0.101  0.026     3.80   
Sqrt::SqrtFixture::(127x61, 6, false)    0.106  0.059     1.79   
Sqrt::SqrtFixture::(127x61, 6, true)     0.207  0.058     3.55   
Sqrt::SqrtFixture::(640x480, 5, false)   1.988  0.956     2.08   
Sqrt::SqrtFixture::(640x480, 5, true)    3.920  0.948     4.13   
Sqrt::SqrtFixture::(640x480, 6, false)   4.179  2.342     1.78   
Sqrt::SqrtFixture::(640x480, 6, true)    8.220  2.290     3.59   
Sqrt::SqrtFixture::(1280x720, 5, false)  5.969  2.881     2.07   
Sqrt::SqrtFixture::(1280x720, 5, true)   11.731 2.857     4.11   
Sqrt::SqrtFixture::(1280x720, 6, false)  12.533 7.031     1.78   
Sqrt::SqrtFixture::(1280x720, 6, true)   24.643 6.917     3.56   
Sqrt::SqrtFixture::(1920x1080, 5, false) 13.423 6.483     2.07   
Sqrt::SqrtFixture::(1920x1080, 5, true)  26.379 6.436     4.10   
Sqrt::SqrtFixture::(1920x1080, 6, false) 28.200 15.833    1.78   
Sqrt::SqrtFixture::(1920x1080, 6, true)  55.434 15.565    3.56   
```

MUSE-PI:
```
                                                 GCC              |        clang            
              Name of Test                 ui    rvv      rvv     |   ui    rvv      rvv    
                                                           vs     |                   vs    
                                                           ui     |                   ui    
                                                       (x-factor) |               (x-factor)
Sqrt::SqrtFixture::(127x61, 5, false)    0.027  0.018     1.46    | 0.027  0.016     1.65   
Sqrt::SqrtFixture::(127x61, 5, true)     0.050  0.017     2.98    | 0.050  0.017     2.99   
Sqrt::SqrtFixture::(127x61, 6, false)    0.053  0.031     1.72    | 0.052  0.032     1.64   
Sqrt::SqrtFixture::(127x61, 6, true)     0.100  0.030     3.31    | 0.101  0.035     2.86   
Sqrt::SqrtFixture::(640x480, 5, false)   0.955  0.483     1.98    | 0.959  0.499     1.92   
Sqrt::SqrtFixture::(640x480, 5, true)    1.873  0.489     3.83    | 1.873  0.520     3.60   
Sqrt::SqrtFixture::(640x480, 6, false)   2.027  1.163     1.74    | 2.037  1.218     1.67   
Sqrt::SqrtFixture::(640x480, 6, true)    3.961  1.153     3.44    | 3.961  1.341     2.95   
Sqrt::SqrtFixture::(1280x720, 5, false)  2.916  1.538     1.90    | 2.912  1.598     1.82   
Sqrt::SqrtFixture::(1280x720, 5, true)   5.735  1.534     3.74    | 5.726  1.661     3.45   
Sqrt::SqrtFixture::(1280x720, 6, false)  6.121  3.585     1.71    | 6.109  3.725     1.64   
Sqrt::SqrtFixture::(1280x720, 6, true)   12.059 3.501     3.44    | 12.053 4.080     2.95   
Sqrt::SqrtFixture::(1920x1080, 5, false) 6.540  3.535     1.85    | 6.540  3.643     1.80   
Sqrt::SqrtFixture::(1920x1080, 5, true)  12.943 3.445     3.76    | 12.908 3.706     3.48   
Sqrt::SqrtFixture::(1920x1080, 6, false) 13.714 8.062     1.70    | 13.711 8.376     1.64   
Sqrt::SqrtFixture::(1920x1080, 6, true)  27.011 7.989     3.38    | 27.115 9.245     2.93   
```

### 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-12 08:34:27 +03:00
Suleyman TURKMEN 656038346b Merge pull request #26441 from sturkmen72:upd_tutorials
Update tutorials #26441

### 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-03-11 16:17:21 +03:00
Alexander Smorkalov 1f63b986a1 Merge pull request #26976 from MaximSmolskiy/refactor-ArucoDetector-ArucoDetectorImpl-filterTooCloseCandidates
Refactor ArucoDetector::ArucoDetectorImpl::filterTooCloseCandidates
2025-03-11 16:10:48 +03:00
Alexander Smorkalov a48e78cdfc Merge pull request #27026 from amane-ame/filter_hal_rvv
Add RISC-V HAL implementation for cv::filter series
2025-03-11 16:09:45 +03:00
Alexander Smorkalov d9956fc24f Merge pull request #26934 from BenjaminKnecht/new_4.x
Extend ArUcoDetector to run multiple dictionaries in an efficient manner.
2025-03-11 14:37:00 +03:00
amane-ame 2dd72201af Remove CV_ASSERT.
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
2025-03-11 18:37:58 +08:00
Alexander Smorkalov 6fb082ae7f Merge pull request #27001 from DanBmh/opt_newoptcm
Optimize camera matrix undistortion
2025-03-11 12:47:35 +03:00
amane-ame d9ec808b15 Use the macro from interface.h.
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
2025-03-11 17:44:55 +08:00
Alexander Smorkalov fa092b4597 Merge pull request #27043 from asmorkalov/as/debayer_warn_fix
Warning fix on Windows.
2025-03-11 12:07:57 +03:00
Alexander Smorkalov f833519506 Warning fix on Windows. 2025-03-11 11:17:20 +03:00
Alexander Smorkalov 4be88e934f Merge pull request #27010 from GenshinImpactStarts/exp_log
[HAL RVV] impl exp and log | add log perf test
2025-03-11 10:51:03 +03:00
Alexander Smorkalov e342d2f339 Local decolor pipeline optimization. 2025-03-11 10:16:01 +03:00
Alexander Smorkalov 4bb57ceb73 Merge pull request #26868 from FantasqueX/bayer2gray-simd-2
Use universal intrinsics in bayer2gray
2025-03-11 09:55:09 +03:00
Alexander Smorkalov 2fbb310265 Merge pull request #27037 from sturkmen72/ImageCollection_animations
Add a test to ensure ImageCollection class works good with animations
2025-03-11 08:18:22 +03:00
Suleyman TURKMEN 6004badce2 ImageCollection animations 2025-03-10 21:02:43 +03:00
Pierre Chatelier e813326c17 Merge pull request #27039 from chacha21:threshold_otsu_doc_update
Threshold otsu doc update #27039 
 
PR for #27038

(I had already done that, but encounters git madness after branch renaming)

- [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-03-10 19:40:45 +03:00
Alexander Smorkalov 3236436892 Merge pull request #27036 from CodeLinaro:xuezha_3rdPost
Fix gaussianBlur5x5 performance regression
2025-03-10 18:21:20 +03:00
Xue Zhang accebdecf7 Fix gaussianBlur5x5 performance regression 2025-03-10 16:16:56 +05:30
Alexander Smorkalov 316b5d7b08 Merge pull request #27031 from sturkmen72:libjpeg-turbo_ver_3.1.0
Libjpeg-turbo update to version 3.1.0
2025-03-10 13:44:00 +03:00
Daniel f4a2c35c73 Small updates. 2025-03-10 11:22:24 +01:00
amane-ame 54da5c3e77 Add some algorithm comments.
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
2025-03-10 16:42:58 +08:00
GenshinImpactStarts 830d031213 Merge pull request #26977 from GenshinImpactStarts:helper_hal_rvv
[Refactor](HAL RVV): Consolidate Helpers for Code Reusability #26977

This PR introduces a new helper file with utility types and templates to standardize function interfaces. This refactor allows us to avoid duplicate code when types differ but logic remains the same.

The `flip` and `minmax` implementations have been updated to use the new generic helpers, replacing the previously defined, redundant classes.

Due to the large number of functions, not all interfaces are unified yet. Future development can extend the types as needed. While the usage of function templates is currently limited, this will ease future development.

### 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-10 10:36:48 +03:00
amane-ame 02253dd76b Copy cv::borderInterpolate from core.
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
2025-03-10 15:26:41 +08:00
quic-xuezha 797068853f Merge pull request #27033 from CodeLinaro:xuezha_3rdPost
Fix assert failure in Sobel test when enable FastCV #27033

### 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-10 10:24:28 +03:00
Suleyman TURKMEN 6d161c25ef Update libjpeg-turbo version:3.1.0 2025-03-09 00:02:20 +03:00
GenshinImpactStarts 0fed1fa184 fix exp, log | enable ui for log | strengthen test
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
2025-03-07 17:11:26 +00:00
GenshinImpactStarts 524d8ae01c impl exp and log | add log perf test
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
2025-03-07 17:11:26 +00:00
amane-ame e06502a254 Add Morph for MORPH_ERODE and MORPH_DILATE.
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
2025-03-08 00:35:50 +08:00
Alexander Smorkalov 40843d06ab Disable CV_SIMD_SCALABLE for demosaicing as the implementation is not efficient on RISC-V RVV. 2025-03-07 16:24:20 +03:00
amane-ame a2d784b6f5 Add sepFilter.
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
2025-03-07 20:56:04 +08:00
Alexander Smorkalov 12d182bf9e Merge pull request #27025 from shyama7004:link
fix the not working link
2025-03-07 15:55:59 +03:00
Alexander Smorkalov 648424eaf2 Code review fixes. 2025-03-07 15:33:54 +03:00
shyama7004 a9b2467868 fix the not working link 2025-03-07 17:39:49 +05:30
Alexander Smorkalov fbffaa5276 Warning fix. 2025-03-07 11:56:26 +03:00
天音あめ e89e2fd7ea Merge pull request #27007 from amane-ame:color_hal_rvv
Add RISC-V HAL implementation for cv::cvtColor #27007

This patch implements the following functions in RVV_HAL using native intrinsics, optimizing the performance of `cv::cvtColor` for all possible data types and modes (except for `COLOR_Bayer`, `COLOR_YUV2GRAY_420` and `COLOR_mRGBA`, as these modes have no HAL interface):

```
cv_hal_cvtBGRtoBGR
cv_hal_cvtBGRtoBGR5x5
cv_hal_cvtBGR5x5toBGR
cv_hal_cvtBGRtoGray
cv_hal_cvtGraytoBGR
cv_hal_cvtBGR5x5toGray
cv_hal_cvtGraytoBGR5x5
cv_hal_cvtBGRtoYUV
cv_hal_cvtYUVtoBGR
cv_hal_cvtBGRtoXYZ
cv_hal_cvtXYZtoBGR
cv_hal_cvtBGRtoHSV
cv_hal_cvtHSVtoBGR
cv_hal_cvtBGRtoLab
cv_hal_cvtLabtoBGR
cv_hal_cvtTwoPlaneYUVtoBGR
cv_hal_cvtBGRtoTwoPlaneYUV
cv_hal_cvtThreePlaneYUVtoBGR
cv_hal_cvtBGRtoThreePlaneYUV
cv_hal_cvtOnePlaneYUVtoBGR
cv_hal_cvtOnePlaneBGRtoYUV
```

Tested on MUSE-PI (Spacemit X60) for both gcc 14.2 and clang 20.0.

```
$ ./opencv_test_imgproc --gtest_filter="*Color*-*Bayer*"
$ ./opencv_perf_imgproc --gtest_filter="*Color*-*Bayer*" --gtest_also_run_disabled_tests --perf_min_samples=100 --perf_force_samples=100
```

View the full perf table here: [hal_rvv_color.pdf](https://github.com/user-attachments/files/19055417/hal_rvv_color.pdf)

### 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
2025-03-07 11:24:48 +03:00
天音あめ 00956d5c15 Merge pull request #26892 from amane-ame:solve_hal_rvv
Add RISC-V HAL implementation for cv::solve #26892

This patch implements `cv_hal_LU/cv_hal_Cholesky/cv_hal_SVD/cv_hal_QR` function in RVV_HAL using native intrinsics, optimizing the performance for `cv::solve` with method `DECOMP_LU/DECOMP_SVD/DECOMP_CHOLESKY/DECOMP_QR` and data types `32FC1/64FC1`.

Tested on MUSE-PI (Spacemit X60) for both gcc 14.2 and clang 20.0.

```
$ ./opencv_test_core --gtest_filter="*Solve*:*SVD*:*Cholesky*"
$ ./opencv_perf_core --gtest_filter="*SolveTest*" --perf_min_samples=100 --perf_force_samples=100
```

The tail of the perf table is shown below since the table is too long.

View the full perf table here: [hal_rvv_solve.pdf](https://github.com/user-attachments/files/18725067/hal_rvv_solve.pdf)

<img width="1078" alt="Untitled" src="https://github.com/user-attachments/assets/c01d849c-f000-4bcc-bfe0-a302d6605d9e" />

### 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-07 11:14:09 +03:00
天音あめ bb525fe91d Merge pull request #26865 from amane-ame:dxt_hal_rvv
Add RISC-V HAL implementation for cv::dft and cv::dct #26865

This patch implements `static cv::DFT` function in RVV_HAL using native intrinsic, optimizing the performance for `cv::dft` and `cv::dct` with data types `32FC1/64FC1/32FC2/64FC2`.

The reason I chose to create a new `cv_hal_dftOcv` interface is that if I were to use the existing interfaces (`cv_hal_dftInit1D` and `cv_hal_dft1D`), it would require handling and parsing the dft flags within HAL, as well as performing preprocessing operations such as handling unit roots. Since these operations are not performance hotspots and do not require optimization, reusing the existing interfaces would result in copying approximately 300 lines of code from `core/src/dxt.cpp` into HAL, which I believe is unnecessary.

Moreover, if I insert the new interface into `static cv::DFT`, both `static cv::RealDFT` and `static cv::DCT` can be optimized as well. The processing performed before and after calling `static cv::DFT` in these functions is also not a performance hotspot.

Tested on MUSE-PI (Spacemit X60) for both gcc 14.2 and clang 20.0.

```
$ opencv_test_core --gtest_filter="*DFT*"
$ opencv_perf_core --gtest_filter="*dft*:*dct*" --perf_min_samples=30 --perf_force_samples=30
```

The head of the perf table is shown below since the table is too long.

View the full perf table here: [hal_rvv_dxt.pdf](https://github.com/user-attachments/files/18622645/hal_rvv_dxt.pdf)

<img width="1017" alt="Untitled" src="https://github.com/user-attachments/assets/609856e7-9c7d-4a95-9923-45c1b77eb3a2" />

### 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-07 11:08:41 +03:00
GenshinImpactStarts 57a78cb9df Merge pull request #26941 from GenshinImpactStarts:lut_hal_rvv
Impl hal_rvv LUT | Add more LUT test #26941 

Implement through the existing `cv_hal_lut` interfaces.

Add more LUT accuracy and performance tests:
- **Accuracy test**: Multi-channel table tests are added, and the boundary of `randu` used for generating test data is broadened to make the test more robust.
- **Performance test**: Multi-channel input and multi-channel table tests are added.

Perf test done on
- MUSE-PI (vlen=256)
- Compiler: gcc 14.2 (riscv-collab/riscv-gnu-toolchain Nightly: December 16, 2024)


```sh

$ opencv_test_core --gtest_filter="Core_LUT*"
$ opencv_perf_core --gtest_filter="SizePrm_LUT*" --perf_min_samples=300 --perf_force_samples=300
```
```sh
Geometric mean (ms)

         Name of Test          scalar   ui    rvv       ui        rvv    
                                                        vs         vs    
                                                      scalar     scalar  
                                                    (x-factor) (x-factor)
LUT::SizePrm::320x240          0.248  0.249  0.052     1.00       4.74   
LUT::SizePrm::640x480          0.277  0.275  0.085     1.01       3.28   
LUT::SizePrm::1920x1080        0.950  0.947  0.634     1.00       1.50   
LUT_multi2::SizePrm::320x240   2.051  2.045  2.049     1.00       1.00   
LUT_multi2::SizePrm::640x480   2.128  2.134  2.125     1.00       1.00   
LUT_multi2::SizePrm::1920x1080 7.397  7.380  7.390     1.00       1.00   
LUT_multi::SizePrm::320x240    0.715  0.747  0.154     0.96       4.64   
LUT_multi::SizePrm::640x480    0.741  0.766  0.257     0.97       2.88   
LUT_multi::SizePrm::1920x1080  2.766  2.765  1.925     1.00       1.44  
```

This optimization is achieved by loading the entire lookup table into vector registers. Due to register size limitations, the optimization is only effective under the following conditions:  
- For the U8C1 table type, the optimization works when `vlen >= 256`
- For U16C1, it works when `vlen >= 512`
- For U32C1, it works when `vlen >= 1024`

Since I don’t have real hardware with `vlen > 256`, the corresponding accuracy tests were conducted on QEMU built from the `riscv-collab/riscv-gnu-toolchain`.

This patch does not implement optimizations for multi-channel tables.

Previous attempts:
1. For the U8C1 table type, when `vlen = 128`, it is possible to use four `u8m4` vectors to load the entire table, perform gathering, and merge the results. However, the performance is almost the same as the scalar version.
2. Loading part of the table and repeatedly loading the source data is faster for small sizes. But as the table size grows, the performance quickly degrades compared to the scalar version.
3. Using `vluxei8` as a general solution does not show any performance improvement.

### 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-06 11:17:00 +03:00
amane-ame 83104bed32 Add Filter2D.
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
2025-03-06 14:10:06 +08:00
Suleyman TURKMEN dbd4e4549d Merge pull request #26849 from sturkmen72:apng-writeanimation
APNG encoding optimization #26849

related #26840

### 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-03-05 10:42:43 +03:00
Benjamin Knecht d80fd565b4 Attempt to fix Windows int type warning 2025-03-04 16:24:50 +01:00
Benjamin Knecht 1aa658fa75 Address more comments
Use map to manage unique marker size candidate trees.
Avoid code duplication.
Add a test to show double detection with overlapping dictionaries.
Generalize to marker sizes of not only predefined dictionaries.
2025-03-04 15:24:03 +01:00
Liutong HAN 97abffbdac Merge pull request #27006 from hanliutong:rvv-fix-ui-1024
Fix issues in RISC-V Vector (RVV) Universal Intrinsic #27006

This PR aims to make `opencv_test_core` pass on RVV, via following two parts:

1. Fix bug in Universal Intrinsic when VLEN >= 512:
- `max_nlanes` should be multiplied by 2, because we use LMUL=2 in RVV Universal Intrinsic since #26318.
- Related tests are also expanded to match longer registers
- Relax the precision threshold of `v_erf` to make the tests pass

2. Temporary fix  #26936
- Disable 3 Universal Intrinsic code blocks on GCC
- This is just a temporary fix until we figure out if it's our issue or GCC/something else's

This patch is tested under the following conditions:
- Compier: GCC 14.2, Clang 19.1.7
- Device: Muse-Pi (VLEN=256), QEMU (VLEN=512, 1024)


### 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-04 16:49:59 +03:00
天音あめ cbcfd772ce Merge pull request #26958 from amane-ame:pyramids_hal_rvv
Add RISC-V HAL implementation for cv::pyrDown and cv::pyrUp #26958

This patch implements `cv_hal_pyrdown/cv_hal_pyrup` function in RVV_HAL using native intrinsics, optimizing the performance for `cv::pyrDown`, `cv::pyrUp` and `cv::buildPyramids` with data types `{8U,16S,32F} x {C1,C2,C3,C4,Cn}`.

Tested on MUSE-PI (Spacemit X60) for both gcc 14.2 and clang 20.0.

```
$ ./opencv_test_imgproc --gtest_filter="*pyr*:*Pyr*"
$ ./opencv_perf_imgproc --gtest_filter="*pyr*:*Pyr*" --perf_min_samples=300 --perf_force_samples=300
```

<img width="1112" alt="Untitled" src="https://github.com/user-attachments/assets/235a9fba-0d29-434e-8a10-498212bac657" />


### 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-04 15:41:15 +03:00
Alexander Smorkalov 5c6c6af4ec Merge pull request #27004 from asmorkalov:as/minMax_backport
Backported some CALL_HAL improvements from 5.x #26946
2025-03-04 08:07:30 +03:00
Daniel Bermuth 8a24d41b54 Merge pull request #26988 from DanBmh:opt_undistort
Optimize undistort points #26988

Skips unnecessary rotation with identity matrix if no R or P mats are given.

---------

Co-authored-by: Daniel <daniel@mail.de>
2025-03-03 17:16:09 +03:00
Alexander Smorkalov 1aa69292b0 Backported some CALL_HAL improvements from 5.x #26946 2025-03-03 16:22:48 +03:00
sssanjee-quic a62b78d6e3 Merge pull request #26910 from CodeLinaro:FastcvHAL_Documentation
Documentation to enable FastCV based OpenCV HAL and Extensions #26910

### 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-03 15:14:08 +03:00
Skreg 3f1e7fcb8f Merge pull request #26996 from shyama7004:outofBound
Fix Logical defect in FilterSpecklesImpl #26996

Fixes : #24963

### 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-03-03 15:12:18 +03:00
Daniel e39eb949ea Use only image contour for camera matrix undistortion. 2025-03-03 11:35:05 +01:00
Maxim Smolskiy dbd3ef9a6f Merge pull request #26926 from MaximSmolskiy:fix-getPerspectiveTransform-for-singular-case
Fix getPerspectiveTransform for singular case #26926

### Pull Request Readiness Checklist

Fix #26916 

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-03-02 12:44:39 +03:00
Anshuprem 87cc1643f4 Merge pull request #26992 from Anshuprem:4.x
Some minor fixes #26992

### 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-03-01 14:54:26 +03:00
Alexander Smorkalov b65fd3b51c Merge pull request #26985 from xi-guo-0:fix-qnx7.0-build
fix: qnx7.0 build
2025-02-28 15:08:07 +03:00
Benjamin Knecht 3084f950cf Fix dictionary comparison in test 2025-02-27 10:52:27 +01:00
xi-guo 0b8cab368b fix: qnx7.0 build 2025-02-27 14:24:18 +08:00
Alexander Smorkalov 3db1247745 Merge pull request #26918 from GenshinImpactStarts:norm_hamming
Impl RISC-V HAL for norm_hamming
2025-02-26 21:23:04 +03:00
Alexander Smorkalov 4d6d6fb18f Merge pull request #26983 from AsyaPronina:wa_for_ort_env
G-API/ORT: Workaround exception during OV EP append
2025-02-26 21:19:33 +03:00
Alexander Smorkalov 4f6996b5dd Merge pull request #26982 from asmorkalov:as/backport_c_api
Backported some C API cleanup from 5.x to 4.x to reduce conflicts in 4.x->5.x merge
2025-02-26 20:30:47 +03:00
Anastasiya Pronina 76d3bf0a3b Workaround for successfull append of OpenVINO Execution Provider: Moved creation of 'Ort::Env' before it 2025-02-26 16:55:48 +00:00
Kumataro a63ede6b1d Merge pull request #26930 from Kumataro:fix26924
Imgcodecs: gif: support Disposal Method #26930

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

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-02-26 17:15:41 +03:00
Alexander Smorkalov d3792dad86 Backported some C API cleanup from 5.x to 4.x to reduce conflicts in 4.x->5.x merge. 2025-02-26 17:11:31 +03:00
Maksim Shabunin 43551b72d7 Merge pull request #26948 from mshabunin:fix-videoio-test-params
videoio: print test params instead of indexes #26948
_videoio_ test names changed - use string instead of index.
E.g. `videoio_read.threads/0` is now `videoio_read.threads/h264_0_RAW`.
It allows to filter tests independently of the platform.

**Notes:**
- not all tests has been updated - only simpler ones and those which have varying parameters depending on platform
2025-02-26 14:04:37 +03:00
Suleyman TURKMEN 39bc5df72a Merge pull request #26973 from sturkmen72:png_test
Add a test related IMWRITE_PNG_COMPRESSION parameter #26973

### 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
- [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-02-25 15:24:25 +03:00
Benjamin Knecht d869b12e89 Fixing warnings in tests 2025-02-25 11:50:13 +01:00
GenshinImpactStarts 33d632f85e impl hal_rvv norm_hamming
Co-authored-by: Liutong HAN <liutong2020@iscas.ac.cn>
2025-02-25 02:31:02 +00:00
Benjamin Knecht 314f99f7a0 Remove add/removeDictionary and retain ABI of set/getDictionary
functions
2025-02-24 18:01:10 +01:00
Benjamin Knecht 6c3b195a57 Make sure serialization with single dict preserves old behavior 2025-02-24 17:33:09 +01:00
MaximSmolskiy 63ad15c243 Refactor ArucoDetector::ArucoDetectorImpl::filterTooCloseCandidates 2025-02-24 19:26:48 +03:00
Benjamin Knecht 3c88a001a2 Add docs to Dictionary get/set/add/remove functions 2025-02-24 14:30:48 +01:00
GenshinImpactStarts 6a6a5a765d Merge pull request #26943 from GenshinImpactStarts:flip_hal_rvv
Impl RISC-V HAL for cv::flip | Add perf test for flip #26943 

Implement through the existing `cv_hal_flip` interfaces.

Add perf test for `cv::flip`.

The reason why select these args for testing:
- **size**: copied from perf_lut
- **type**:
    - U8C1: basic situation
    - U8C3: unaligned element size
    - U8C4: large element size

Tested on
- MUSE-PI (vlen=256)
- Compiler: gcc 14.2 (riscv-collab/riscv-gnu-toolchain Nightly: December 16, 2024)

```sh
$ opencv_test_core --gtest_filter="Core_Flip/ElemWiseTest.*"
$ opencv_perf_core --gtest_filter="Size_MatType_FlipCode*" --perf_min_samples=300 --perf_force_samples=300
```

```
Geometric mean (ms)

                     Name of Test                       scalar   ui    rvv       ui        rvv    
                                                                                 vs         vs    
                                                                               scalar     scalar  
                                                                             (x-factor) (x-factor)
flip::Size_MatType_FlipCode::(320x240, 8UC1, FLIP_X)    0.026  0.033  0.031     0.81       0.84   
flip::Size_MatType_FlipCode::(320x240, 8UC1, FLIP_XY)   0.206  0.212  0.091     0.97       2.26   
flip::Size_MatType_FlipCode::(320x240, 8UC1, FLIP_Y)    0.185  0.189  0.082     0.98       2.25   
flip::Size_MatType_FlipCode::(320x240, 8UC3, FLIP_X)    0.070  0.084  0.084     0.83       0.83   
flip::Size_MatType_FlipCode::(320x240, 8UC3, FLIP_XY)   0.616  0.612  0.235     1.01       2.62   
flip::Size_MatType_FlipCode::(320x240, 8UC3, FLIP_Y)    0.587  0.603  0.204     0.97       2.88   
flip::Size_MatType_FlipCode::(320x240, 8UC4, FLIP_X)    0.263  0.110  0.109     2.40       2.41   
flip::Size_MatType_FlipCode::(320x240, 8UC4, FLIP_XY)   0.930  0.831  0.316     1.12       2.95   
flip::Size_MatType_FlipCode::(320x240, 8UC4, FLIP_Y)    1.175  1.129  0.313     1.04       3.75   
flip::Size_MatType_FlipCode::(640x480, 8UC1, FLIP_X)    0.303  0.118  0.111     2.57       2.73   
flip::Size_MatType_FlipCode::(640x480, 8UC1, FLIP_XY)   0.949  0.836  0.405     1.14       2.34   
flip::Size_MatType_FlipCode::(640x480, 8UC1, FLIP_Y)    0.784  0.783  0.409     1.00       1.92   
flip::Size_MatType_FlipCode::(640x480, 8UC3, FLIP_X)    1.084  0.360  0.355     3.01       3.06   
flip::Size_MatType_FlipCode::(640x480, 8UC3, FLIP_XY)   3.768  3.348  1.364     1.13       2.76   
flip::Size_MatType_FlipCode::(640x480, 8UC3, FLIP_Y)    4.361  4.473  1.296     0.97       3.37   
flip::Size_MatType_FlipCode::(640x480, 8UC4, FLIP_X)    1.252  0.469  0.451     2.67       2.78   
flip::Size_MatType_FlipCode::(640x480, 8UC4, FLIP_XY)   5.732  5.220  1.303     1.10       4.40   
flip::Size_MatType_FlipCode::(640x480, 8UC4, FLIP_Y)    5.041  5.105  1.203     0.99       4.19   
flip::Size_MatType_FlipCode::(1920x1080, 8UC1, FLIP_X)  2.382  0.903  0.903     2.64       2.64   
flip::Size_MatType_FlipCode::(1920x1080, 8UC1, FLIP_XY) 8.606  7.508  2.581     1.15       3.33   
flip::Size_MatType_FlipCode::(1920x1080, 8UC1, FLIP_Y)  8.421  8.535  2.219     0.99       3.80   
flip::Size_MatType_FlipCode::(1920x1080, 8UC3, FLIP_X)  6.312  2.416  2.429     2.61       2.60   
flip::Size_MatType_FlipCode::(1920x1080, 8UC3, FLIP_XY) 29.174 26.055 12.761    1.12       2.29   
flip::Size_MatType_FlipCode::(1920x1080, 8UC3, FLIP_Y)  25.373 25.500 13.382    1.00       1.90   
flip::Size_MatType_FlipCode::(1920x1080, 8UC4, FLIP_X)  7.620  3.204  3.115     2.38       2.45   
flip::Size_MatType_FlipCode::(1920x1080, 8UC4, FLIP_XY) 32.876 29.310 12.976    1.12       2.53   
flip::Size_MatType_FlipCode::(1920x1080, 8UC4, FLIP_Y)  28.831 29.094 14.919    0.99       1.93   
```

The optimization for vlen <= 256 and > 256 are different, but I have no real hardware with vlen > 256. So accuracy tests for that like 512 and 1024 are conducted on QEMU built from the `riscv-collab/riscv-gnu-toolchain`.

### 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-02-24 08:56:23 +03:00
Daniil Anufriev b5f5540e8a Merge pull request #26886 from sk1er52:feature/exp64f
Enable SIMD_SCALABLE for exp and sqrt #26886

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
```
CPU - Banana Pi k1, compiler - clang 18.1.4
```
```
Geometric mean (ms)

              Name of Test               baseline  hal     ui      hal         ui    
                                                                    vs         vs
                                                                 baseline   baseline
                                                                (x-factor) (x-factor)
Exp::ExpFixture::(127x61, 32FC1)          0.358     --   0.033      --       10.70   
Exp::ExpFixture::(640x480, 32FC1)         14.304    --   1.167      --       12.26   
Exp::ExpFixture::(1280x720, 32FC1)        42.785    --   3.538      --       12.09
Exp::ExpFixture::(1920x1080, 32FC1)       96.206    --   7.927      --       12.14   
Exp::ExpFixture::(127x61, 64FC1)          0.433   0.050  0.098     8.59       4.40   
Exp::ExpFixture::(640x480, 64FC1)         17.315  1.935  3.813     8.95       4.54   
Exp::ExpFixture::(1280x720, 64FC1)        52.181  5.877  11.519    8.88       4.53   
Exp::ExpFixture::(1920x1080, 64FC1)      117.082  13.157 25.854    8.90       4.53
```
Additionally, this PR brings Sqrt optimization with UI:
```
Geometric mean (ms)

              Name of Test                     baseline    ui       ui    
                                                                    vs
                                                                 baseline
                                                                (x-factor)
Sqrt::SqrtFixture::(127x61, 5, false)            0.111   0.027     4.11   
Sqrt::SqrtFixture::(127x61, 6, false)            0.149   0.053     2.82   
Sqrt::SqrtFixture::(640x480, 5, false)           4.374   0.967     4.52   
Sqrt::SqrtFixture::(640x480, 6, false)           5.885   2.046     2.88   
Sqrt::SqrtFixture::(1280x720, 5, false)          12.960  2.915     4.45   
Sqrt::SqrtFixture::(1280x720, 6, false)          17.648  6.107     2.89   
Sqrt::SqrtFixture::(1920x1080, 5, false)         29.178  6.524     4.47   
Sqrt::SqrtFixture::(1920x1080, 6, false)         39.709  13.670    2.90   
```

Reference
Muller, J.-M. Elementary Functions: Algorithms and Implementation. 2nd ed. Boston: Birkhäuser, 2006.
https://www.springer.com/gp/book/9780817643720
2025-02-21 17:36:54 +03:00
Alexander Smorkalov a256886838 Merge pull request #26949 from shyama7004:Fix
replace deprecated np.fromstring() by np.frombuffer()
2025-02-21 13:55:23 +03:00
Yuantao Feng e2803bee5c Merge pull request #26885 from fengyuentau:4x/core/normalize_simd
core: vectorize cv::normalize / cv::norm #26885

Checklist:
|      | normInf | normL1 | normL2 |
| ---- | ------- | ------ | ------ |
| bool |    -    |   -    |   -    |
| 8u   |    √    |   √    |   √    |
| 8s   |    √    |   √    |   √    |
| 16u  |    √    |   √    |   √    |
| 16s  |    √    |   √    |   √    |
| 16f  |    -    |   -    |   -    |
| 16bf |    -    |   -    |   -    |
| 32u  |    -    |   -    |   -    |
| 32s  |    √    |   √    |   √    |
| 32f  |    √    |   √    |   √    |
| 64u  |    -    |   -    |   -    |
| 64s  |    -    |   -    |   -    |
| 64f  |    √    |   √    |   √    |

*: Vectorization of data type bool, 16f, 16bf, 32u, 64u and 64s needs to be done on 5.x.

### 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
- [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-02-21 13:49:11 +03:00
shyama7004 a47f0f00cb replace deprecated np.fromstring() by np.frombuffer() 2025-02-21 10:37:11 +05:30
Benjamin Knecht 364eedb87e Undo multi dict functionality of refineDetectedMarkers method 2025-02-20 15:37:44 +01:00
Dmitry Kurtaev 7a2b048c92 Merge pull request #26923 from dkurt:merge_rvv_opt
Further optimization of cv::merge RVV HAL for 8U and 16S #26923

### Pull Request Readiness Checklist


* Banana Pi BF3 (SpacemiT K1) RISC-V
* Compiler: Syntacore Clang 18.1.4 (build 2024.12)

```
Geometric mean (ms)

                     Name of Test                       baseline   pr       pr
                                                         merge              vs    
                                                                         baseline
                                                                          merge
                                                                        (x-factor)
merge::Size_SrcDepth_DstChannels::(127x61, 8UC1, 2)      0.013   0.003     3.76   
merge::Size_SrcDepth_DstChannels::(127x61, 8UC1, 3)      0.020   0.006     3.46   
merge::Size_SrcDepth_DstChannels::(127x61, 8UC1, 4)      0.026   0.010     2.61   
merge::Size_SrcDepth_DstChannels::(127x61, 8UC1, 5)      0.043   0.028     1.56   
merge::Size_SrcDepth_DstChannels::(127x61, 8UC1, 6)      0.054   0.035     1.53   
merge::Size_SrcDepth_DstChannels::(127x61, 8UC1, 7)      0.065   0.050     1.30   
merge::Size_SrcDepth_DstChannels::(127x61, 8UC1, 8)      0.070   0.036     1.95   
merge::Size_SrcDepth_DstChannels::(127x61, 16SC1, 2)     0.015   0.008     1.82   
merge::Size_SrcDepth_DstChannels::(127x61, 16SC1, 3)     0.022   0.015     1.48   
merge::Size_SrcDepth_DstChannels::(127x61, 16SC1, 4)     0.029   0.018     1.63   
merge::Size_SrcDepth_DstChannels::(127x61, 16SC1, 5)     0.067   0.044     1.54   
merge::Size_SrcDepth_DstChannels::(127x61, 16SC1, 6)     0.088   0.056     1.58   
merge::Size_SrcDepth_DstChannels::(127x61, 16SC1, 7)     0.104   0.076     1.38   
merge::Size_SrcDepth_DstChannels::(127x61, 16SC1, 8)     0.116   0.065     1.79   
merge::Size_SrcDepth_DstChannels::(640x480, 8UC1, 2)     0.421   0.176     2.39   
merge::Size_SrcDepth_DstChannels::(640x480, 8UC1, 3)     0.792   0.284     2.79   
merge::Size_SrcDepth_DstChannels::(640x480, 8UC1, 4)     1.090   0.370     2.95   
merge::Size_SrcDepth_DstChannels::(640x480, 8UC1, 5)     1.835   1.399     1.31   
merge::Size_SrcDepth_DstChannels::(640x480, 8UC1, 6)     2.389   1.776     1.35   
merge::Size_SrcDepth_DstChannels::(640x480, 8UC1, 7)     3.000   2.471     1.21   
merge::Size_SrcDepth_DstChannels::(640x480, 8UC1, 8)     3.178   2.104     1.51   
merge::Size_SrcDepth_DstChannels::(640x480, 16SC1, 2)    0.490   0.377     1.30   
merge::Size_SrcDepth_DstChannels::(640x480, 16SC1, 3)    1.348   0.602     2.24   
merge::Size_SrcDepth_DstChannels::(640x480, 16SC1, 4)    1.827   0.813     2.25   
merge::Size_SrcDepth_DstChannels::(640x480, 16SC1, 5)    3.283   2.692     1.22   
merge::Size_SrcDepth_DstChannels::(640x480, 16SC1, 6)    4.922   3.334     1.48   
merge::Size_SrcDepth_DstChannels::(640x480, 16SC1, 7)    5.725   4.399     1.30   
merge::Size_SrcDepth_DstChannels::(640x480, 16SC1, 8)    6.278   4.748     1.32   
merge::Size_SrcDepth_DstChannels::(1280x720, 8UC1, 2)    1.267   0.603     2.10   
merge::Size_SrcDepth_DstChannels::(1280x720, 8UC1, 3)    2.394   0.934     2.56   
merge::Size_SrcDepth_DstChannels::(1280x720, 8UC1, 4)    3.236   1.434     2.26   
merge::Size_SrcDepth_DstChannels::(1280x720, 8UC1, 5)    5.398   4.345     1.24   
merge::Size_SrcDepth_DstChannels::(1280x720, 8UC1, 6)    7.127   5.459     1.31   
merge::Size_SrcDepth_DstChannels::(1280x720, 8UC1, 7)    8.590   7.298     1.18   
merge::Size_SrcDepth_DstChannels::(1280x720, 8UC1, 8)    9.360   6.152     1.52   
merge::Size_SrcDepth_DstChannels::(1280x720, 16SC1, 2)   1.482   1.242     1.19   
merge::Size_SrcDepth_DstChannels::(1280x720, 16SC1, 3)   4.008   1.817     2.21   
merge::Size_SrcDepth_DstChannels::(1280x720, 16SC1, 4)   6.079   2.468     2.46   
merge::Size_SrcDepth_DstChannels::(1280x720, 16SC1, 5)   11.300  8.644     1.31   
merge::Size_SrcDepth_DstChannels::(1280x720, 16SC1, 6)   15.125  12.126    1.25   
merge::Size_SrcDepth_DstChannels::(1280x720, 16SC1, 7)   17.555  14.804    1.19   
merge::Size_SrcDepth_DstChannels::(1280x720, 16SC1, 8)   18.890  14.163    1.33   
merge::Size_SrcDepth_DstChannels::(1920x1080, 8UC1, 2)   2.910   1.326     2.19   
merge::Size_SrcDepth_DstChannels::(1920x1080, 8UC1, 3)   5.351   1.997     2.68   
merge::Size_SrcDepth_DstChannels::(1920x1080, 8UC1, 4)   7.290   2.629     2.77   
merge::Size_SrcDepth_DstChannels::(1920x1080, 8UC1, 5)   12.426  9.611     1.29   
merge::Size_SrcDepth_DstChannels::(1920x1080, 8UC1, 6)   16.453  12.162    1.35   
merge::Size_SrcDepth_DstChannels::(1920x1080, 8UC1, 7)   19.420  16.190    1.20   
merge::Size_SrcDepth_DstChannels::(1920x1080, 8UC1, 8)   20.588  13.699    1.50   
merge::Size_SrcDepth_DstChannels::(1920x1080, 16SC1, 2)  3.400   2.640     1.29   
merge::Size_SrcDepth_DstChannels::(1920x1080, 16SC1, 3)  8.986   3.952     2.27   
merge::Size_SrcDepth_DstChannels::(1920x1080, 16SC1, 4)  11.972  5.273     2.27   
merge::Size_SrcDepth_DstChannels::(1920x1080, 16SC1, 5)  20.544  17.996    1.14   
merge::Size_SrcDepth_DstChannels::(1920x1080, 16SC1, 6)  28.677  22.086    1.30   
merge::Size_SrcDepth_DstChannels::(1920x1080, 16SC1, 7)  32.958  27.713    1.19   
merge::Size_SrcDepth_DstChannels::(1920x1080, 16SC1, 8)  36.499  27.439    1.33
```

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-02-20 17:28:28 +03:00
Benjamin Knecht 1f9d6aa6cf Fixed warning on Windows, clarified refineDetectedMarkers method 2025-02-20 15:12:56 +01:00
Alexander Smorkalov 58b14294b5 Merge pull request #26942 from vrabaud:png_leak
Bump openjp2 to v2.5.3
2025-02-20 12:56:54 +03:00
Vincent Rabaud a6bfd87943 Bump openjp2 to v2.5.3
This should quiet some fuzzer bugs
2025-02-20 10:46:33 +03:00
Benjamin Knecht f212c163e3 have two detectMarkers functions for python backwards compatibility
using multiple dictionaries for refinement (function split not necessary
as it's backwards compatible)
2025-02-19 18:45:06 +01:00
Benjamin Knecht 9ae23a7f51 Fix index comparison warnings 2025-02-19 10:53:03 +01:00
kyler1cartesis d32d4da9a3 Merge pull request #26887 from kyler1cartesis:4.x
invSqrt SIMD_SCALABLE implementation & HAL tests refactoring #26887

Enable CV_SIMD_SCALABLE for invSqrt.

* Banana Pi BF3 (SpacemiT K1) RISC-V
* Compiler: Syntacore Clang 18.1.4 (build 2024.12)

```
Geometric mean (ms)

                Name of Test                  baseline   simd      simd   
                                                       scalable  scalable
                                                                    vs
                                                                 baseline
                                                                (x-factor)
InvSqrtf::InvSqrtfFixture::(127x61, 32FC1)     0.163    0.051      3.23   
InvSqrtf::InvSqrtfFixture::(127x61, 64FC1)     0.241    0.103      2.35   
InvSqrtf::InvSqrtfFixture::(640x480, 32FC1)    6.460    1.893      3.41   
InvSqrtf::InvSqrtfFixture::(640x480, 64FC1)    9.687    3.999      2.42   
InvSqrtf::InvSqrtfFixture::(1280x720, 32FC1)   19.292   5.701      3.38   
InvSqrtf::InvSqrtfFixture::(1280x720, 64FC1)   29.452   11.963     2.46   
InvSqrtf::InvSqrtfFixture::(1920x1080, 32FC1)  43.326   12.805     3.38   
InvSqrtf::InvSqrtfFixture::(1920x1080, 64FC1)  65.566   26.881     2.44
```
2025-02-19 12:13:48 +03:00
Benjamin Knecht bb07ce7454 Address comments, add Python test 2025-02-18 17:03:37 +01:00
Benjamin Knecht 379b5a2fdb Fix python bindings 2025-02-18 14:08:09 +01:00
Alexander Smorkalov 6092499907 Merge pull request #26932 from shyama7004:deprecationFix
replace tostring() with tobytes()
2025-02-18 13:22:04 +03:00
Alexander Smorkalov b5c3b706de Merge pull request #26933 from asmorkalov:as/drop_android_test
Removed Android test as it's broken for now
2025-02-18 13:21:31 +03:00
Benjamin Knecht c759a7cdde Extend ArUcoDetector to run multiple dictionaries in an efficient
manner.

* Add constructor for multiple dictionaries
* Add get/set/remove/add functions for multiple dictionaries
* Add unit tests

TESTED=unit tests
2025-02-18 11:04:05 +01:00
Alexander Smorkalov f570852d20 Removed Android test as it's broken for now. 2025-02-18 12:52:24 +03:00
shyama7004 c5ad6d7904 replace tostring() with tobytes 2025-02-18 12:25:01 +05:30
Alexander Smorkalov 21402668a1 Merge pull request #26927 from asmorkalov:as/squeeze_windows
Squeeze several Windows pipelines into one with jobs
2025-02-17 15:08:43 +03:00
Alexander Smorkalov 680fd4d975 Merge pull request #26911 from asmorkalov:as/openvx_hal_imgproc
Migrate remaning OpenVX integrations to OpenVX HAL (imgproc)
2025-02-17 13:57:17 +03:00
Alexander Smorkalov 9a3fb556c4 Merge pull request #26928 from shyama7004:doxFix
fix minor issues in calib3d Docs
2025-02-17 13:54:31 +03:00
Alexander Smorkalov 7ac939c53a Squeeze several Windows pipelines into one with jobs. 2025-02-17 13:51:48 +03:00
shyama7004 18c0368840 fix minor issues in calib3d Docs 2025-02-17 12:38:00 +05:30
Alexander Smorkalov 8065f10521 Merge pull request #26921 from shyama7004:sampsonDistance
Fix assertion in cv2.sampsonDistance
2025-02-17 09:25:30 +03:00
Alexander Smorkalov acc9084044 Move OpenVX integrations to imgproc to OpenVX HAL
Covered functions:
- medianBlur
- Sobel
- Canny
- pyrDown
- BoxFilter
- equalizeHist
- GaussianBlur
- remap
- threshold
2025-02-15 09:55:37 +03:00
Skreg a9cb451199 Fix assertion in cv2.sampsonDistance 2025-02-15 04:47:01 +00:00
Alexander Smorkalov 36a5176a5f Merge pull request #26907 from asmorkalov:as/openvx_hal_features2d
Migrate remaning OpenVX integrations to OpenVX HAL (features2d)
2025-02-14 19:39:58 +03:00
Alexander Smorkalov 1de6e20463 Move OpenVX implementation for FAST to HAL. 2025-02-14 17:47:48 +03:00
Alexander Smorkalov ae25c3194f Merge pull request #26875 from asmorkalov:as/in_memory_models
Added trackers factory with pre-loaded dnn models #26875

Replaces https://github.com/opencv/opencv/pull/26295

Allows to substitute custom models or initialize tracker from in-memory model.

### 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-02-14 15:35:38 +03:00
Alexander Smorkalov a8df0a06ac Merge pull request #26902 from Kababey:patch-3
Update optical_flow.cpp
2025-02-14 15:22:04 +03:00
Alexander Smorkalov b44b30b730 Merge pull request #26898 from mshabunin:fix-riscv-toolchain
RISC-V: error message in the toolchain file when compiler is not found
2025-02-14 13:24:25 +03:00
Alexander Smorkalov 58e557d059 Merge pull request #26903 from asmorkalov:as/openvx_hal
Migrate remaning OpenVX integrations to OpenVX HAL (core) #26903

Tested with OpenVX 1.2 & 1.3 sample implementation.

Steps to build and test:
```
git clone git@github.com:KhronosGroup/OpenVX-sample-impl.git
cd OpenVX-sample-impl
python3 Build.py --os=Linux --conf=Release
cd ..
mkdir build
cmake -DWITH_OPENVX=ON -DOPENVX_ROOT=/mnt/Projects/Projects/OpenVX-sample-impl/install/Linux/x64/Release/ ../opencv
make -j8
```

### 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-02-14 11:55:20 +03:00
Alexander Smorkalov e4b23cf96a Merge pull request #26920 from ConnorBaker:fix/cmake-matches-uses-regex
cmake/OpenCVDetectCUDAUtils.cmake: use IN_LIST to avoid regex matching valid capabilities
2025-02-14 11:54:05 +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 def8619648 Merge pull request #26917 from asmorkalov:as/static_fastcv
Switch to static instance of FastCV
2025-02-13 21:26:42 +03:00
Maksim Shabunin 45aa502549 Merge pull request #26915 from mshabunin:fix-png-be
Resolves #26913
Related(?): #25715 #26832
2025-02-13 16:58:15 +03:00
Alexander Smorkalov 5921aae2b3 Switch to static instance of FastCV on Linux. 2025-02-13 15:58:25 +03:00
Alexander Smorkalov 8e65075c1e Merge pull request #26895 from asmorkalov:as/mean_hal
Use HAL for cv::mean function too
2025-02-12 12:02:14 +03:00
Alexander Smorkalov 7aaada4175 Use HAL for cv::mean function too. 2025-02-12 08:51:20 +03:00
Alexander Smorkalov 62658fba24 Merge pull request #26908 from shyama7004:_DEBUG/NDEBUG
Fix _DEBUG/NDEBUG handling across modules
2025-02-12 08:18:16 +03:00
shyama7004 076bfa6431 Fix _DEBUG/NDEBUG handling across modules (#26151) 2025-02-11 22:00:44 +05:30
lve-gh d8c2f0bcdf Merge pull request #26884 from lve-gh:split8u_rvv_hal
[HAL] split8u RVV 1.0 #26884

### Pull Request Readiness Checklist
* Banana Pi BF3 (SpacemiT K1)
* Compiler: Syntacore Clang 18.1.4 (build 2024.12)
```
Geometric mean (ms)

                  Name of Test                   baseline  hal      hal
                                                    ui               vs
                                                                  baseline 
                                                                     ui
                                                                 (x-factor)
split::Size_Depth_Channels::(127x61, 8UC1, 2)     0.012   0.004     3.12   
split::Size_Depth_Channels::(127x61, 8UC1, 3)     0.019   0.006     2.91   
split::Size_Depth_Channels::(127x61, 8UC1, 4)     0.028   0.011     2.64   
split::Size_Depth_Channels::(127x61, 8UC1, 5)     0.067   0.033     2.02   
split::Size_Depth_Channels::(127x61, 8UC1, 6)     0.084   0.040     2.11   
split::Size_Depth_Channels::(127x61, 8UC1, 7)     0.103   0.055     1.88   
split::Size_Depth_Channels::(127x61, 8UC1, 8)     0.113   0.032     3.50   
split::Size_Depth_Channels::(640x480, 8UC1, 2)    0.454   0.179     2.54   
split::Size_Depth_Channels::(640x480, 8UC1, 3)    0.677   0.298     2.27   
split::Size_Depth_Channels::(640x480, 8UC1, 4)    0.901   0.410     2.20   
split::Size_Depth_Channels::(640x480, 8UC1, 5)    3.781   3.010     1.26   
split::Size_Depth_Channels::(640x480, 8UC1, 6)    4.886   4.009     1.22   
split::Size_Depth_Channels::(640x480, 8UC1, 7)    5.777   4.770     1.21   
split::Size_Depth_Channels::(640x480, 8UC1, 8)    4.596   1.330     3.46   
split::Size_Depth_Channels::(1280x720, 8UC1, 2)   1.377   0.709     1.94   
split::Size_Depth_Channels::(1280x720, 8UC1, 3)   2.091   1.034     2.02   
split::Size_Depth_Channels::(1280x720, 8UC1, 4)   2.744   1.573     1.74   
split::Size_Depth_Channels::(1280x720, 8UC1, 5)   9.542   6.284     1.52   
split::Size_Depth_Channels::(1280x720, 8UC1, 6)   11.114  7.850     1.42   
split::Size_Depth_Channels::(1280x720, 8UC1, 7)   14.083  11.879    1.19   
split::Size_Depth_Channels::(1280x720, 8UC1, 8)   13.524  3.865     3.50   
split::Size_Depth_Channels::(1920x1080, 8UC1, 2)  3.108   1.395     2.23   
split::Size_Depth_Channels::(1920x1080, 8UC1, 3)  4.659   2.128     2.19   
split::Size_Depth_Channels::(1920x1080, 8UC1, 4)  6.127   2.818     2.17   
split::Size_Depth_Channels::(1920x1080, 8UC1, 5)  26.733  16.625    1.61   
split::Size_Depth_Channels::(1920x1080, 8UC1, 6)  31.242  22.414    1.39   
split::Size_Depth_Channels::(1920x1080, 8UC1, 7)  35.968  27.658    1.30   
split::Size_Depth_Channels::(1920x1080, 8UC1, 8)  29.997  8.655     3.47
```
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-02-11 17:57:05 +03:00
Kababey 2364f4b0b9 Update optical_flow.cpp
ref: push_back is changed to emplace_back in order to avoid unnecessary conversions [Scalar(r, g, b))] .
2025-02-11 13:30:48 +03:00
Alexander Smorkalov 7eaddb8aa4 Merge pull request #26897 from shyama7004:typos-fix
fix hal_replacement typos
2025-02-11 09:37:08 +03:00
Maksim Shabunin 284660fb6c RISC-V: error message in the toolchain file when compiler is not found 2025-02-10 18:47:26 +03:00
shyama7004 a490623bf0 fix hal_replacement typos 2025-02-10 20:33:33 +05:30
Alexander Smorkalov 1e013a07c4 Merge pull request #26891 from MaximSmolskiy:refactor-test-for-filestorage-base64
Refactor test for FileStorage Base64
2025-02-10 13:31:29 +03:00
Alexander Smorkalov ce51023ad4 Merge pull request #26894 from Kumataro:fix26893
imgcodecs: tiff: refactor Imgcodecs_Tiff_decode_Huge test
2025-02-10 10:46:31 +03:00
Kumataro fbd8180cc1 imgcodecs: tiff: refactor reading scanlines test 2025-02-10 08:40:28 +09:00
MaximSmolskiy 4d23b56d98 Refactor test for FileStorage Base64 2025-02-09 01:38:14 +03:00
Alexander Smorkalov 0e17a879d7 Merge pull request #26890 from shyama7004:type-hint
fix wrong python type hints for imread
2025-02-08 11:19:36 +03:00
shyama7004 bbca50ecc5 fix wrong python type hints for imread 2025-02-08 11:17:34 +03:00
Kumataro 6c2d6bea2f Merge pull request #26889 from Kumataro:fix26877
doc: update supporting imgcodec format settings #26889

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

### 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-02-08 10:12:09 +03:00
RoshniUG b323780460 Merge pull request #26662 from RoshniUG:4.x
Update window_cocoa.mm #26662

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
- [x ] Added reference to the original bug report (#26661).
- [x]Updated the code as per the reviewer's suggestion to use a ternary operator.
- [x] Verified that the feature is properly documented and can be built with CMake.
2025-02-08 09:50:53 +03:00
Alexander Smorkalov aeac913203 Merge pull request #26882 from shyama7004:nullptr-setidentity
replace null literals with nullptr and optimize setidentity with std::fill
2025-02-07 17:18:49 +03:00
Alexander Smorkalov 740388b3ce Merge pull request #26867 from shyama7004:fix-meanStdDev
fix meanStdDev overflow for large images
2025-02-07 13:13:35 +03:00
shyama7004 987ba6504b fix meanStdDev overflow for large images 2025-02-07 10:17:48 +03:00
shyama7004 32d3d54ca1 replace null literals with nullptr; optimize setidentity with std::fill for cv_64fc1 2025-02-06 23:48:23 +05:30
天音あめ 2e909c38dc Merge pull request #26804 from amane-ame:norm_hal_rvv
Add RISC-V HAL implementation for cv::norm and cv::normalize #26804

This patch implements `cv::norm` with norm types `NORM_INF/NORM_L1/NORM_L2/NORM_L2SQR` and `Mat::convertTo` function in RVV_HAL using native intrinsic, optimizing the performance for `cv::norm(src)`, `cv::norm(src1, src2)`, and `cv::normalize(src)` with data types `8UC1/8UC4/32FC1`.

`cv::normalize` also calls `minMaxIdx`, #26789 implements RVV_HAL for this.

Tested on MUSE-PI for both gcc 14.2 and clang 20.0.

```
$ opencv_test_core --gtest_filter="*Norm*"
$ opencv_perf_core --gtest_filter="*norm*" --perf_min_samples=300 --perf_force_samples=300
```

The head of the perf table is shown below since the table is too long.

View the full perf table here: [hal_rvv_norm.pdf](https://github.com/user-attachments/files/18468255/hal_rvv_norm.pdf)

<img width="1304" alt="Untitled" src="https://github.com/user-attachments/assets/3550b671-6d96-4db3-8b5b-d4cb241da650" />

### 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-02-06 19:34:54 +03:00
Kumataro 01e3fe8791 Merge pull request #26859 from Kumataro:fix26858
imgcodecs:gif: support IMREAD_UNCHANGED and IMREAD_GRAYSCALE #26859

Close #26858 

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-02-06 19:29:54 +03:00
Malacath-92 7563cebad5 Merge pull request #26879 from Malacath-92:4.x
Add missing include in gislandmodel.hpp #26879

Add `<exception>`, `<string>`, and `<cstddef>` includes to `gislandmodel.hpp` which are required due to the usage of `std::exception_ptr`, `std::string`, and `size_t` in this header.

Notably one of those causes a build error on recent versions of Xcode: #26780 

### 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
- [N/A] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [N/A] The feature is well documented and sample code can be built with the project CMake
2025-02-06 13:34:46 +03:00
Alexander Smorkalov 9a566d772f Merge pull request #26878 from asmorkalov:as/respect_namespace_hal
Do not rely on cv namespace in HAL
2025-02-06 12:51:58 +03:00
Alexander Smorkalov b7663086fb Do not rely on cv namespace in HAL. 2025-02-06 10:00:28 +03:00
Suleyman TURKMEN e8e49ab7a8 Merge pull request #26872 from sturkmen72:ImageEncoders_revisions
Performance tests for image encoders and decoders and code cleanup #26872

### 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-02-04 12:21:55 +03:00
lawrencec98 59c3b6c995 Merge pull request #26600 from lawrencec98:Issue25250-lens-distortion-documentation-unclear
Issue25250 lens distortion documentation unclear #26600

### Pull Request Readiness Checklist

This pull request addresses the issue in https://github.com/opencv/opencv/issues/25250. Using the method recommended by oleg-alexandrov.

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-02-03 17:32:25 +03:00
Maksim Shabunin b310233ea4 CI: unified Linux pipeline (#26607) 2025-02-03 10:11:07 +03:00
Letu Ren 0fa61de22a Fix bayer2RGB_EA macro 2025-02-03 14:19:52 +08:00
Alexander Smorkalov 3356b36d72 Merge pull request #26863 from shyama7004:minor-change
minor change
2025-02-03 08:37:57 +03:00
Alexander Smorkalov 0e747e592b Merge pull request #26866 from opencv:revert-26857-patch-1
Revert "Update OpenCVFindWebP.cmake with sturkmen72's suggestion"
2025-02-03 08:25:17 +03:00
Letu Ren d6dc22d03c Fix build on RISC-V 2025-02-03 00:09:36 +08: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
shyama7004 0cfc2e8fd8 minor change 2025-01-31 21:12:36 +05:30
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
天音あめ 13b2caffe0 Merge pull request #26789 from amane-ame:minmax_hal_rvv
Add RISC-V HAL implementation for minMaxIdx #26789

On the RISC-V platform, `minMaxIdx` cannot benefit from Universal Intrinsics because the UI-optimized `minMaxIdx` only supports `CV_SIMD128` (and does not accept `CV_SIMD_SCALABLE` for RVV).

https://github.com/opencv/opencv/blob/1d701d1690b8cc9aa6b86744bffd5d9841ac6fd3/modules/core/src/minmax.cpp#L209-L214

This patch implements `minMaxIdx` function in RVV_HAL using native intrinsic, optimizing the performance for all data types with one channel.

Tested on MUSE-PI for both gcc 14.2 and clang 20.0.

```
$ opencv_test_core --gtest_filter="*MinMaxLoc*"
$ opencv_perf_core --gtest_filter="*minMaxLoc*"
```
<img width="1122" alt="Untitled" src="https://github.com/user-attachments/assets/6a246852-87af-42c5-a50b-c349c2765f3f" />

### 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-01-31 14:26:49 +03:00
Vincent Rabaud c21d0ad9d0 Merge pull request #26854 from vrabaud:png_leak
Fix oss-fuzz bugs 391934081 and 392318892 #26854

- fix a potential overflow in x0+w0
- use the proper function to deal with background color to deal with all cases of the spec
- use BGR layout for APNG background color

### 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 11:00:23 +03:00
Alexander Smorkalov 2f58f82e84 Merge pull request #26853 from horror-proton:rvv-fast-atan
Add RISC-V HAL implementation for fastAtan32f/fastAtan64f
2025-01-31 09:29:58 +03:00
Alexander Smorkalov ea404df069 Merge pull request #26856 from mshabunin:fix-rvv-tests-2
RISC-V: increase DotProduct test threshold a bit
2025-01-31 09:29:15 +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
Maksim Shabunin f6c9ca5602 RISC-V: increase DotProduct test threshold a bit 2025-01-30 15:09:32 +03:00
Alexander Smorkalov d5f69305cb Merge pull request #26851 from sturkmen72:fix-22551
fix related the issue 22551
2025-01-29 18:06:22 +03:00
Skreg bb798d15e1 Merge pull request #26831 from shyama7004:fix-denoising.cpp
Added 16-bit support to fastNlMeansDenoising and updated tests #26831

Fixes : #26582

### 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-29 15:45:40 +03:00
Horror Proton 86241653a7 Add RISC-V HAL implementation for cv::phase 2025-01-29 12:07:59 +08:00
Suleyman TURKMEN 585226a5fd fix for large tEXt chunk 2025-01-28 16:54:00 +03:00
Maxim Smolskiy 08a24ba2cf Merge pull request #26846 from MaximSmolskiy:fix_bug_with_int64_support_for_FileStorage
Fix bug with int64 support for FileStorage #26846

### Pull Request Readiness Checklist

Fix #26829, https://github.com/opencv/opencv-python/issues/1078

In current implementation of `int64` support raw size of recorded integer is variable (`4` or `8` bytes depending on value). But then we iterate over nodes we need to know it exact value
https://github.com/opencv/opencv/blob/dfad11aae7ef3b3a0643379266bc363b1a9c3d40/modules/core/src/persistence.cpp#L2596-L2609

Bug is that `rawSize` method still return `4` for any integer. I haven't figured out a way how to get variable raw size for integer in this method. I made raw size for integer is constant and equal to `8`.

Yes, after this patch memory consumption for integers will increase, but I don't know a better way to do it yet. At least this fixes bug and implementation becomes more correct

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-01-28 11:08:26 +03:00
Alexander Smorkalov 0049cde1f7 Merge pull request #26826 from devatbosch:4.x
Workaround solution for isuue #26818
2025-01-28 08:01:41 +03:00
Skreg e62ab4ff71 Merge pull request #26850 from shyama7004:update-headers
Update includes in filter.hpp #26850

Fixes :
```
identifier "Mat" is undefinedC/C++(20)
namespace "std" has no member "vector"C/C++(135)
```

### 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-28 07:26:40 +03:00
Kumataro c840e24e94 Merge pull request #26844 from Kumataro:fix26843
imgcodecs: jpegxl: imdecode() directly read from memory #26844

Close #26843 

### 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-01-27 17:18:28 +03:00
eplankin ae57c54d83 Merge pull request #26463 from eplankin:icv_update_2022.0.0
Update IPP integration #26463

Please merge together with https://github.com/opencv/opencv_3rdparty/pull/88
Supported IPP version was updated to IPP 2022.0.0 for Linux and Windows. 32-bit binaries are dropped since this release.

Previous update: https://github.com/opencv/opencv/pull/25935
2025-01-27 17:02:36 +03:00
Alexander Smorkalov f5c06f8b91 Merge pull request #26848 from vrabaud:png
Fix overlow pointers.
2025-01-27 16:54:10 +03:00
Alexander Smorkalov 4403e3bad8 Merge pull request #26847 from IHni3:4.x
Fix bug different marker ordering with findChessboardCornersSBWithMeta and CALIB_CB_LARGER flag
2025-01-27 16:10:55 +03:00
Alexander Smorkalov 33da8763a5 Merge pull request #26717 from s-trinh:add_border_type_doc_examples
Add examples for each `cv::BorderTypes` enum types in the documentation
2025-01-27 14:02:38 +03:00
Vincent Rabaud c5f6ed6fef Fix overlow pointers.
`step` and `maskStep` are used to increase/decrease `pImage`.
But it's done on unsigned type, relying on overflow, which is UB.
(step is size_t but seed.y is int and can be negative, the result
is therefore unsigned which can overflow)
2025-01-27 11:55:10 +01:00
tho 9dde7790cf fix bug different marker ordering with findChessboardCornersSBWithMeta and CALIB_CB_LARGER flag 2025-01-27 11:10:26 +01:00
s-trinh df5da4abcd Merge pull request #26754 from s-trinh:add_bibtex_direct_pdf_links
Add direct pdf links in the bibliography #26754

Update and add pdf links in the bibliography.

### 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-27 10:28:38 +03:00
Snehasish Basu 8a8e59c8fd Update predefined_types.py
Updated predefined_types.py to keep changes only as suggested in 

https://github.com/opencv/opencv/pull/26826#pullrequestreview-2572608505

https://github.com/opencv/opencv/pull/26826#issuecomment-2613926475
2025-01-27 10:52:28 +05:30
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
Alexander Smorkalov 6bffa64af4 Merge pull request #26841 from MaximSmolskiy:fix_data01.xml-file-for-example_cpp_logistic_regression
Fix data01.xml file for example_cpp_logistic_regression
2025-01-25 09:45:01 +03:00
Alexander Smorkalov c637dd2646 Merge pull request #26828 from sturkmen72:imgcodecs_improvements
Imgcodecs minor improvements for better code readibility
2025-01-25 09:41:10 +03:00
Suleyman TURKMEN d4eed1c5aa Merge pull request #26835 from sturkmen72:patch-4
Corrections on bKGD chunk writing and reading in PNG #26835 

### 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:31:00 +03:00
Rüdiger Ihle a2dd4ddbb2 Merge pull request #26837 from warped-rudi:zoom
Zoom functionality for Android native camera capture #26837

### 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:29:00 +03:00
MaximSmolskiy 8cb3ef177c Fix data01.xml file for example_cpp_logistic_regression 2025-01-25 00:53:52 +03:00
Suleyman TURKMEN ca51d55ee3 minor improvement for better code readibility 2025-01-24 15:31:53 +03:00
Gou Minghao 9bb01e799f Merge pull request #26669 from GouMinghao:4.x
solvePnPRansac implementation for Fisheye camera model #26669

Related: https://github.com/opencv/opencv/pull/25028

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-01-24 14:51:10 +03:00
Pierre Chatelier 3cbb4acd2d Merge pull request #26836 from chacha21:thresholding_compute_threshold_only
Add cv::THRESH_DRYRUN flag to get adaptive threshold values without thresholding #26836

A first proposal for #26777

Adds a `cv::THRESH_DRYRUN` flag to let cv::threshold() compute the threshold (useful for OTSU/TRIANGLE), but without actually running the thresholding. This flags is a proposal instead of a new function cv::computeThreshold()

- [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-01-24 14:25:21 +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
Alexander Smorkalov 9a77bef92b Merge pull request #26832 from vrabaud:png
Move the checks to read_chunk.
2025-01-24 12:53:09 +03:00
Alexander Smorkalov a3e95ec6d0 Merge pull request #26660 from NekoAsakura:4.x
Cocoa/highgui: replace with `@autoreleasepool` blocks
2025-01-24 11:34:27 +03:00
Vincent Rabaud 4e4eaea9a3 Move the checks to read_chunk.
Only user chunks need to be compared to PNG_USER_CHUNK_MALLOC_MAX
2025-01-23 16:37:46 +01:00
Alexander Smorkalov 4a4031dc48 Merge pull request #26601 from dai-xin:4.x
VideoCapture open camera slow
2025-01-22 20:48:29 +03:00
Rüdiger Ihle c623a5afc1 Merge pull request #26646 from warped-rudi:refactoring
Android camera refactoring #26646

This patch set does not contain any functional changes. It just cleans up the code structure to improve readability and to prepare for future changes.

* videoio(Android): Use 'unique_ptr' instead of 'shared_ptr'
Using shared pointers for unshared data is considered an antipattern.
* videoio(Android): Make callback functions private static members
Don't leak internal functions into global namespace. Some member
variables are now private as well.
* videoio(Android): Move resolution matching into separate function
Also make internally used member functions private.
* videoio(Android): Move ranges query into separate function
Also remove some unneccessary initialisations from initCapture().
* videoio(Android): Wrap extremly long source code lines
* videoio(Android): Rename members of 'RangeValue'

### 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-01-22 16:58:14 +03:00
Vincent Rabaud 7728dd3387 Merge pull request #26782 from vrabaud:png_leak
Fix potential READ memory access #26782

This fixes https://oss-fuzz.com/testcase-detail/4923671881252864 and https://oss-fuzz.com/testcase-detail/5048650127966208

### 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-22 14:47:28 +03:00
Skreg f6aa472acc Merge pull request #26800 from shyama7004:fix-cap-orientation-auto-default
Fixed default cap_prop_orientation_auto behaviour #26800

Fixes : #26795

### 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-22 13:55:48 +03:00
Skreg 055dbbb848 Merge pull request #26815 from shyama7004:fix-deprecation
Replaced sprintf with snprintf #26815

Fixes : #26814

### 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-22 13:53:59 +03:00
Maxim Smolskiy 8ab0ad6e1b Merge pull request #26810 from MaximSmolskiy:improve-robustness-for-fitEllipseAMS
Improve robustness for fitEllipseAMS #26810

### Pull Request Readiness Checklist

Related to #26694 

Added functionality to add noise to points in degenerate cases and try again for `fitEllipseAMS`. `fitEllipseNoDirect` and `fitEllipseDirect` already have this

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-01-22 12:49:12 +03:00
Kumataro ea023b72ce Merge pull request #26788 from Kumataro:fix26767
jpegxl: support cv::IMREAD_UNCHANGED and other ImreadFlags #26788

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

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2025-01-22 10:50:43 +03:00
Suleyman TURKMEN db962ea069 Merge pull request #26813 from sturkmen72:fix_animation
Added CV_WRAP to Animation struct #26813

closes #26808
### 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-22 10:40:08 +03:00
Alexander Smorkalov 459bb12466 Merge pull request #26778 from vidipsingh:doc-fix-fontscale-behavior-puttext
Added fontScale behavior description to putText() documentation
2025-01-21 11:21:42 +03:00
Skreg fe9405e8c0 Merge pull request #26806 from shyama7004:fix-typo
* fix a small typo

* removal of unused variable
2025-01-20 17:14:27 +03:00
Maxim Smolskiy a2a3f5e86c Merge pull request #26773 from MaximSmolskiy:improve-robustness-for-ellipse-fitting
Improve robustness for ellipse fitting #26773

### Pull Request Readiness Checklist

Related to #26694 

Current noise addition is not very good because for example it turns degenerate case of one horizontal line into degenerate case of two parallel horizontal lines

Improving noise addition leads to improved robustness of algorithms

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-01-20 14:25:40 +03:00
Alexander Smorkalov 6f24d755f2 Merge pull request #26798 from brad0:opencv_powerpc_elf_aux_info
Add CMake checks for getauxval and elf_aux_info for POWER
2025-01-20 13:33:46 +03:00
Alexander Smorkalov 2db6b29a76 Merge pull request #26787 from MaximSmolskiy:fix_memory_leaks_for_JpegXLDecoder
Fix memory leaks for JpegXLDecoder
2025-01-20 13:33:10 +03:00
Alexander Smorkalov 5949cb10ee Merge pull request #26793 from UnnamedOrange:4.x
Fix an is-empty condition in FFmpeg video capture when parsing FFmpeg options defined in the environment variables
2025-01-20 11:30:42 +03:00
Kumataro 3e1fafefbe Merge pull request #26802 from Kumataro:fix26801
3rdparty:ittnotify: update to v3.25.4 #26802

Close https://github.com/opencv/opencv/issues/26801
See https://github.com/opencv/opencv/pull/26797

### 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-20 10:54:13 +03:00
Alexander Smorkalov 133fda3c56 Merge pull request #26803 from brad0:opencl_openbsd
OpenCL: OpenBSD build fix
2025-01-20 09:31:46 +03:00
Alexander Smorkalov 16cbdcf582 Merge pull request #26805 from MaximSmolskiy:fix-typo-in-matchTemplate-description
Fix typo in matchTemplate description
2025-01-20 09:28:12 +03:00
Brad Smith 918196ec1b Add CMake checks for getauxval and elf_aux_info for POWER
- Change __unix__ check for feature detection. NetBSD does not
have either API.
- Adds support for OpenBSD/powerpc64.
2025-01-19 13:27:20 -05:00
MaximSmolskiy 500e1ff763 Fix typo in matchTemplate description 2025-01-19 17:31:03 +03:00
Brad Smith 93023e1a68 OpenCL: OpenBSD build fix 2025-01-19 02:46:25 -05:00
Maksim Shabunin 3effe195cb Merge pull request #26786 from mshabunin/fix-ppc64-gcc15
core: fixed VSX build with GCC 15
2025-01-18 16:13:28 +03:00
UnnamedOrange 8482caf348 Fix an is-empty condition in FFmpeg video capture 2025-01-18 17:01:22 +08:00
MaximSmolskiy b7e1cba660 Fix memory leaks for JpegXLDecoder 2025-01-17 00:39:32 +03:00
Maksim Shabunin 63ef786a3a core: fixed VSX build with GCC 15 2025-01-16 23:48:29 +03:00
Neko Asakura eff12685c5 Cocoa/highgui: replace with @autoreleasepool blocks and clean up extraneous comments 2025-01-16 11:40:41 +08:00
Vidip Singh 6ba8f4838b Added fontScale behavior description to putText() documentation
- Updated the documentation of the putText function to clarify the behavior of the fontScale parameter.
- Explained how fontScale affects text rendering: magnifying (>1), minimizing (<1), and mirroring (<0).
2025-01-15 19:17:29 +05:30
Alexander Smorkalov 1d701d1690 Merge pull request #26776 from vrabaud:ub_warp
Don't overflow pointer addition
2025-01-15 15:19:19 +03:00
Vincent Rabaud e76924ef0d Don't overflow pointer addition
In both cases we add negative value (as unsigned type), so
pointer addition wraps, which is undefined behavior.
2025-01-15 11:07:43 +01:00
Alexander Smorkalov 796adf5dc6 Merge pull request #26769 from y-guyon:patch-1
Avoid adding value to nullptr
2025-01-14 19:06:52 +03:00
Alexander Smorkalov 1a6ef7e08c Merge pull request #26765 from asmorkalov:as/android_vulkan_build_fix
Fixed Android build with Vulkan support.
2025-01-14 16:23:22 +03:00
Yannis Guyon b62ab874d1 Avoid adding value to nullptr
This UB can be avoided by postponing calculation until needed.
2025-01-14 10:50:53 +01:00
Alexander Smorkalov 534243647e Fixed Android build with Vulkan support. 2025-01-13 21:13:22 +03:00
Alexander Smorkalov 342ced1e04 Merge pull request #26763 from vrabaud:remove_c
Remove useless C headers
2025-01-13 20:23:10 +03:00
Vincent Rabaud bfb54aa691 Remove useless C headers 2025-01-13 16:34:28 +01:00
Alexander Smorkalov 6931a4cc06 Merge pull request #26744 from Diego1V:fixHoughSIGSEGV
Fix #26086 - Update types inside HoughLinesProbabilistic
2025-01-13 13:05:21 +03:00
Skreg 08a88816ed Merge pull request #26753 from shyama7004:RotatedMarkers
Fix rotated aruco marker board generation #26753

### Issue : [25884](https://github.com/opencv/opencv/issues/25884)
### 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-13 10:51:03 +03:00
Alexander Smorkalov d6f60d4ab8 Merge pull request #26757 from shyama7004:test-fix
fix threshold for photo_calibratedebevec regression test
2025-01-13 10:25:18 +03:00
Diego1V 052b2c43c3 Update types inside HoughLinesProbabilistic in order to handle great images. 2025-01-13 09:36:44 +03:00
shyama7004 5b7b887200 Photo_CalibrateDebevec.regression-fix 2025-01-12 19:45:22 +05:30
Maksym Ivashechkin e29a70c17f Merge pull request #26742 from ivashmak:fix_homography_inliers
Bug fix for #25546 - Updating inliers for homography estimation #26742

Fixes #25546

### 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-11 18:08:58 +03:00
Super 2c2866a7a6 Merge pull request #26738 from redhecker:fix
Fix bugs in GIF decoding #26738 

### Pull Request Readiness Checklist

this is related to #25691 

i solved two bugs here:

1. the decoding setting:
according to [https://www.w3.org/Graphics/GIF/spec-gif89a.txt](https://www.w3.org/Graphics/GIF/spec-gif89a.txt)

```
    DEFERRED CLEAR CODE IN LZW COMPRESSION

    There has been confusion about where clear codes can be found in the
    data stream.  As the specification says, they may appear at anytime.  There
    is not a requirement to send a clear code when the string table is full.

    It is the encoder's decision as to when the table should be cleared.  When
    the table is full, the encoder can chose to use the table as is, making no
    changes to it until the encoder chooses to clear it.  The encoder during
    this time sends out codes that are of the maximum Code Size.

    As we can see from the above, when the decoder's table is full, it must
    not change the table until a clear code is received.  The Code Size is that
    of the maximum Code Size.  Processing other than this is done normally.

    Because of a large base of decoders that do not handle the decompression in
    this manner, we ask developers of GIF encoding software to NOT implement
    this feature until at least January 1991 and later if they see that their
    particular market is not ready for it.  This will give developers of GIF
    decoding software time to implement this feature and to get it into the
    hands of their clients before the decoders start "breaking" on the new
    GIF's.  It is not required that encoders change their software to take
    advantage of the deferred clear code, but it is for decoders.
```
at first i didn't consider this case, thus leads to a bug discussed in #25691. the changes made in function lzwDecode() is aiming at solving this.

2. the fetch method of loopCount:
in the codes at https://github.com/opencv/opencv/blob/4.x/modules/imgcodecs/src/grfmt_gif.cpp#L410, if the branch is taken, 3 more bytes will be taken, leading to unpredictable behavior.

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-11 10:34:49 +03:00
Alexander Smorkalov 1e31f8047d Merge pull request #26748 from vrabaud:png_leak
Fix remaining bugs in PNG reader
2025-01-11 10:21:38 +03:00
Alexander Smorkalov bb79493a89 Merge pull request #26750 from mshabunin:fix-ppc64-vsx
core: fixed VSX intrinsics implementation
2025-01-11 09:40:21 +03:00
Vincent Rabaud ee86f1c969 Fix remaining bugs in PNG reader
- free chunk before a potential longjmp
- do not try to allocate when the chunk is > PNG_USER_CHUNK_MALLOC_MAX
2025-01-10 17:04:39 +01:00
Maksim Shabunin 97f3f39066 core: fixed VSX intrinsics implementation 2025-01-10 18:34:11 +03:00
Skreg f00814e38d Merge pull request #26602 from shyama7004:minor-fix
Improved dumpVector, cv::Rect operator<< and exceptions #26602

- Applied format for vector element formatting to ensure consistent and clear output representation.  
- Moved `operator<<` to the `cv` namespace to align with OpenCV's coding standards and improve maintainability.  
- Enhanced error handling by including detailed exception messages using `e.what()` for better debugging.  

### 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-10 15:02:18 +03:00
Junrou Nishida 85f9ac4e23 Merge pull request #26713 from homuler:fix/build-ios-framework
Ensure Obj-C header files are generated correctly if under /private/var #26713

Fix #26712 

### 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-01-10 14:48:56 +03:00
Alexander Smorkalov 68187de4ad Merge pull request #26741 from shyama7004:minor-update
added POST_BUILD to add_custom_command in python_loader.cmake to avoid warning
2025-01-10 13:39:58 +03:00
Vincent Rabaud d12fa37eed Merge pull request #26739 from vrabaud:png_leak
Add more boundary checks. #26739

Also fix a bug in read_chunk where we could end up with png_get_uint_32(len) + 12 < 4

### 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-10 11:33:43 +03:00
shyama7004 05bc484eed addition of POST_BUILD 2025-01-09 20:40:56 +05:30
Alexander Smorkalov bdb6a968ce Merge pull request #26706 from Kumataro:fix26705
imgcodecs: fix EXR tests
2025-01-09 15:46:52 +03:00
Alexander Smorkalov 0da8c760d3 Merge pull request #26710 from Kumataro:fix26709
core: validate OPENCV_ALGO_HINT_DEFAULT option
2025-01-09 15:44:19 +03:00
Alexander Smorkalov 7e7c75e239 Merge pull request #26737 from shyama7004:minor-change
minor change
2025-01-09 15:14:28 +03:00
shyama7004 938f89a20e minor change 2025-01-08 20:17:17 +05:30
Alexander Smorkalov d744296bbd Merge branch 'as/release_4.11.0' into 4.x 2025-01-08 17:25:28 +03:00
Alexander Smorkalov 31b0eeea0b Release 4.11.0 2025-01-08 15:47:46 +03:00
Alexander Smorkalov d2704548b4 Merge pull request #26734 from asmorkalov:as/png_corrupted
Fixed fread size check for corrupted PNGs
2025-01-08 15:47:19 +03:00
Alexander Smorkalov 198f23890e Fixed fread size check for corrupted PNGs. 2025-01-08 14:23:43 +03:00
Alexander Smorkalov 66ffeae4b1 Merge pull request #26728 from vrabaud:png_behavior
Fix behavior change when PNG buffer is incomplete.
2025-01-08 13:23:02 +03:00
Alexander Smorkalov 38b86591ba Merge pull request #26729 from MaximSmolskiy:change-article-for-fitEllipseDirect-function
Change article for fitEllipseDirect function
2025-01-08 12:14:45 +03:00
Vincent Rabaud cb959b3915 Fix behavior change when PNG buffer is incomplete. 2025-01-08 09:11:38 +01:00
Alexander Smorkalov e34eff9ab2 Merge pull request #26721 from MaximSmolskiy:fix-comment-for-fitEllipse-Java-case-accurracy-test
Fix comment for fitEllipse Java case accurracy test
2025-01-08 11:09:32 +03:00
Alexander Smorkalov 0dfd2b3628 Merge pull request #26719 from MaximSmolskiy:remove-code-duplication-from-tests-for-ellipse-fitting
Remove code duplication from tests for ellipse fitting
2025-01-08 11:07:55 +03:00
Alexander Smorkalov 4b35101d55 Merge pull request #26720 from vrabaud:png_leak
Use RAII to avoid leaks in PNG reader.
2025-01-08 10:57:28 +03:00
Alexander Smorkalov d5087a2bd6 Merge pull request #26726 from vrabaud:png_comment
Remove extra /* in /**/ comment
2025-01-08 10:56:59 +03:00
MaximSmolskiy 0331af01ae Change article for fitEllipseDirect function 2025-01-07 22:24:48 +03:00
Vincent Rabaud 0e3d71b0e0 Remove extra /* in /**/ comment 2025-01-07 11:49:30 +01:00
MaximSmolskiy 9b85ab0a63 Fix comment for fitEllipse Java case accurracy test 2025-01-06 19:14:57 +03:00
Vincent Rabaud d86387347d Use RAII to avoid leaks in PNG reader. 2025-01-06 16:42:30 +01:00
MaximSmolskiy 56dd9d51b1 Remove code duplication from tests for ellipse fitting 2025-01-06 17:13:32 +03:00
Masahiro Ogawa fc994a6ae8 Merge pull request #21407 from sensyn-robotics:feature/weighted_hough
Feature: weighted Hough Transform #21407

### 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 other license that is incompatible with OpenCV
- [x] The PR is proposed to proper branch
- [x] There is reference to 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-01-06 15:35:35 +03:00
Suleyman TURKMEN 2aee94752a Merge pull request #26714 from sturkmen72:png
Fix for png durations and memory leak #26714

### 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-01-06 14:25:08 +03:00
Alexander Smorkalov 904dbe9555 Merge pull request #26716 from MaximSmolskiy:fix-tests-for-ellipse-fitting
Fix tests for ellipse fitting
2025-01-06 14:07:29 +03:00
Alexander Smorkalov 3d7eb55f75 Merge pull request #26715 from asmorkalov:as/png_leak
Fixed some memory leaks in PNG/APNG implementation
2025-01-06 12:00:17 +03:00
Alexander Smorkalov ad36f68500 Fixed some memory leaks in PNG/APNG implementation. 2025-01-06 10:41:33 +03:00
Souriya Trinh 5000ec50db Add examples for each cv::BorderTypes enum types to better illustrate the result of each method in the documentation. 2025-01-06 03:57:35 +01:00
MaximSmolskiy 3e534bb7c8 Fix tests for ellipse fitting 2025-01-06 01:27:06 +03:00
Alexander Smorkalov ff18c9cc79 Merge pull request #26688 from sturkmen72:gif-png-webp-avif
Animated GIF APNG WEBP AVIF revisions
2025-01-04 16:44:14 +03:00
Rüdiger Ihle a6f72f813d Merge pull request #26698 from warped-rudi:mediandk2
AndroidMediaNdkVideoWriter pixel format enhancement #26698

* videoio(Android): Add source pixel formats RGBA and GRAY to AndroidMediaNdkVideoWriter

Let AndroidMediaNdkVideoWriter::write() deduce source pixel format from matrix type:

CV_8UC3 -> BGR   (as before)
CV_8UC4 -> RGBA  (use in conjunction with CvCameraViewFrame)
CV_8UC1 -> GRAY

* samples/android/video-recorder: Send images to VideoWriter in RGBA format

### 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-03 17:53:00 +03:00
Alexander Smorkalov f65006eee1 Merge pull request #26699 from vrabaud:bmp_overflow
Fix integer overflow in in cv::BmpDecoder::readHeader
2025-01-03 14:43:23 +03:00
Suleyman TURKMEN b4d0325666 GIF APNG WEBP AVIF revisions 2025-01-03 14:29:18 +03:00
Vincent Rabaud 0538e64b13 Fix leaks in cv:Merge pull request #26701 from vrabaud:png_leak
Fix leaks in cv::PngDecoder #26701

Bug: oss-fuzz:386688709

### 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-01-03 14:13:18 +03:00
Kumataro b9505ac861 core: validate OPENCV_ALGO_HINT_DEFAULT option 2025-01-03 19:22:57 +09:00
Alexander Smorkalov 9e8b9a0ebb Merge pull request #26695 from albertoZurini:py_pose_coordinates
fix: cast coordinates to int32 for compatibility with line function
2025-01-03 11:43:30 +03:00
Vincent Rabaud 845616d82c Fix integer overflow in in cv::BmpDecoder::readHeader
Bug: oss-fuzz:371546812
2025-01-03 08:59:43 +01:00
Alexander Smorkalov 5e1eed5026 Merge pull request #26700 from vrabaud:png_buffer_overflow
Fix heap buffer overflow in cv::PngDecoder::read_from_io
2025-01-03 10:39:23 +03:00
Alexander Smorkalov ffd0548651 Merge pull request #26704 from vrabaud:imgcodecs_flaky
Fix flaky Imgcodecs_APNG.imwriteanimation_bgcolor
2025-01-03 10:25:06 +03:00
Kumataro 1281317e17 imgcodecs: fix EXR tests 2025-01-03 09:53:01 +09:00
Vincent Rabaud 2f0035b23f Fix flaky Imgcodecs_APNG.imwriteanimation_bgcolor 2025-01-02 22:53:06 +01:00
MaximSmolskiy ab0a818c84 Fix matchTemplate with mask crash 2025-01-02 22:14:08 +03:00
Vincent Rabaud 12963ea699 Fix heap buffer overflow in cv::PngDecoder::read_from_io
Bug: oss-fuzz:386688710
2025-01-02 14:51:20 +01:00
Alberto Zurini f2878eb337 fix: cast coordinates to int32 for compatibility with line function 2025-01-01 21:13:40 +01:00
Alexander Smorkalov 4d26e16af8 Merge pull request #26690 from MaximSmolskiy:speed-up-and-reduce-memory-consumption-for-findContours
Speed up and reduce memory consumption for findContours
2024-12-31 12:31:11 +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 269ff8cd83 Merge pull request #26691 from asmorkalov:as/unstable_vkcom
Tune threshold to stabinlize test with Vulkan backend.
2024-12-31 10:35:44 +03:00
Alexander Smorkalov d2264d5868 Tune threshold to stabinlize test with Vulkan backend. 2024-12-31 10:23:13 +03:00
MaximSmolskiy f15fa21c6b Speed up and reduce memory consumption for findContours 2024-12-31 02:49:15 +03:00
Suleyman TURKMEN 8bc65a1d13 Merge pull request #25715 from sturkmen72:apng_support
Animated PNG Support #25715

Continues https://github.com/opencv/opencv/pull/25608

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-12-30 11:32:31 +03:00
Rüdiger Ihle d39aae6bdf Merge pull request #26656 from warped-rudi:mediandk
AndroidMediaNdkCapture pixel format enhancement #26656

### 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
- [ 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-30 11:09:11 +03:00
Alexander Smorkalov 9c33baebbd Merge pull request #26675 from hanliutong:rvv-hal-fix
Add test cases and fix bugs in the RISC-V Vector HAL.
2024-12-29 18:09:21 +03:00
Alexander Alekhin 1b48eafe48 Merge pull request #26672 from opencv-pushbot:gitee/alalek/update_ffmpeg_4.x 2024-12-29 01:42:29 +00:00
Liutong HAN b31f7694c5 Add test cases and fix bugs in the RVV HAL. 2024-12-27 08:39:52 +00: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
Alexander Smorkalov aeb7a9b383 Merge pull request #26671 from asmorkalov:as/fastcv_cmake_fix
Sevral fixes for FastCV handling.
2024-12-26 18:36:08 +03:00
Alexander Smorkalov 707ab39454 Merge pull request #26164 from CSBVision:patch-7
Update haveCUDA() to detect CUDA support at runtime
2024-12-26 15:56:03 +03:00
Alexander Alekhin c64fe91ff4 ffmpeg/4.x: update FFmpeg wrapper 2024.12 2024-12-26 12:30:48 +00:00
Alexander Alekhin 4c7ea70051 videoio(test): re-enable FFmpeg tests on WIN32
- related PR25874
2024-12-26 12:29:45 +00:00
Alexander Alekhin 09892c9d17 fix FFmpeg wrapper build 2024-12-26 12:15:46 +00:00
Dmitry Kurtaev e9982e856f Merge pull request #25584 from dkurt:videocapture_from_buffer
Open VideoCapture from data stream #25584

### Pull Request Readiness Checklist

Add VideoCapture option to read a raw binary video data from `std::streambuf`.

There are multiple motivations:
1. Avoid disk file creation in case of video already in memory (received by network or from database).
2. Streaming mode. Frames decoding starts during sequential file transfer by chunks.

Suppoted backends:
* FFmpeg
* MSMF (no streaming mode)

Supporter interfaces:
* C++ (std::streambuf)
* Python (io.BufferedIOBase)

resolves https://github.com/opencv/opencv/issues/24400

- [x] test h264
- [x]  test IP camera like approach with no metadata but key frame only?
- [x] C API plugin

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
2024-12-26 12:48:49 +03:00
Alexander Smorkalov 745a12c03b Sevral fixes for FastCV handling. 2024-12-26 09:54:09 +03:00
Alexander Smorkalov 96d6395a6d Merge pull request #26668 from WangWeiLin-MV:gstreamer/add-include-chrono
Add include chrono gstreamersource.cpp
2024-12-24 18:44:49 +03:00
WangWeiLin-MV fe649f4adb Add include chrono gstreamersource.cpp 2024-12-24 06:53:30 +00:00
Alexander Smorkalov f106866d3e Merge pull request #26666 from mshabunin:fix-rvv-tests
RISC-V: enabled intrinsics in dotProd, relaxed test thresholds
2024-12-24 08:59:25 +03:00
Maksim Shabunin 0756dbfe3d RISC-V: enabled intrinsics in dotProd, relaxed test thresholds 2024-12-24 00:58:54 +03:00
Alexander Smorkalov b42075f3e2 Merge pull request #26664 from asmorkalov:update_version_4.11.0-pre
pre: OpenCV 4.11.0 (version++)
2024-12-23 15:34:39 +03:00
Alexander Smorkalov 1399672a83 Merge pull request #26663 from mshabunin:cleanup-dnn-ie-test
dnn: remove obsolete OV models tests
2024-12-23 14:32:06 +03:00
Alexander Smorkalov a2ce9e1bac pre: OpenCV 4.11.0 (version++) 2024-12-23 13:58:08 +03:00
Maksim Shabunin ec2208f5f7 dnn: remove obsolete OV models tests 2024-12-23 12:59:33 +03:00
FantasqueX 4efd52f676 Merge pull request #26650 from FantasqueX:fix-26642
Use size_t when calculating size of all_points #26650

Closes: #26642 

Asan log
```
=================================================================
==41401==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7fc55a02a3fc at pc 0x7fc58e304131 bp 0x7ffd54787b00 sp 0x7ffd54787af8
WRITE of size 4 at 0x7fc55a02a3fc thread T0
    #0 0x7fc58e304130 in cv::QRDetectMulti::checkSets(std::vector<std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >, std::allocator<std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > > > >&, std::vector<std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >, std::allocator<std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > > > >&, std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >&) /home/fanta/source/opencv/modules/objdetect/src/qrcode.cpp:3726
    #1 0x7fc58e3054b0 in cv::QRDetectMulti::localization() /home/fanta/source/opencv/modules/objdetect/src/qrcode.cpp:3829
    #2 0x7fc58e308020 in cv::ImplContour::detectMulti(cv::_InputArray const&, cv::_OutputArray const&) const /home/fanta/source/opencv/modules/objdetect/src/qrcode.cpp:3987
    #3 0x7fc58e30b5b1 in cv::ImplContour::detectAndDecodeMulti(cv::_InputArray const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, cv::_OutputArray const&, cv::_OutputArray const&) const /home/fanta/source/opencv/modules/objdetect/src/qrcode.cpp:4176
    #4 0x7fc58e28922f in cv::GraphicalCodeDetector::detectAndDecodeMulti(cv::_InputArray const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, cv::_OutputArray const&, cv::_OutputArray const&) const /home/fanta/source/opencv/modules/objdetect/src/graphical_code_detector.cpp:42
    #5 0x5954e8 in Body /home/fanta/source/opencv/modules/objdetect/test/test_qrcode.cpp:48
    #6 0x594fc0 in TestBody /home/fanta/source/opencv/modules/objdetect/test/test_qrcode.cpp:42
    #7 0x67ee6a in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /home/fanta/source/opencv/modules/ts/src/ts_gtest.cpp:3919
    #8 0x6734a4 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /home/fanta/source/opencv/modules/ts/src/ts_gtest.cpp:3955
    #9 0x641fe8 in testing::Test::Run() /home/fanta/source/opencv/modules/ts/src/ts_gtest.cpp:3993
    #10 0x6431ac in testing::TestInfo::Run() /home/fanta/source/opencv/modules/ts/src/ts_gtest.cpp:4169
    #11 0x643d15 in testing::TestCase::Run() /home/fanta/source/opencv/modules/ts/src/ts_gtest.cpp:4287
    #12 0x659ff3 in testing::internal::UnitTestImpl::RunAllTests() /home/fanta/source/opencv/modules/ts/src/ts_gtest.cpp:6662
    #13 0x681205 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/fanta/source/opencv/modules/ts/src/ts_gtest.cpp:3919
    #14 0x675127 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/fanta/source/opencv/modules/ts/src/ts_gtest.cpp:3955
    #15 0x65734c in testing::UnitTest::Run() /home/fanta/source/opencv/modules/ts/src/ts_gtest.cpp:6271
    #16 0x5907f0 in RUN_ALL_TESTS() /home/fanta/source/opencv/modules/ts/include/opencv2/ts/ts_gtest.h:22240
    #17 0x590cdd in main (/home/fanta/source/opencv-build-4.x-clang/bin/opencv_test_objdetect+0x590cdd) (BuildId: a9363fc788d57c48225fc0559ac9199d07d415db)
    #18 0x7fc58ab242ad in __libc_start_call_main (/lib64/libc.so.6+0x2a2ad) (BuildId: 03f1631dc9760d3e30311fe62e15cc4baaa89db7)
    #19 0x7fc58ab24378 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x2a378) (BuildId: 03f1631dc9760d3e30311fe62e15cc4baaa89db7)
    #20 0x417014 in _start ../sysdeps/x86_64/start.S:115

0x7fc55a02a3fc is located 0 bytes after 2938510332-byte region [0x7fc4aadc8800,0x7fc55a02a3fc)
allocated by thread T0 here:
    #0 0x7fc58e590298 in operator new(unsigned long) (/lib64/libasan.so.8+0xfd298) (BuildId: da72ee674d801ced58193987786b90646d94ff8d)
    #1 0x7fc58e34d010 in std::__new_allocator<cv::Vec<int, 3> >::allocate(unsigned long, void const*) /usr/include/c++/14/bits/new_allocator.h:151

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/fanta/source/opencv/modules/objdetect/src/qrcode.cpp:3726 in cv::QRDetectMulti::checkSets(std::vector<std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >, std::allocator<std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > > > >&, std::vector<std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >, std::allocator<std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > > > >&, std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >&)

Shadow bytes around the buggy address:
  0x7fc55a02a100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7fc55a02a180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7fc55a02a200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7fc55a02a280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x7fc55a02a300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x7fc55a02a380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00[04]
  0x7fc55a02a400: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x7fc55a02a480: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x7fc55a02a500: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x7fc55a02a580: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x7fc55a02a600: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==41401==ABORTING
```

`(true_points_group[i].size()` is 1794 and `(true_points_group[i].size() - 2 ) * (true_points_group[i].size() - 1) * true_points_group[i].size())` is 5764222464 which overflows `int`

### 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-23 11:36:39 +03:00
alexlyulkov aa52dafc90 Merge pull request #26127 from alexlyulkov:al/blob-from-images
Faster implementation of blobFromImages for cpu nchw output #26127

Faster implementation of blobFromImage and blobFromImages for
HWC cv::Mat images -> NCHW cv::Mat
case

Running time on my pc in ms:

**blobFromImage**
```
image size            old        new   speed-up
32x32x3             0.008      0.002       4.0x
64x64x3             0.021      0.009       2.3x
128x128x3           0.164      0.037       4.4x
256x256x3           0.728      0.158       4.6x
512x512x3           3.310      0.628       5.2x
1024x1024x3        14.503      3.124       4.6x
2048x2048x3        61.647     28.049       2.2x
```

**blobFromImages**
```
image size            old        new   speed-up
16x32x32x3          0.122      0.041       3.0x
16x64x64x3          0.790      0.165       4.8x
16x128x128x3        3.313      0.652       5.1x
16x256x256x3       13.495      3.127       4.3x
16x512x512x3       58.795     28.127       2.1x
16x1024x1024x3    251.135    121.955       2.1x
16x2048x2048x3   1023.570    487.188       2.1x
```


### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-12-23 10:04:34 +03:00
Letu Ren f1a775825f Use universal intrinsics in bayer2Gray 2024-12-21 23:29:39 +08:00
Suleyman TURKMEN d9a139f9e8 Merge pull request #25608 from sturkmen72:animated_webp_support
Animated WebP Support #25608

related issues #24855 #22569 

### 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-20 13:06:28 +03:00
alex-urm 0903061589 Merge pull request #25500 from alex-urm:v4l_default_image_size
V4l default image size #25500

Added ability to set default image width and height for V4L capture.  This is required for cameras that does not support 640x480 resolution because otherwise V4L capture cannot be opened and failed with "Pixel format of incoming image is unsupported by OpenCV" and then with "can't open camera by index" message. Because of the videoio architecture it is not possible to insert actions between CvCaptureCAM_V4L::CvCaptureCAM_V4L and CvCaptureCAM_V4L::open so the only way I found is to use environment variables to preselect the resolution.

Related bug report is [#25499](https://github.com/opencv/opencv/issues/25499)
Maybe (but not confirmed) this is also related to [#24551](https://github.com/opencv/opencv/issues/24551)

This fix was made and verified in my local environment: capture board AVMATRIX VC42, Ubuntu 20, NVidia Jetson Orin.

### 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-20 11:00:30 +03:00
Alexander Smorkalov f3d9d56ebe Merge pull request #26625 from NekoAsakura:4.x
Cocoa/highgui: fix leak in cvGetWindowRect_COCOA
2024-12-20 09:03:33 +03:00
Alexander Smorkalov 8ffc4a6bd5 Merge pull request #26652 from mshabunin:fix-ffmpeg-plugin
videoio: fixed writer setProperty with FFmpeg plugin
2024-12-20 08:31:13 +03:00
Maksim Shabunin b53fa94745 videoio: fixed writer setProperty with FFmpeg plugin 2024-12-19 22:04:24 +03:00
Alexander Smorkalov 6a0affdbce Merge pull request #26147 from vrabaud:opencv_js
js: fix enum generation issues
2024-12-19 17:35:16 +03:00
Alexander Smorkalov 3073ba28cc Merge pull request #26644 from vrabaud:opencv_js2
js: Fix C preprocessor stringification
2024-12-19 17:05:50 +03:00
Alexander Smorkalov 5baca5275e Merge pull request #26633 from asmorkalov:as/optional_python_types
Made some pre-defined Python types optional to disable modules
2024-12-19 15:10:08 +03:00
quic-apreetam d037b40faa Merge pull request #26621 from CodeLinaro:apreetam_2ndPost
FastCV-based HAL for OpenCV acceleration 2ndpost-3 #26621

### Detailed description:

- Add cv_hal_canny for Canny API

Requires binary from [opencv/opencv_3rdparty#90](https://github.com/opencv/opencv_3rdparty/pull/90) 
Depends on: [opencv/opencv#26617](https://github.com/opencv/opencv/pull/26617)
Depends on: [opencv/opencv#26619](https://github.com/opencv/opencv/pull/26619) 

### 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
2024-12-19 13:31:26 +03:00
Suleyman TURKMEN 60d35d1bd5 Merge pull request #26511 from sturkmen72:proposed_fix_for_21902
* add alternative flags to cv::seamlessClone

* Update photo.hpp

* Update seamless_cloning.cpp

* Update seamless_cloning_impl.cpp
2024-12-19 11:57:58 +03:00
Alexander Smorkalov cdad0b7027 Merge pull request #26082 from mshabunin:fix-hal-cvt-functions
imgproc: restore multiplanar conversion functions in cv::hal namespace
2024-12-19 11:56:04 +03:00
Alexander Smorkalov ebf3c400d2 Merge pull request #26387 from sturkmen72:js-imgproc
Add some functions to OpenCV JS API
2024-12-19 09:45:23 +03:00
adsha-quic 59f762b2f0 Merge pull request #26619 from CodeLinaro:adsha_2ndPost
FastCV-based HAL for OpenCV acceleration 2ndpost-2 #26619

### Detailed description:

- Add support for multiply 8u, 16s and 32f
- Add support for cv_hal_pyrdown 8u
- Add support for cv_hal_cvtBGRtoHSV and cv_hal_cvtBGRtoYUVApprox 8u

Requires binary from [opencv/opencv_3rdparty#90](https://github.com/opencv/opencv_3rdparty/pull/90)
Depends on: [opencv/opencv#26617](https://github.com/opencv/opencv/pull/26617)

### 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
2024-12-19 08:28:24 +03:00
Alexander Smorkalov 537a2566cf Merge pull request #26643 from vrabaud:js_clone_fix
js: Rename Mat::clone binding because it is used in Emscripten.
2024-12-19 08:20:07 +03:00
Maxim Smolskiy 9f64f021de Merge pull request #26637 from MaximSmolskiy:fix-VideoCapture-fails-to-read-single-image-with-digits-in-name
Fix VideoCapture fails to read single image with digits in name #26637

### Pull Request Readiness Checklist

Fix #26457 

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-19 08:17:05 +03:00
Alexander Smorkalov e747ed11cb Merge pull request #26645 from FantasqueX:fix-typo-3
fix typo
2024-12-19 08:13:07 +03:00
Alexander Smorkalov 5cd448377a Merge pull request #26638 from vrabaud:opencv_js1
js: add types included in bound APIs
2024-12-19 08:11:54 +03:00
Vincent Rabaud 79d019b4f1 Merge pull request #26640 from vrabaud:opencv_js3
js: fix generation of "const const" in code #26640

### 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
2024-12-19 07:59:01 +03:00
Letu Ren 428d93114f fix typo 2024-12-19 10:59:17 +08:00
Vincent Rabaud 914a83fa0c Fix enum generation issues. 2024-12-18 22:20:05 +01:00
Vincent Rabaud a628417f2a Fix C preprocessor stringification 2024-12-18 22:17:08 +01:00
Vincent Rabaud 773bd1a90a Rename Mat::clone binding because it is used in Emscripten.
This is in emscripten 3.1.71 and above, cf
https://github.com/emscripten-core/emscripten/pull/22734
There was a temptative fix upstream to no avail:
https://github.com/emscripten-core/emscripten/pull/23132
2024-12-18 21:52:21 +01:00
Liutong HAN 3fbaad36d7 Merge pull request #26624 from hanliutong:rvv-mean
Add RISC-V HAL implementation for meanStdDev #26624

`meanStdDev` benefits from the Universal Intrinsic backend of RVV, but we also found that the performance on the `8UC4` type is worse than the scalar version when there is a mask, and there is no optimization implementation on `32FC1`.

This patch implements `meanStdDev` function in RVV_HAL using native intrinsic, significantly optimizing the performance for `8UC1`, `8UC4` and `32FC1`.

This patch is tested on BPI-F3 for both gcc 14.2 and clang 19.1.
```
$ opencv_test_core --gtest_filter="*MeanStdDev*"
$ opencv_perf_core --gtest_filter="Size_MatType_meanStdDev*
```

![1734077611879](https://github.com/user-attachments/assets/71c85c9d-1db1-470d-81d1-bf546e27ad86)

### 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
2024-12-18 22:19:02 +03:00
Alexander Smorkalov 7c0c9e1e55 Merge pull request #26639 from vrabaud:opencv_js2
js: fix helper.js to not trigger warnings
2024-12-18 18:49:25 +03:00
Vincent Rabaud 874e57512e js: fix helper.js to not trigger warnings 2024-12-18 11:49:08 +01:00
Vincent Rabaud 1fe9dd0c3b js: add types included in bound APIs
This fixes #25239
2024-12-18 11:43:39 +01:00
Rüdiger Ihle d369cf6d50 Merge pull request #26627 from warped-rudi:torch
Android camera feature enhancements #26627

Closes https://github.com/opencv/opencv/issues/24687

### 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
2024-12-18 12:16:50 +03:00
quic-xuezha 1c28a98b34 Merge pull request #26617 from CodeLinaro:xuezha_2ndPost
FastCV-based HAL for OpenCV acceleration 2ndpost-1 #26617

### Detailed description:

- Add parallel support for cv_hal_sobel
- Add cv_hal_gaussianBlurBinomial and parallel support.
- Add cv_hal_addWeighted8u and parallel support
- Add cv_hal_warpPerspective and parallel support

Requires binary from [opencv/opencv_3rdparty#90](https://github.com/opencv/opencv_3rdparty/pull/90)
Related patch to opencv_contrib: [opencv/opencv_contrib#3844](https://github.com/opencv/opencv_contrib/pull/3844)

### 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
2024-12-18 09:34:13 +03:00
Alexander Smorkalov 23f6a9ee3e Merge pull request #26636 from FantasqueX:fix-re-warning-2
Fix Syntax warning in ts summary.py
2024-12-18 08:54:58 +03:00
Letu Ren 3899a060a3 Fix Syntax warning in ts summary.py 2024-12-18 05:27:10 +08:00
Alexander Smorkalov 7ddc02907e Merge pull request #26634 from FantasqueX:fix-test-exif-1
Fix test_exif compilation when none of JPEG, PNG, AVIF is enabled
2024-12-17 22:36:42 +03:00
Pierre Chatelier d77abeddd0 Merge pull request #26472 from chacha21:gpumatnd_step
More convenient GpuMatND constructor #26472

Closes #26471

For convenience, GpuMatND can now accept a step.size() equal to size.size(), as long as the last step is equal to elemSize()

- [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-17 17:26:14 +03:00
Letu Ren 59b9681af6 Remove useless -Wno-long-long option
According to GCC doc, -Wlong-long: Warn if long long type is used.
This is enabled by either -Wpedantic or -Wtraditional in ISO C90
and C++98 modes. To inhibit the warning messages, use -Wno-long-long.

OpenCV 4.x requires C++11. As result, this option is useless.

Ref: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
2024-12-17 21:51:35 +08:00
Letu Ren 2e21e11318 Fix test_exif compilation when non of JPEG, PNG, AVIF is enabled
When none of JPEG, PNG, AVIF is enabled, exif_files is a zero-length
array, which is prohibited by C++ reference.
2024-12-17 21:41:45 +08:00
Vincent Rabaud e0001903ce Merge pull request #26490 from vrabaud:4x_calibration_base
Switch calibration.cpp to C++ #26490

The CvLevMarq code has to be kept in order to keep the same accuracy (the C++ solver is not as good).

There are two ways to review this PR: by comparing to the old code, or by checking what is different from the 5.x version (which is the first commit).

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-12-17 16:36:14 +03:00
Alexander Smorkalov a8f4019932 Made some pre-defined Python types optional to disable modules 2024-12-17 15:54:06 +03:00
Neko Asakura dbb330d7be Cocoa/highgui: fix leak in cvGetWindowRect_COCOA 2024-12-17 22:31:37 +10:00
Alexander Smorkalov 0ca98d437b Merge pull request #26632 from fengyuentau:dnn/gelu_cann
dnn: Fix CANN build
2024-12-17 15:09:33 +03:00
Yuantao Feng 51ec7fedaf fix build 2024-12-17 10:17:15 +00:00
Kumataro 260f511dfb Merge pull request #26590 from Kumataro:fix26589
Support C++20 standard #26590

Close https://github.com/opencv/opencv/issues/26589
Related https://github.com/opencv/opencv_contrib/pull/3842
Related: https://github.com/opencv/opencv/issues/20269

- do not arithmetic enums and ( different enums or floating numeric) 
- remove unused variable

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-12-17 07:40:27 +03:00
Alexander Smorkalov 1a1b1901e8 Merge pull request #26623 from asmorkalov:as/kelidicv_0.3
Update KleidiCV to version 0.3
2024-12-16 16:58:51 +03:00
Alexander Smorkalov a4c8d318e6 Update KleidiCV to version 0.3. 2024-12-16 15:32:44 +03:00
Alexander Smorkalov 03f90aaf85 Merge pull request #26614 from KangJialiang:fix-multi-channel-mean-scale-sample-dnn-yolo
Fix normalization parameters in YOLO example to support multi-channel mean and scale factors
2024-12-16 15:29:43 +03:00
Alexander Smorkalov 71581d9c97 Merge pull request #26618 from KangJialiang:fix/yoloPostProcessing-variable-nc
Fix yoloPostProcessing to handle variable number of classes (nc)
2024-12-14 20:59:45 +03:00
KangJialiang 25fe85bbbb Fix yoloPostProcessing` to handle variable number of classes (nc)
Previously, the yoloPostProcessing function assumed that the number of classes (nc) was fixed at 80. This caused incorrect behavior when a different number of classes was specified, leading to mismatched output shapes.

This update modifies the code to use the provided `nc` value dynamically, ensuring that the output shapes are correctly calculated based on the specified number of classes. This prevents issues when `nc` is not equal to 80 and allows for greater flexibility in model configurations.
2024-12-12 15:41:14 +08:00
KangJialiang 42be822c1d Fix normalization parameters in YOLO example to support multi-channel mean and scale factors
This branch and commit address an issue in the YOLO example (samples/dnn/yolo_detector.cpp) where the mean and scale parameters only affected the first channel (B) due to single-value input. The modification updates these parameters to accept multi-channel values, ensuring consistent preprocessing across all image channels.
2024-12-11 20:16:21 +08:00
Maksim Shabunin 1d4110884b Revert "CI: enable AVX2 build" (#26610) 2024-12-10 17:23:13 +03:00
Alexander Smorkalov dc8a9d5d3d Merge pull request #26604 from mshabunin:add-avx2-build
CI: enable AVX2 build
2024-12-10 12:11:08 +03:00
Maksim Shabunin 5ef062343c CI: enable AVX2 build 2024-12-10 11:35:56 +03:00
anandkaranubc d85c13bcbb Merge pull request #26587 from anandkaranubc:fix-nu-svc-parameter-check
Fix #25812: Add error handling for invalid nu parameter in SVM NU_SVC #26587

### 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 [Issue #25812](https://github.com/opencv/opencv/issues/25812)
- [ ] 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-10 09:21:25 +03:00
Alexander Smorkalov 0dfc5d416f Merge pull request #26598 from mshabunin:fix-doc-footer
doc: upgraded for compatibility with doxygen 1.12
2024-12-10 09:19:02 +03:00
Maksim Shabunin 4ade7931e1 doc: upgraded for compatibility with doxygen 1.12 2024-12-09 23:08:18 +03:00
Alexander Smorkalov 0a2669daba Merge pull request #26596 from y-guyon:4.x_absl_str
Support string_view in caffe_importer
2024-12-09 18:03:38 +03:00
MurtazaSaherwala 3a8d7ec75a Merge pull request #26524 from MurtazaSaherwala:DocumentationUpdation
Updated trackbar callback function and improved documentation #26524

This Fixes #26467

Description:
This pull request improve the OpenCV documentation regarding the Trackbar functionality. The current documentation does not provide clear guidance on certain aspects, such as handling the value pointer deprecation and utilizing callback arguments in C. This update addresses those gaps and provides an updated example for better clarity.

Changes:
Updated Documentation:

Clarified the usage of the value pointer and explained how to pass an initial value, since the value pointer is deprecated.
Added more detailed explanations about callback arguments in C, ensuring that users understand how to access and use them in Trackbar callbacks.
Added a note on how to properly handle initial value passing without relying on the deprecated value pointer.
Updated Tutorial Example:

Renamed and used callback function parameters to make them more understandable.
Included a demonstration on how to utilize userdata in the callback function.
Additional Notes:

Removed reliance on the value pointer for updating trackbar values. Users are now encouraged to use other mechanisms as per the current implementation to avoid the runtime warning.

### 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
2024-12-09 16:23:07 +03:00
dai-xin f825b4d1ab Resolve the issue of slow camera opening when using dshow as the backend for VideoCapture. 2024-12-09 17:55:46 +08:00
Yannis Guyon 1db93911ae Support string_view in caffe_importer
An upcoming change in Protobuf will change the return types of various
methods like Descriptor::name() and Message::GetTypeName() from const
std::string& or std::string to absl::string_view. This CL fixes users
of those methods to work both before and after the change.
2024-12-09 10:24:01 +01:00
Alexander Smorkalov 1f2e7adb4b Merge pull request #26591 from shyama7004:fix-typos
Fix typo: renamed 'search_widow_size' to 'search_window_size'
2024-12-09 11:03:49 +03:00
shyama7004 acdb707ba4 Fix typo: rename 'search_widow_size' to 'search_window_size' 2024-12-08 13:41:48 +05:30
Super 082cd7a74e Merge pull request #25691 from redhecker:gifSupport
[GSoC] Add GIF decode and encode for imgcodecs #25691

this is related to #24855 

we add  gif support for `imread`, `imreadmulti`, `imwrite` and `imwritemulti`

opencv_extra: https://github.com/opencv/opencv_extra/pull/1203

### 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
2024-12-07 10:17:41 +03:00
Alexander Smorkalov 7fbf3c1fec Merge pull request #26579 from FantasqueX:fix-re-warning-1
Fix python re warning
2024-12-06 19:24:05 +03:00
Letu Ren ed9d64c9d3 Fix python re warning in gen_objc 2024-12-06 19:54:23 +08:00
Alexander Smorkalov 646e87c728 Merge pull request #26580 from opencv-pushbot:gitee/alalek/videoio_test_filter_unstable_gstreamer
videoio(test): filter unstable GStreamer tests
2024-12-06 14:37:14 +03:00
Alexander Alekhin 7edfb57f5a videoio(test): filter unstable GStreamer tests
- observed on Ubuntu 24.04
2024-12-06 08:12:36 +00:00
Skreg 3d91d75f1a Merge pull request #26564 from shyama7004:improve-macos-install-docs
Improvement of macOS installation guide in documentation #26564

### 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
2024-12-06 08:55:41 +03:00
Amir Hassan 23fcea0d33 Merge pull request #26563 from kallaballa:wayland_and_xkbcommon_missing_include_dirs
Missing include directories needed for wayland-util and xkbcommon #26563

See: #26561

### 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-04 17:20:15 +03:00
Alexander Smorkalov 03cedee0b0 Merge pull request #26547 from mshabunin:fix-type-cast
Fixed several cases of unaligned pointer cast
2024-12-03 11:08:45 +03:00
Alexander Smorkalov 8897002fcc Merge pull request #26560 from savuor:rv/perf_box_5x5
Perf tests for cv::boxFilter(): 5x5 added
2024-12-03 07:40:35 +03:00
Rostislav Vasilikhin 31d04f8fd9 5x5 added for boxfilter perf tests 2024-12-02 16:46:37 +01:00
Maksim Shabunin c58b6bf11f Fixed several cases of unaligned pointer cast 2024-12-02 16:15:23 +03:00
Alexander Smorkalov 89c19f1f1a Merge pull request #26557 from mshabunin/fix-doc-1.12
doc: fixed issue with doxygen 1.12
2024-12-02 13:44:42 +03:00
Maksim Shabunin f4db63ca71 doc: fixed issue with doxygen 1.12 2024-12-02 12:08:59 +03:00
Alexander Smorkalov 5f1b05af0e Merge pull request #26556 from asmorkalov:FastcvHAL_1stPost
Added Fastcv HAL changes in the 3rdparty folder.
Code Changes includes HAL code , Fastcv libs and Headers

Change-Id: I2f0ddb1f57515c82ae86ba8c2a82965b1a9626ec

Requires binaries from https://github.com/opencv/opencv_3rdparty/pull/86.
Related patch to opencv_contrib: https://github.com/opencv/opencv_contrib/pull/3811

### 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
2024-12-02 10:50:38 +03:00
Suleyman TURKMEN 6eaa77461e add some functions and tests
applyColorMap
approxPolyN
arrowedLine
blendLinear
boxPoints
clipLine
convertMaps
createHanningWindow
divSpectrums
drawMarker
findContoursLinkRuns
fitEllipseAMS
fitEllipseDirect
getFontScaleFromHeight
getRectSubPix
HuMoments
intersectConvexConvex
invertAffineTransform
minEnclosingTriangle
preCornerDetect
rotatedRectangleIntersection
sqrBoxFilter
spatialGradient
stackBlur
2024-12-01 23:17:35 +03:00
Alexander Smorkalov 96dab6ba71 Merge pull request #26532 from mshabunin:fix-qr-bitstream
objdetect: fix invalid vector access in QR de/encoder
2024-11-29 17:55:13 +03:00
Maksim Shabunin e953fcfaa4 objdetect: fix invalid vector access in QR encoder 2024-11-29 14:40:53 +03:00
Alexander Smorkalov bef3585245 Merge pull request #26513 from sturkmen72:fix_for_26264
Fix for issue 26264
2024-11-29 14:26:29 +03:00
Philip Lamb a5f8711ce1 Merge pull request #26537 from artoolkitx:emscripten-build-fixes
Emscripten build fixes #26537

- Corrects typo in Emscripten-only intrinsics header (Fixes https://github.com/opencv/opencv/issues/26536)
- Updates deprecated intrinsic title (as per LLVM final intrinsic name).

### 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
2024-11-28 09:25:01 +03:00
Alexander Smorkalov a27d749471 Merge pull request #26516 from asmorkalov:as/pano_component_wrap
Document some stitching methods and enable bindings for them.
2024-11-28 08:19:55 +03:00
Alexander Smorkalov fb0a40ded4 Merge pull request #26544 from savuor:rv/perf_rotate_8uc2
Perf test for rotate(): CV_8UC2 added
2024-11-28 08:18:08 +03:00
Rostislav Vasilikhin bf914a7681 8uc2 added 2024-11-28 01:59:18 +01:00
Alexander Smorkalov c8c64f69dd Merge pull request #26533 from mshabunin:fix-reduce-test
test: fix technical issue with min_element in reduce tests
2024-11-27 09:08:01 +03:00
Alexander Smorkalov 68941ef8e7 Merge pull request #26530 from mshabunin:fix-usac-vector-access
calib3d: fix vector access in USAC
2024-11-26 22:15:05 +03:00
Maksim Shabunin 55b4c2ac59 test: fix technical issue with min_element in reduce tests 2024-11-26 21:55:41 +03:00
Alexander Smorkalov fb422a62d2 Merge pull request #26529 from asmorkalov:as/include_chrono
Fixed missing include chrono in g-api tests
2024-11-26 19:11:41 +03:00
Maksim Shabunin 82c45dde5b calib3d: fix vector access in USAC 2024-11-26 16:15:51 +03:00
Alexander Smorkalov 0b01712dd3 Fixed missing include chrono in g-api tests. 2024-11-26 15:22:57 +03:00
Suleyman TURKMEN b385767c1c Update drawing.cpp and test_contours.cpp 2024-11-25 20:35:20 +03:00
Alexander Smorkalov 65d4112fa5 Merge pull request #26512 from sturkmen72:fix_build_js_warnings
Fix for build_js warnings
2024-11-25 16:05:53 +03:00
Alexander Smorkalov 905cc45f85 Document some stitching methods and enable bindings for them. 2024-11-25 14:03:49 +03:00
Alexander Smorkalov 7095cb6904 Merge pull request #26510 from Kumataro:fix26509
doc: fix to supported depth for TIFF
2024-11-25 10:09:52 +03:00
Kumataro 5080be6669 doc: fix to supported depth for TIFF 2024-11-24 15:03:58 +09:00
Suleyman TURKMEN 1358af180c fix build_js warnings 2024-11-24 04:24:44 +03:00
Alexander Smorkalov 7be5181bff Merge pull request #26501 from asmorkalov:as/external_kleidicv
Fixed KLEIDICV_SOURCE_PATH handling for external KleidiCV
2024-11-21 18:45:14 +03:00
Alexander Smorkalov c3ca3f4f00 Fixed KLEIDICV_SOURCE_PATH handling for extenral KleidiCV. 2024-11-21 11:50:25 +03:00
Rostislav Vasilikhin 64d3111377 Merge pull request #26459 from savuor:rv/hal_absdiff_scalar
HAL added for absdiff(array, scalar) + related fixes #26459

### This PR changes
* HAL for `absdiff` when one of arguments is a scalar, including multichannel arrays and scalars
* several channels support for HAL `addScalar`
* proper data type check for `addScalar` when one of arguments is a scalar

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-11-19 10:35:49 +03:00
Alexander Smorkalov 64273c8a5b Merge pull request #26461 from vrabaud:4x_calibration_base
Remove internal calib3d_c_api.h
2024-11-19 09:45:10 +03:00
Ola Olsson b56f338c8b Make undistortImagePoints default criteria undistortPoints consistent 2024-11-18 13:46:30 +01:00
Alexander Smorkalov 1b0d58a554 Merge pull request #26468 from savuor:rv/warp_perspective_test_border
warpPerspective test: borderType argument fixed
2024-11-18 11:41:18 +03:00
Alexander Smorkalov 474028ea87 Merge pull request #26478 from xkszltl:exr_ver
Check existence of OpenEXR version macros before using.
2024-11-18 11:03:34 +03:00
xkszltl d0c8b36de8 Check existence of OpenEXR version macros before using.
It is introduced in 2.0.1 (not even in 2.0.0) and some old system like CentOS 7 still has 1.7 in stock.
- https://github.com/AcademySoftwareFoundation/openexr/commit/60cdff8a6f5c4e25a374e5f366d6e9b4efd869b3#diff-c4bae0726aebe410e407db9abd406d9cf2684f82dd8a08f46d84e8b7c35cf22aR67
2024-11-17 18:37:13 -08:00
Rostislav Vasilikhin 21cb138be8 warpPerspective border type test 2024-11-15 19:28:16 +01:00
Vincent Rabaud 8c6339c04d Remove internal calib3d_c_api.h
The new C++ code is copy/pasted from OpenCV5:
- functions initIntrinsicParams2D, subMatrix (the first 160 lines)
- function prepareDistCoeffs
- the different asserts

Not all the API/code is ported to C++ yet to ease the review.
2024-11-15 09:31:30 +01:00
Alexander Smorkalov 4866811933 Merge pull request #26155 from mshabunin:dnn-dispatch
dnn: use dispatching for Winograd optimizations
2024-11-14 21:28:42 +03:00
Alexander Smorkalov 3dace76c3f Merge pull request #26462 from mshabunin:cleanup-flann-hdf5
flann: remove unused hdf5 header
2024-11-14 21:21:27 +03:00
Maksim Shabunin b7e609d5e8 flann: remove unused hdf5 header 2024-11-14 19:44:10 +03:00
Alexander Smorkalov e5a8e2ac79 Merge pull request #26460 from asmorkalov:as/core_c_removal_packport
Backport some of C API removal in core module implementation.
2024-11-14 18:55:53 +03:00
Alexander Smorkalov 1ff16cb551 Backport some of C API removal in core module implementation. 2024-11-14 11:24:00 +03:00
Alexander Smorkalov e1d66643b3 Merge pull request #26303 from asmorkalov:as/kleidicv_offline
Skip KleidiCV in offline build
2024-11-13 20:05:13 +03:00
Alexander Smorkalov 11a4a06fa4 Merge pull request #26181 from sturkmen72:png_exif_test
Enable PNG exif orientation test
2024-11-13 16:57:18 +03:00
Alexander Smorkalov 1a775198ce Skip KleidiCV in offline build. 2024-11-13 15:13:19 +03:00
Rostislav Vasilikhin 67f07b16cb Merge pull request #25624 from savuor:rv/hal_addscalar
HAL added for add(array, scalar) #25624

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-11-13 08:33:19 +03:00
Alexander Smorkalov 8fe70a1877 Merge pull request #26452 from BillyONeal:add-windows-sdk-note
Add note for people debugging DirectML detection failures to check their Windows SDK version.
2024-11-13 08:27:57 +03:00
Billy Robert O'Neal III 5f95827a5f Add note for people debugging DirectML detection failures to check their Windows SDK version.
DirectML was first included with 10.0.18362.0, but dxcore.lib necessary to make the check pass was first in 10.0.19041.0.
2024-11-12 11:57:39 -08:00
Alexander Smorkalov ff639d11d4 Merge pull request #26451 from savuor:rv/fix_get_handle
Build fix for opencl_core.cpp
2024-11-12 20:50:48 +03:00
Rostislav Vasilikhin 641f43dd48 build fix 2024-11-12 17:04:42 +01:00
Dmitry Kurtaev c230841105 Merge pull request #26446 from dkurt:file_storage_empty_and_1d_mat
* Change style of empty and 1d Mat in FileStorage

* Remove misleading 1d Mat test
2024-11-12 17:51:10 +03:00
Dmitry Kurtaev 37c2af63f0 Merge pull request #26434 from dkurt:dk/int64_file_storage_4.x
int64 data type support for FileStorage. 1d and empty Mat with exact dimensions #26434

### Pull Request Readiness Checklist

Port of https://github.com/opencv/opencv/pull/26399 to 4.x branch

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
2024-11-11 14:13:33 +03:00
Vincent Rabaud 6f8c3b13d8 Merge pull request #26437 from vrabaud:4x_calibration_base
Backport C++ stereo/stereo_geom.cpp:5.x to calib3d/stereo_geom.cpp:4.x #26437

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-11-11 10:22:56 +03:00
Alexander Smorkalov 3fddea2ade Merge pull request #26435 from vrabaud:4x_calibration_base
Remove unused internal C functions
2024-11-08 14:43:30 +03:00
Vincent Rabaud 3d89824423 Remove unused internal C functions 2024-11-08 10:27:02 +01:00
Vincent Rabaud 6873bdee70 backport C++ 3d/calibration_base.cpp:5.x to calib3d/calibration_base.cpp:4.x (#26414)
* Add vanilla calibration_base from 5.x

This is from 55105719dd

* Have the C implementation use the new C++ one.
2024-11-08 11:56:49 +03:00
Maksim Shabunin 9d64e2959f dnn: use dispatcher for Winograd 2024-11-07 10:51:16 +03:00
Alexander Smorkalov 5817b562b3 Merge pull request #26364 from plctlab:rvp_pt2
3rdparty: NDSRVP - Part 2.1: Filter-Related Functions
2024-11-05 18:53:00 +03:00
Alexander Smorkalov c287423b33 Merge pull request #26331 from mshabunin:fix-unified-getenv
build: made environment access a separate feature
2024-11-05 11:03:11 +03:00
Alexander Smorkalov c3747a6847 Merge pull request #26402 from asmorkalov:as/win_uwp_ci
Added Universal Windows Package build to CI.
2024-11-02 13:05:05 +03:00
Alexander Smorkalov 9b635da563 Added Universal Windows Package build to CI. 2024-11-02 12:20:13 +03:00
Alexander Smorkalov ee95bfe244 Merge pull request #26203 from FantasqueX:generic-simd-warpAffineBlocklineNN
Use generic SIMD in warpAffineBlocklineNN
2024-11-01 11:16:51 +03:00
Alexander Smorkalov ddc03c0769 Merge pull request #26390 from asmorkalov:as/kleidicv_no_sme2
Disable SME2 branches in KleidiCV as it's incompatible with some CLang versions, e.g. NDK 28b1
2024-10-31 14:09:24 +03:00
Alexander Smorkalov cf87380fad Disable SME2 branches in KleidiCV as it's incompatible with some CLang versions, e.g. NDK 28b1. 2024-10-31 08:14:30 +03:00
Alexander Smorkalov 725ce48837 Merge pull request #26388 from vrabaud:4_8u
Fix test typo.
2024-10-31 07:58:24 +03:00
Maksim Shabunin 04818d6dd5 build: made environment access a separate feature 2024-10-30 18:37:22 +03:00
Vincent Rabaud 265a2c39b2 Fix test typo. 2024-10-30 15:05:30 +01:00
Alexander Smorkalov 2756c20e3e Merge pull request #26384 from mshabunin:fix-winrt-warnings-2
WinRT/UWP build: fix more warnings in media part
2024-10-30 16:04:32 +03:00
Maksim Shabunin 7654d06b83 WinRT/UWP build: fix more warnings in media part 2024-10-29 19:19:09 +03:00
Alexander Smorkalov 41489f983d Merge pull request #26381 from dkurt:dk/hotfix_dnn_debug
Hotfix ie_ngraph.cpp in Debug
2024-10-29 12:33:08 +03:00
Dmitry Kurtaev 0e80a97f87 Hotfix ie_ngraph.cpp in Debug 2024-10-29 10:20:51 +03:00
Oちゃん 8791cd147c Merge pull request #26374 from OrkWard:fix-js-build-script
Fix incorrect string format in js build script #26374

I accidentally met this small problem mentioned in https://github.com/opencv/opencv/pull/25084#discussion_r1710838120 when play with wasm build. It seems https://github.com/EDVTAZ didn't fix it yet, so I create this tiny pr.

Additionally, I remove a redundant argument in `add_argument` call. `'store_true'` already set the default, see https://docs.python.org/3/library/argparse.html#action.

### 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-10-28 17:07:15 +03:00
Junyan721113 bf7ab8eebd feat: medianBlur & bilateralFilter 2024-10-28 17:54:45 +08:00
Alexander Smorkalov dd08328228 Merge pull request #26368 from hanliutong:rvv-hal-license
Add the missing license header in hal_rvv.
2024-10-26 09:36:07 +03:00
Alexander Smorkalov 24a497acd8 Merge pull request #26370 from mshabunin:fix-winrt-warnings
WinRT/UWP build: fix some specific warnings
2024-10-26 09:34:00 +03:00
Maksim Shabunin 52100328d8 WinRT/UWP build: fix some specific warnings 2024-10-25 22:32:44 +03:00
Maksim Shabunin d6fe289a79 imgproc: restore multiplanar conversion functions in cv::hal namespace 2024-10-25 20:21:33 +03:00
Liutong HAN 515b4a2689 Add the missing license description. 2024-10-25 11:37:07 +00:00
Alexander Smorkalov e4bcd46f64 Merge pull request #26356 from hardikkamboj:4.x
Update py_thresholding.markdown
2024-10-24 12:39:43 +03:00
Liutong HAN 35571be570 Merge pull request #26318 from hanliutong:rvv-intrin-m2
Use LMUL=2 in the RISC-V Vector (RVV) backend of Universal Intrinsic. #26318

The modification of this patch involves the RVV backend of Universal Intrinsic, replacing `LMUL=1` with `LMUL=2`.

Now each Universal Intrinsic type actually corresponds to two RVV vector registers, and each Intrinsic function also operates two vector registers. Considering that algorithms written using Universal Intrinsic usually do not use the maximum number of registers, this can help the RVV backend utilize more register resources without modifying the algorithm implementation

This patch is generally beneficial in performance.

We compiled OpenCV with `Clang-19.1.1` and `GCC-14.2.0` , ran it on `CanMV-k230` and `Banana-Pi F3`. Then we have four scenarios on combinations of compilers and devices. In `opencv_perf_core`, there are 3363 cases, of which:
- 901 (26.8%) cases achieved more than `5%` performance improvement in all four scenarios, and the average speedup of these test cases (compared to scalar) increased from `3.35x` to `4.35x`
- 75 (2.2%) cases had more than `5%` performance loss in all four scenarios, indicating that these cases are better with `LMUL=1` instead of `LMUL=2`. This involves `Mat_Transform`, `hasNonZero`, `KMeans`, `meanStdDev`, `merge` and `norm2`. Among them, `Mat_Transform` only has performance degradation in a few cases (`8UC3`), and the actual execution time of `hasNonZero` is so short that it can be ignored. For `KMeans`, `meanStdDev`, `merge` and `norm2`, we should be able to use the HAL to optimize/restore their performance. (In fact, we have already done this for `merge`  #26216 )

### 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
2024-10-24 10:08:43 +03:00
Alexander Smorkalov 331412dfad Merge pull request #26357 from dkurt:dkurt/ov_out_names_from_graph
OpenVINO friendly output names from non-compiled Model
2024-10-23 13:42:01 +03:00
Dmitry Kurtaev d193554a5f OpenVINO friendly output names from non-compiled Model 2024-10-23 09:29:05 +03:00
Alexander Smorkalov 898a2a3811 Merge pull request #26353 from asmorkalov:as/ade_1.2e
ADE update to 0.1.2e
2024-10-23 08:10:16 +03:00
Hardik Kamboj 9fc7ca8ed1 Update py_thresholding.markdown
Changed "If the pixel value is smaller than the threshold" to "If the pixel value is smaller than or equal to the threshold" to make the line align with the working of the code.
2024-10-23 09:49:23 +05:30
Alexander Smorkalov 983086411f ADE update to 0.1.2e 2024-10-22 17:45:00 +03:00
Alexander Smorkalov 57ccbee25d Merge pull request #26245 from cudawarped:cuda_update_to_npp_stream_ctx
cuda - update npp calls to use the new NppStreamContext API if available
2024-10-22 14:44:42 +03:00
Kumataro 4398e0b62b Merge pull request #26340 from Kumataro:wa26339
doc: fix the position of toggle button #26340 

Close #26339 

### 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-10-22 11:57:14 +03:00
Alexander Smorkalov 94d5ad09ff Merge pull request #26284 from fzuuzf:enum_arithmetic_fixes_for_c++26
C++26 Deprecated Enum Arithmetic Conversion: Fix core/mat.inl.hpp
2024-10-21 15:47:53 +03:00
Alexander Smorkalov e026a5ad8a Merge pull request #26281 from kallaballa:clgl_device_discovery
Rewrote OpenCL-OpenGL-interop device discovery routine without extensions and with Apple support
2024-10-18 15:52:17 +03:00
Alexander Smorkalov c79b72a838 Merge pull request #26335 from migueldaipre:4.x
fix: performance typo
2024-10-18 15:44:32 +03:00
Kumataro 35dbf32227 Merge pull request #26211 from Kumataro:fix26207
imgcodecs: implement imencodemulti() #26211

Close #26207
### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-10-18 14:44:55 +03:00
Miguel Daipré 888469a842 fix: performance typo 2024-10-18 08:37:32 -03:00
Septimiu Neaga 3919f33e21 Merge pull request #26293 from SeptimiuIoachimNeagaIntel:EISW-140103_optimization_flag
G-API: Introduce level optimization flag for ONNXRT backend #26293

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-10-17 10:22:08 +03:00
FantasqueX 489df18a13 Merge pull request #26313 from FantasqueX:ipp-warp-affine-border-value
Use border value in ipp version of warp affine #26313

### 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
2024-10-17 08:50:30 +03:00
Alexander Smorkalov d20c456ab7 Merge pull request #26320 from mshabunin:fix-cmake-in-list
build: set cmake policy for if(IN_LIST) support
2024-10-17 07:36:02 +03:00
Maksim Shabunin 8ba76e65e9 build: set cmake policy for if(IN_LIST) support 2024-10-16 22:40:47 +03:00
Suleyman TURKMEN 8e5dbc03fe Merge pull request #26298 from sturkmen72:avif
Proposed solution for the issue 26297 #26298

closes #26297

### 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
2024-10-14 11:23:02 +03:00
Alexander Smorkalov 1909ac8650 Merge pull request #26212 from jamacias:feature/TickMeter-lasttime
Enhance cv::TickMeter to be able to get the last elapsed time
2024-10-14 07:56:24 +03:00
Letu Ren 45b9398d68 Use generic SIMD in warpAffineBlocklineNN 2024-10-14 01:28:41 +08:00
Zach Lowry 08f7f13dfa Merge pull request #26234 from zachlowry:apply-gcc6-fix-on-each-directory
Move the gcc6 compatibility check to occur on a per-directory basis, … #26234

Proposed fix for #26233 https://github.com/opencv/opencv/issues/26233

### 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-10-11 17:00:59 +03:00
kallaballa 3edcf410b6 more guarding 2024-10-11 02:18:14 +02:00
Alexander Smorkalov 0f234209da Merge pull request #26278 from Quantizs:feature-create-face-recognizer-from-buffer
Added buffer-based model loading to FaceRecognizerSF
2024-10-10 17:17:00 +03:00
kallaballa 4cbb96b396 use new instead of malloc and guard it 2024-10-10 15:14:58 +02:00
kallaballa 50f6d54f87 renaming 2024-10-10 14:48:49 +02:00
Wanli 687e37e6a8 Merge pull request #25892 from WanliZhong:v_sincos
Add support for v_sin and v_cos (Sine and Cosine) #25892

This PR aims to implement `v_sincos(v_float16 x)`, `v_sincos(v_float32 x)` and `v_sincos(v_float64 x)`. 
Merged after https://github.com/opencv/opencv/pull/25891 and https://github.com/opencv/opencv/pull/26023

**NOTE:** 
Also, the patch changes already added `v_exp`, `v_log` and `v_erf` to pass parameters by reference instead of by value, to match API of other universal intrinsics.

TODO:
- [x] double and half float precision
- [x] tests for them
- [x] doc to explain the implementation

### 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
2024-10-10 13:25:12 +03:00
Karsten Wiese 2a681bbb6b C++26 Deprecated Arithmetic Conversion: Fix core/mat.inl.hpp
Prefix enums with '+' to make clang c++26 add to them again.
2024-10-10 10:40:19 +02:00
kallaballa 63b5dee274 fixed bug: variable shadowing 2024-10-10 06:35:42 +02:00
kallaballa 8ba7389b21 properly size the devices array 2024-10-10 06:32:22 +02:00
kallaballa 885bbc643f renaming 2024-10-10 06:30:33 +02:00
kallaballa dceeb47cd3 rewrote clgl device discovery 2024-10-10 00:02:56 +02:00
Alexander Smorkalov 69803e7b99 Merge pull request #26216 from hanliutong:rvv-hal-merge
Add the HAL implementation for the merge function on RISC-V Vector.
2024-10-09 17:07:57 +03:00
quantizs e1b06371ad Added buffer-based model loading to FaceRecognizerSF
- Implemented a new `create` method in `FaceRecognizerSF` to allow model and configuration loading from memory buffers (std::vector<uchar>), similar to the existing functionality in `FaceDetectorYN`.
- Updated `face_recognize.cpp` with a new constructor in `FaceRecognizerSFImpl` that supports buffer-based loading for both model weights and network configuration.
- Ensured compatibility with both file-based and buffer-based model loading by maintaining consistent backend and target settings across both constructors.
- This change improves flexibility, allowing FaceRecognizerSF to be instantiated from memory buffers, which is useful for dynamic model loading scenarios such as embedded systems or applications where models are loaded in-memory.
2024-10-09 15:13:47 +02:00
Suleyman TURKMEN e72efd0d32 Merge pull request #26260 from sturkmen72:upd_doc_4_x
Update Documentation #26260

### 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
2024-10-09 09:09:51 +03:00
george cefde84a76 Merge pull request #25909 from gblikas:patch-1
Update intrin_wasm.hpp #25909

See https://github.com/microsoft/vcpkg/issues/33443 for some build context when using 

```vcpkg install opencv4:wasm32-emscripten```

`__EMSCRIPTEN_major__`, `__EMSCRIPTEN_minor__` and `__EMSCRIPTEN_tiny__` in `emsdk` >= 3.1.4 are in a header, as opposed to command line. 

We could potentially be more aggressive with how I'm checking this property; let me know if I should make the change. 

It should also be suggested that `-msimd128` is auto-included in the associated portfile for opencv, but that's a separate issue. Someone let me know if I should also make that change as well. 

Special thanks to https://github.com/youar for supporting this work; please inform if applying a copyright-header is appropriate attribution.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-10-09 08:36:10 +03:00
Alexander Smorkalov 7d9014e09e Merge pull request #26263 from mlourakis:4.x
inversion checks
2024-10-08 20:50:15 +03:00
Kumataro 40428d919d Merge pull request #26259 from Kumataro:fix26258
core: C-API cleanup: RNG algorithms in core(4.x) #26259

- replace CV_RAND_UNI and NORMAL to cv::RNG::UNIFORM and cv::RNG::NORMAL.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-10-08 15:55:00 +03:00
Alexander Smorkalov 28efc21530 Merge pull request #26187 from inayd:26130-fixFillPolyBoundaries
Fix fillPoly drawing over boundaries
2024-10-07 17:13:03 +03:00
Alexander Smorkalov cda9f4197e Merge pull request #26266 from mshabunin:fix-rvv071-build
RISC-V: fix build with RVV 0.7.1
2024-10-07 16:14:01 +03:00
Maksim Shabunin 73d68f3f49 RISC-V: fix build with RVV 0.7.1 2024-10-07 12:53:23 +03:00
Manolis Lourakis fa6d6520c7 inversion checks
Extra checks for corner cases in 3x3 matrix inversion
2024-10-06 17:24:15 +03:00
cudawarped e375d5786b cuda - update npp calls to use the new NppStreamContext API if available 2024-10-03 15:13:04 +03:00
Alexander Smorkalov 3901426d85 Merge pull request #26241 from asmorkalov:as/kelidicv-0.2
Updated KleidiCV HAL to version 0.2. #26241

### 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
2024-10-03 15:04:25 +03:00
Alexander Smorkalov ae1fb8c033 Merge pull request #26224 from mshabunin:cpp-videoio-backport
C-API cleanup: backport videoio changes from 5.x
2024-10-03 14:41:20 +03:00
Wanli 783fe72756 Resolve Compilation Error for v_func Function in SIMD Emulator (#25891)
* use 2 parms for now to identify the error

* Revert "use 2 parms for now to identify the error"

This reverts commit 86faf993a7.

* replace += with =

* add v_log ref

* refactor intrin_math code

* Add include guard to `intrin_math.hpp` to prevent multiple inclusions

* rename VX to V; make fp64 impl in neon be optional

* add v_setall, v_setzero for all backends; rewrite the intrin_math

* fix error on rvv_scalable

* let v_erf use v_exp_default_32f function

* 1. replaced 'v_setzero(VecType dummy)' with 'v_setzero_<VecType>()'
2. replaced 'v_setall(LaneType x, VecType dummy)' with 'v_setall_<VecType>(LaneType x)'
3. added tests for the new v_setzero_<> and v_setall_<>.

* gcc does not seem to like static_assert in functions even when they are not used

* trying to fix compile errors in Debug mode on Linux

---------

Co-authored-by: Vadim Pisarevsky <vadim.pisarevsky@gmail.com>
2024-10-02 21:28:48 +03:00
Alexander Smorkalov 73b3b24c56 Merge pull request #26236 from asmorkalov:as/HAL_pyrlk_hack_documentation
Added HAL documentation note for out-of-bound hack in optical flow LK.
2024-10-02 17:49:09 +03:00
Alexander Smorkalov 1aa325a460 Added HAL documentation note for out-of-bound hack in optical flow LK. 2024-10-02 12:38:25 +03:00
Alexander Smorkalov 292ee28913 Merge pull request #26230 from mshabunin:cpp-photo-4x
C-API cleanup: inpaint algorithms in photo (4.x)
2024-10-02 08:13:39 +03:00
Alexander Smorkalov b8eed54ced Merge pull request #26228 from mshabunin:cpp-features2d-4x
C-API cleanup: use AutoBuffer in MSER (4.x)
2024-10-02 08:11:28 +03:00
inayd 93a882d2e2 Fix fillPoly drawing over boundaries 2024-10-01 21:17:42 +02:00
Maksim Shabunin 807170d5c9 C-API cleanup: inpaint algorithms in photo 2024-10-01 20:10:35 +03:00
Maksim Shabunin 72023951ea C-API cleanup: use AutoBuffer in MSER 2024-10-01 18:44:22 +03:00
Maksim Shabunin 305b57e622 C-API cleanup: backport videoio changes from 5.x 2024-10-01 17:06:08 +03:00
Alexander Smorkalov 658336b366 Merge pull request #26219 from mlourakis:4.x
SQPnP solver updates
2024-10-01 14:53:20 +03:00
Manolis Lourakis 086b999013 SQPnP solver updates
Mirror most recent changes from https://github.com/terzakig/sqpnp/pull/24
  - rank revealing QR in nullspace computation
  - sqrt-free Cholesky (i.e., L*D*Lt) in the SQP solution
  - replaced divisions with multiplications by inverses
  - simplified checks in computeRowAndNullspace()
  - removed unnecessary negations
  - broke some dependency chains with parentheses
  - minor other changes
2024-09-30 16:17:22 +03:00
Liutong HAN 8a36f119ce Add the HAL implementation for the merge function on RISC-V Vector 2024-09-29 13:39:53 +00:00
Javier Macias Sola 679931dcde Enhance cv::TickMeter to be able to get the last ellapsed time 2024-09-28 12:24:36 +02:00
Suleyman TURKMEN 48a48fe11c Enable PNG exif orientation test 2024-09-27 00:04:12 +03:00
Alexander Smorkalov 450e741f8d Merge pull request #26176 from najasnake12:fixed_minor_typos_in_js_tutorials
Fixed minor typos in JS tutorials
2024-09-23 08:51:44 +03:00
Alexander Smorkalov a6ec12f58b Merge pull request #26163 from asmorkalov:as/HAL_schaar_deriv
HAL interface for Sharr derivatives needed for Lukas-Kanade algorithm #26163

### 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
2024-09-23 08:44:22 +03:00
Scott 50eebbd21f Fixed minor typos in js tutorials 2024-09-22 11:40:06 +02:00
Alexander Smorkalov b2e118ea94 Merge pull request #26166 from mshabunin:fix-intrin-ops
build: fix AVX2/AVX512 builds failed due to intrinsics operator usage
2024-09-20 19:09:45 +03:00
Maksim Shabunin 6ef357fd54 build: fix AVX2/AVX512 builds failed due to intrinsics operator usage 2024-09-20 13:38:59 +03:00
CSBVision fab419a484 Update op_cuda.hpp 2024-09-20 12:00:17 +02:00
Suleyman TURKMEN f503890c2b Merge pull request #26152 from sturkmen72:m_buf_supported
Documentation update for imagecodecs #26152

### 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
2024-09-17 09:34:38 +03:00
Alessandro de Oliveira Faria (A.K.A.CABELO) e043d5d9d6 Merge pull request #26154 from cabelo:yolov5l
Added and tested yolov5l model. #26154

### 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.
- [X] The feature is well documented and sample code can be built with the project CMake

Below is evidence of the test:

![v5l](https://github.com/user-attachments/assets/f31eff0b-11fc-44de-bdaf-640e67d1d924)
2024-09-17 08:58:22 +03:00
Alexander Smorkalov 881440c6c6 Merge pull request #26143 from asmorkalov:as/HAL_opticalFlowLK
Added HAL interface for Lukas-Kanade optical flow #26143

### 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
2024-09-16 17:07:06 +03:00
Alexander Smorkalov ee685017c3 Merge pull request #26153 from onurcankaraman:sample/trackerUpdate
sample: tracker parameters updated
2024-09-16 10:31:01 +03:00
Onur Can KARAMAN aa11a898a4 sample: tracker parameters updated
Signed-off-by: Onur Can KARAMAN <onurcankaraman340@gmail.com>
2024-09-14 23:36:57 +03:00
Alexander Smorkalov e1fec15627 Merge pull request #26148 from mshabunin:fix-sift-corruption
features2d: fixed out of bounds access in SIFT
2024-09-13 15:46:00 +03:00
Maksim Shabunin 6308739638 features2d: fixed out of bounds access in SIFT 2024-09-13 14:30:27 +03:00
Alexander Smorkalov bf998429f6 Merge pull request #26146 from mshabunin:fix-test-overrides
ts: add some missing override markers
2024-09-13 13:33:54 +03:00
Maksim Shabunin 9663245459 ts: add some missing override markers 2024-09-13 12:48:05 +03:00
Robert Mitchell f143f45fa2 Merge pull request #25785 from refmitchell:issue_25784
Documentation update for minMaxLoc #25785

Fixes #25784

Update documentation for minMaxLoc to be more specific about when multi-channel images are and are not supported.

Testing:
Built documentation locally to check that updates were incorporated correctly.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-09-13 12:34:01 +03:00
Wanli c8080aa415 Merge pull request #26109 from WanliZhong:univ_intrin_operator2warpper
Replace operators with wrapper functions on universal intrinsics backends #26109

This PR aims to replace the operators(logic, arithmetic, bit) with wrapper functions(v_add, v_eq, v_and...)

### 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
2024-09-13 10:56:48 +03:00
Maksim Shabunin 4c81e174bf Merge pull request #25901 from mshabunin:fix-riscv-aarch-baseline
RISC-V/AArch64: disable CPU features detection #25901

This PR is the first step in fixing current issues with NEON/RVV, FP16, BF16 and other CPU features on AArch64 and RISC-V platforms.

On AArch64 and RISC-V platforms we usually have the platform set by default in the toolchain when we compile it or in the cmake toolchain file or in CMAKE_CXX_FLAGS by user. Then, there are two ways to set platform options: a) "-mcpu=<some_cpu>" ; b) "-march=<arch description>" (e.g. "rv64gcv"). Furthermore, there are no similar "levels" of optimizations as for x86_64, instead we have features (RVV, FP16,...) which can be enabled or disabled. So, for example, if a user has "rv64gc" set by the toolchain and we want to enable RVV. Then we need to somehow parse their current feature set and append "v" (vector optimizations) to this string. This task is quite hard and the whole procedure is prone to errors.

I propose to use "CPU_BASELINE=DETECT" by default on AArch64 and RISC-V platforms. And somehow remove other features or make them read-only/detect-only, so that OpenCV wouldn't add any extra "-march" flags to the default configuration. We would rely only on the flags provided by the compiler and cmake toolchain file. We can have some predefined configurations in our cmake toolchain files.

Changes made by this PR:
- `CMakeLists.txt`: 
  - use `CMAKE_CROSSCOMPILING` instead of `CMAKE_TOOLCHAIN_FILE` to detect cross-compilation. This might be useful in cases of native compilation with a toolchain file
  - removed obsolete variables `ENABLE_NEON` and `ENABLE_VFPV3`, the first one have been turned ON by default on AArch64 platform which caused setting `CPU_BASELINE=NEON`
  - raise minimum cmake version allowed to 3.7 to allow using `CMAKE_CXX_FLAGS_INIT` in toolchain files
- added separate files with arch flags for native compilation on AArch64 and RISC-V, these files will be used in our toolchain files and in regular cmake
- use `DETECT` as default value for `CPU_BASELINE` also allow `NATIVE`, warn user if other values were used (only for AArch64 and RISC-V)
- for each feature listed in `CPU_DISPATCH` check if corresponding `CPU_${opt}_FLAGS_ON` has been provided, warn user if it is empty (only for AArch64 and RISC-V)
- use `CPU_BASELINE_DISABLE` variable to actually turn off macros responsible for corresponding features even if they are enabled by compiler
- removed Aarch64 feature merge procedure (it didn't support `-mcpu` and built-in `-march`)
- reworked AArch64 and two RISC-V cmake toolchain files (does not affect Android/OSX/iOS/Win):
  - use `CMAKE_CXX_FLAGS_INIT` to set compiler flags
  - use variables `ENABLE_BF16`, `ENABLE_DOTPROD`, `ENABLE_RVV`, `ENABLE_FP16` to control `-march`
  - AArch64: removed other compiler and linker flags
    - `-fdata-sections`, `-fsigned-char`, `-Wl,--no-undefined`, `-Wl,--gc-sections`   - already set by OpenCV
    - `-Wa,--noexecstack`, `-Wl,-z,noexecstack`, `-Wl,-z,relro`, `-Wl,-z,now` - can be enabled by OpenCV via `ENABLE_HARDENING`
    - `-Wno-psabi` - this option used to disable some warnings on older ARM platforms, shouldn't harm
  - ARM: removed same common flags as for AArch64, but left `-mthumb` and `--fix-cortex-a8`, `-z nocopyreloc`
2024-09-12 18:07:24 +03:00
FantasqueX 85923c8f30 Merge pull request #26113 from FantasqueX:zlib-ng-2-2-1
Update zlib-ng to 2.2.1 #26113

Release: https://github.com/zlib-ng/zlib-ng/releases/tag/2.2.1
ARM diagnostics patch: https://github.com/zlib-ng/zlib-ng/pull/1774

### 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
2024-09-12 16:05:24 +03:00
Alexander Smorkalov 7de3a8e960 Merge pull request #26088 from plctlab:rvp_pt2
3rdparty: NDSRVP - Part 2: Filter
2024-09-11 12:18:42 +03:00
Alexander Smorkalov fcfdd311ab Merge pull request #26134 from savuor:rv/mixed_arithm_channels
Mixed arithmetics tests: multichannel support
2024-09-10 13:20:04 +03:00
Alexander Smorkalov 976fb3e8d6 Merge pull request #26132 from asmorkalov:as/tlile_leakyRelu
Leaky RELU support for TFLite.
2024-09-10 10:28:35 +03:00
Rostislav Vasilikhin 8725a7e21c Mixed arithmetics tests: multichannel 2024-09-09 13:54:00 +02:00
Alexander Smorkalov 209802c9f6 Leaky RELU support for TFLite. 2024-09-09 12:40:35 +03:00
pasbi 79faf857d9 Merge pull request #26042 from pasbi:add-PtrStepSz_size
Add size() to CUDA PtrStepSz #26042

According to [cppreference.com compiler support table](https://en.cppreference.com/w/cpp/compiler_support/17), `nvcc` supports `[[nodiscard]]` from version 11.

### 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

Related: https://github.com/opencv/opencv/pull/25659
2024-09-09 08:47:26 +03:00
Alexander Smorkalov e5790c0241 Merge pull request #26116 from savuor:rv/warp_affine_perf_types
Added more data types for warpAffine() perf tests
2024-09-09 07:45:55 +03:00
Alexander Smorkalov a7d942b681 Merge pull request #26125 from asmorkalov:as/HAL_fix_nullprt_leak
Excluded nullptr leak to arithmetic HAL got from empty Mat.
2024-09-07 14:20:34 +03:00
Alexander Smorkalov 307dc2a298 Excluded nullptr leak to arithmetic HAL got from empty Mat. 2024-09-06 16:49:14 +03:00
Alexander Smorkalov 6cc166985d Merge pull request #26117 from FantasqueX:update-remap-tutorial-1
Update remap tutorial
2024-09-06 08:53:19 +03:00
Rostislav Vasilikhin 7590813b69 Merge pull request #26115 from savuor:rv/flip_ocl_dtypes
Added more data types to OCL flip() and rotate() perf tests #26115

Connected PR with updated sanity data: https://github.com/opencv/opencv_extra/pull/1206

### 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
- [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
2024-09-06 08:26:00 +03:00
Alexander Smorkalov 2a8d4c6025 Merge pull request #26120 from mshabunin:fix-rvv-init-4.x
RISC-V: remove statically initialized global RVV variables (4.x)
2024-09-06 08:21:47 +03:00
Maksim Shabunin dbd53fe89a RISC-V: remove statically initialized global RVV variables 2024-09-05 19:50:43 +03:00
Letu Ren b743edd466 Update remap tutorial
- Make x a math symbol
- Fix a typo
2024-09-05 16:54:37 +08:00
Alexander Smorkalov 06db881ca9 Merge pull request #26114 from savuor:rv/rgb2gray_bit_exact
Added bit-exact tests for RGB2Gray
2024-09-05 11:29:29 +03:00
Rostislav Vasilikhin c0a0852f05 added more data types for warpAffine() perf tests 2024-09-05 05:46:17 +02:00
Rostislav Vasilikhin 9ef574a213 added bit-exact tests for RGB2Gray 2024-09-05 03:34:35 +02:00
Alexander Smorkalov 76f495dce9 Merge pull request #26105 from mshabunin:fix-cmake-3.30
build: minor changes for cmake 3.30 and some cleanup
2024-09-04 09:16:28 +03:00
Maksim Shabunin 32d3d6fa97 build: minor changes for cmake 3.30 and some cleanup 2024-09-03 16:35:45 +03:00
Vincent Rabaud 8561f45c2a Merge pull request #26084 from vrabaud:avif_check
Avoid uninitialized value read in resize. #26084

When there is no point falling right, an hypothetical value is computed (but unused) using an uninitialized ofst. This triggers warnings in the sanitizers.

Including those values in the for loops is also possible but messy when SIMD is involved.

### 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
2024-09-03 15:16:22 +03:00
tingboliao 88f99edc65 Merge pull request #26071 from tingboliao:4.x
Remove the redundant codes of cv::convertMaps and mRGBA2RGBA<uchar> #26071

(1) cv::convertMaps: the branch [else if( m1type == CV_32FC2 && dstm1type == CV_16SC2 ) if( nninterpolate )] is unreachable,
    as the condition is satisfied in lines 1959 to 1961, calculated in advance and return directly.
(2) mRGBA2RGBA<uchar>: dst[0], dst[1], dst[2] and dst[3] is calculated repeatedly. Introduced in https://github.com/opencv/opencv/pull/13440

### Pull Request Readiness Checklist

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

- [ ] I agree to contribute to the project under Apache 2 License.
- [ ] 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
2024-09-03 07:56:37 +03:00
Alexander Smorkalov e9c3e1acb5 Merge pull request #26102 from FantasqueX:make-t-a-math-symbol
Make T a math symbol
2024-09-03 07:50:27 +03:00
Letu Ren 3995ad8458 Make T a math symbol 2024-09-03 10:54:10 +08:00
Suleyman TURKMEN e2ba36bf9c Merge pull request #26093 from sturkmen72:related_issue_22090
Update test_tiff.cpp #26093

related #22090

### 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
2024-09-02 15:26:24 +03:00
Alexander Smorkalov 960aaa32db Merge pull request #26094 from catree:fix_cameramatrix_doc_typo
Fix typo with cameramatrix command for documentation
2024-09-02 09:34:13 +03:00
Alexander Smorkalov b72d7e3b05 Merge pull request #26091 from asmorkalov:as/arm_version_check
Got rid of CAROTENE_NEON_ARCH and use standard __ARM_ARCH check
2024-09-02 09:02:28 +03:00
catree 165bf25c46 Fix typo with cameramatrix command for documentation.
Fix link for "RANSAC for Dummies" tutorial.
2024-09-01 01:03:57 +02:00
Alexander Smorkalov 4d66541999 Merge pull request #26067 from CNClareChen:4.10
Resolve compilation bug on LoongArch platform
2024-08-30 14:01:53 +03:00
Alexander Smorkalov 5b4d1ce6a0 Merge pull request #26080 from asmorkalov:as/HAL_minMaxIdx_ND_offset
Added offset for HAL as ofs2idx expects 1-based index #26080

### 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
2024-08-30 13:10:24 +03:00
Alexander Smorkalov a905526f71 Got rid of CAROTENE_NEON_ARCH and use standard __ARM_ARCH check. 2024-08-30 12:09:04 +03:00
Alexander Smorkalov 2829a6de85 Merge pull request #26030 from CNClareChen:4.x
Workaround for division by zero, issue #25795
2024-08-30 11:35:08 +03:00
llh721113 e087cc8fd1 feat: NDSRVP Filter 2024-08-30 07:59:51 +08:00
Alexander Smorkalov f156236d17 Merge pull request #26081 from mshabunin:fix-v4l-nv12
videoio: fix V4L backend with NV12 input format
2024-08-28 18:46:53 +03:00
Maksim Shabunin 61f6b6d773 videoio: fix V4L backend with NV12 input format 2024-08-28 16:43:27 +03:00
Alexander Smorkalov bacefd3b8d Merge pull request #26077 from vrabaud:avif_check
Disable strict mode when reading avif files
2024-08-28 16:15:01 +03:00
Vincent Rabaud a17fafc3af Disable strict mode when reading avif files
This fixes https://github.com/opencv/opencv/issues/26011
2024-08-28 11:49:27 +02:00
alexlyulkov 766bad0035 Merge pull request #26053 from alexlyulkov:al/opencl-conformance-tests
DNN(ONNX): Enabled several OpenCL conformance tests #26053

The tests also work in 5.x

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-08-27 17:23:11 +03:00
Alexander Smorkalov 18117cf355 Merge pull request #26063 from mshabunin:fix-config-and-doc
build/doc: disabled libdc1394 by default, documented framebuffer options
2024-08-27 17:12:00 +03:00
Alexander Smorkalov ea8c9dc2de Merge pull request #26062 from asmorkalov:as/pow_ocl_duplicate
Removed duplicated code in Pow implementation that triggers wrong assert on Intel iGPU
2024-08-27 17:04:57 +03:00
Alexander Smorkalov 3803eeecba Merge pull request #26069 from hanliutong:fix-medianBlur
Enable `CV_SIMD_SCALABLE` for median blur.
2024-08-27 16:52:36 +03:00
Liutong HAN 2d5b0caa77 Enable CV_SIMD_SCALABLE in medianBlur. 2024-08-27 02:51:08 +00:00
Hao Chen 5638c38d53 Resolve compilation bug
Fixed a bug that occurred when compiling with the clang18 compiler.

Signed-off-by: Hao Chen <chenhao@loongson.cn>
2024-08-26 17:24:05 +08:00
Hao Chen 9c19a0cdba Reinitialize divider matrix in DivRCPerfTest and DivPerfTest Cases.
This patch reinitializes divider matrix without zero values in DivRCPerfTest
and DivPerfTest test cases.
2024-08-26 16:23:50 +08:00
Maksim Shabunin 412c97b411 build/doc: disabled libdc1394 by default, documented framebuffer options 2024-08-23 18:13:43 +03:00
Alexander Smorkalov 76bf17a248 Removed duplicated code in Pow implementation that triggers wrong assert on Intel iGPU. 2024-08-23 17:44:58 +03:00
penghuiho f4c2e4f872 Merge pull request #26061 from penghuiho:fix-pow-bug
Fixed the simd bugs of iPow8u and iPow16u #26061

Add the following cases in opencv_perf_core:

* OCL_PowFixture_iPow.iPow/0, where GetParam() = (640x480, 8UC1)
* OCL_PowFixture_iPow.iPow/2, where GetParam() = (640x480, 16UC1)

iPow8u and iPow16u failed to call to simd accelerating while executing.

Fix the bug by changing the input type of iPow_SIMD function.

### 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
2024-08-23 17:12:19 +03:00
Abduragim Shtanchaev e5b871fa7e Merge pull request #26059 from Abdurrahheem:ash/fix-einsum-allocation
Einsum buffer allocation fix #26059

This PR fixed buffer allocation issue in Einsum layer that causes segmentation fault on 32bit platforms. Related issue #26008 

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-08-23 15:25:48 +03:00
Kumataro a3bdbf5553 Merge pull request #26022 from Kumataro:fix26016
Imgproc: use double to determine whether the corners points are within src #26022

close #26016
Related https://github.com/opencv/opencv_contrib/pull/3778

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-08-23 12:35:13 +03:00
Alexander Smorkalov 916724e2a0 Merge pull request #26054 from asmorkalov:as/warping_perf
Extended perf tests for warpPerspective to cover channels too
2024-08-23 11:58:20 +03:00
Alexander Smorkalov 6c6d5cd7b2 Merge pull request #25986 from asmorkalov:as/js_for_contrib
Split Javascript white-list to support contrib modules #25986

Single whitelist converted to several per-module json files. They are concatenated automatically and can be overriden by user config.

Related to https://github.com/opencv/opencv/pull/25656

### 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
2024-08-23 10:49:08 +03:00
Maxim Smolskiy 697512bb9f Merge pull request #26014 from MaximSmolskiy:increase-search-radius-for-corners-neighbors-in-ChessBoardDetector-findQuadNeighbors
Increase neighbors search radius for corners in ChessBoardDetector:findQuadNeighbors #26014

I didn't do everything right the way I wanted at #25991. I forgot that `edge_len` is edge **squared** length as well as `thresh_scale` is threshold for **squared** scale. So, I wanted to increase scale by `sqrt(2)` times (idea is to use quad diagonal instead of quad side) and therefore `thresh_scale` should be equal to `sqrt(2)^2 = 2`.

And refactor variables names to explicitly indicate that they are squared, so that no one else falls into this trap

I tested this PR with benchmark
```
python3 objdetect_benchmark.py --configuration=generate_run --board_x=7 --path=res_chessboard --synthetic_object=chessboard
```
PR increases detected chessboards number by `1/2%`:
```
cell_img_size = 100 (default)

before
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.941667                      13560             14400                           0.596726
Total detected time:  136.68963200000007 sec

after
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.952083                      13710             14400                           0.595984
Total detected time:  136.55770600000014 sec

----------------------------------------------------------------------------------------------------------------------------------------------

cell_img_size = 10

before
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.579167                       8340             14400                           4.198448
Total detected time:  2.535998999999999 sec

after
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error 
                                      all             0.591389                       8516             14400                           4.155250
Total detected time:  2.700832999999997 sec
```

### 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-08-22 15:06:02 +03:00
Alexander Smorkalov 55d1bf3da9 Extended perf tests for warpPerspective to cover channels too. 2024-08-21 17:31:28 +03:00
Yuantao Feng 347d673a87 Merge pull request #23279 from fengyuentau:add_topk
dnn: add ONNX TopK #23279

Merge with https://github.com/opencv/opencv_extra/pull/1200

Partially fixes #22890 and #20258

To-do:

- [x] TopK forward impl
- [x] add tests
- [x] support Opset 1 & 10 if possible
- [ ] ~Support other backends~ (TopK has two outputs, which is not supported by other backends, such as openvino)


Perf:

M1 (time in millisecond)

| input shape     | axis | dnn  | ort  |
| --------------- | ---- | ---- | ---- |
| (1000, 100)     | 0    | 1.68 | 4.07 |
| (1000, 100) K5  | 0    | 1.13 | 0.12 |
| (1000, 100)     | 1    | 0.96 | 0.77 |
| (100, 100, 100) | 0    | 10.00 | 31.13 |
| (100, 100, 100) | 1    | 7.33 | 9.17 |
| (100, 100, 100) | 2    | 7.52 | 9.48 |

M2 (time in milisecond)

| input shape     | axis | dnn  | ort  |
| --------------- | ---- | ---- | ---- |
| (1000, 100)     | 0    | 0.76 | 2.44 |
| (1000, 100) K5 | 0 | 0.68 | 0.07 |
| (1000, 100)     | 1    | 0.41 | 0.50 |
| (100, 100, 100) | 0    | 4.83 | 17.52|
| (100, 100, 100) | 1    | 3.60 | 5.08 |
| (100, 100, 100) | 2    | 3.73 | 5.10 |

ONNXRuntime performance testing script: https://gist.github.com/fengyuentau/a119f94fd16721ec9974b8c7b0a45d4c

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-08-21 17:03:24 +03:00
FantasqueX 7cf075c392 Merge pull request #25968 from FantasqueX:correct-bayer2gray-simd-1
Correct Bayer2Gray u8 SIMD #25968

SIMD version of CV_DESCALE is not correct. It should be implemented using v_dotprod.

What's more, the stop condition of vector operation should be `bayer < bayer_end - 14` because we just need to make sure result is safely stored into `dst`.

Closes: https://github.com/opencv/opencv/issues/25823

### 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
2024-08-21 11:33:07 +03:00
Alexander Smorkalov 7e3b69e02b Merge pull request #26052 from savuor:rv/rounding_lock
Fix rounding mode for test
2024-08-21 10:26:34 +03:00
alexlyulkov 8715229e49 Merge pull request #26009 from alexlyulkov:al/unify-build-gradle
Unified build.gradle files into one template #26009

Issue #24686

### 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-08-21 09:24:28 +03:00
Rostislav Vasilikhin 7fe36a3cb2 lock rounding mode for parallel test run 2024-08-21 09:02:02 +03:00
Alexander Smorkalov a087a9c47a Merge pull request #26045 from asmorkalov:as/variant-free
Free Variant variable after usage in DShow back-end
2024-08-20 14:19:39 +03:00
Alexander Smorkalov ec2e2da1fe Merge pull request #26046 from ivafanas:speedup_random_forest_get_votes
speedup random forest getVotes method.
2024-08-20 14:19:21 +03:00
Ivan Afanasyev 7d3d2101f9 speedup random forest getVotes method. 2024-08-20 15:35:59 +07:00
Alexander Smorkalov 24fde08712 Free Variant variable after usage in DShow back-end 2024-08-19 21:40:52 +03:00
Alexander Smorkalov ae4a11b0c0 Merge pull request #26034 from Octopus136:issue-26033
Fix: reduce redundant code by optimizing device name retrieval
2024-08-19 19:06:16 +03:00
Alexander Smorkalov ebe04a5723 Merge pull request #26041 from knmcguire:patch-1
Docfix - Remove notice on using deprecated itemset
2024-08-19 17:44:07 +03:00
Alexander Smorkalov de89aa379d Merge pull request #25980 from ericmariasis:eric-mariasis-stitcher-py-markdown
fixing issue 25962
2024-08-19 17:40:55 +03:00
ericmariasis cb72a2131f Added python branch to stitching tutorial. 2024-08-19 16:28:15 +03:00
ShengYu aa133cd899 Merge pull request #26038 from shengyu7697:fix-typo
Fix typos #26038

Fix typos

### 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
2024-08-19 13:00:07 +03:00
Kimberly N. McGuire b5b9b3a279 Remove notice on using deprecated itemset 2024-08-18 15:43:25 +02:00
Octopus136 61d719d2aa fix: reduce redundant code by optimizing device name retrieval 2024-08-16 15:31:35 +08:00
Alexander Alekhin 78630ddc67 Merge pull request #26029 from fengyuentau:dnn/fix_cuda_matmul_crash 2024-08-16 01:08:34 +00:00
Alexander Alekhin 0838920371 Merge pull request #26032 from FantasqueX:fix-typo-3 2024-08-15 16:53:02 +00:00
Alexander Alekhin 95070e61ce Merge pull request #26031 from FantasqueX:fix-typo-2 2024-08-15 16:52:45 +00:00
Letu Ren a8a088d28c Fix typo in MorphShapes document 2024-08-15 18:20:57 +08:00
Letu Ren c340b3b466 Fix typo in openvx readme 2024-08-15 16:37:40 +08:00
Yuantao Feng 93e0c7e53f fix matmul crash 2024-08-15 16:10:40 +08:00
Alexander Smorkalov 315f85d4f4 Merge pull request #26019 from shengyu7697:fix-typo
correct "enviroment" to "environment"
2024-08-12 13:33:05 +03:00
Kumataro 2fcea41f86 Merge pull request #26018 from Kumataro:fix26017
doc: remove duplicated OpenCV Theory at ToC in Basic Drawing #26018

Close #26017

### 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-08-12 13:32:52 +03:00
shengyu 37c1acbf19 correct "enviroment" to "environment" 2024-08-11 22:27:36 +08:00
Kumataro da3debda6d Merge pull request #25981 from Kumataro:fix25971
imgproc: add specific error code when cvtColor is used on an image with an invalid number of channels #25981

close #25971

### 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
2024-08-09 14:22:02 +03:00
Nishanth 6cd730a02c Merge pull request #26002 from nishanthdass:doc/missing-fields-python-tutorials
Remove empty Additional Resources and Exercises fields from tutorials #26002

### 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

This PR is in response to issue [26001](https://github.com/opencv/opencv/issues/26001)

This pull request addresses the issue of empty "Additional Resources" and "Exercises" fields in several OpenCV-Python tutorials. The empty sections have been removed to improve the clarity and consistency of the documentation.
2024-08-09 10:34:44 +03:00
Arvind Iyer c9df679943 Merge pull request #25959 from arvind-iyer:4.x
Improved samples/python/tracker.py docstring #25959

This PR removed unused arguments and updated existing argument placeholders to be more descriptive of what they are.

### 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
2024-08-07 15:17:26 +03:00
Alexander Smorkalov 67d0338c9c Merge pull request #26004 from ericmariasis:eric-mariasis-issue-26000
got rid of std prefix
2024-08-07 10:26:24 +03:00
ericmariasis 3f92884520 got rid of std prefix 2024-08-07 00:17:04 -04:00
James Choi 582a7f32d5 Merge pull request #25832 from chachoi-world:4.x
Add support for QNX #25832

Build and test instruction for QNX:
https://github.com/chachoi-world/qnx-ports/blob/main/opencv/README.md

### 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
2024-08-06 20:25:39 +03:00
Alexander Smorkalov d8bcc2c85d Merge pull request #25996 from asmorkalov:as/fillPoly_check
Fixed asserts in fillPoly
2024-08-06 17:56:22 +03:00
Rostislav Vasilikhin 1acf722e24 Merge pull request #25970 from savuor:rv/hal_pyrdown
pyrDown: offset HAL added, IPP removed #25970

Resolves #25976

### Changes
* HAL added for offset support so that border pixels can be fetched from outside of the image ROI (see `BORDER_ISOLATED` parameter)
* IPP removed since there is `pyrUp` instead of `pyrDown` and there's no easy way to fix this other than rewriting it from scratch
* replaced old C call by modern `cv::pyrDown`

### 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
- [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
2024-08-06 15:04:53 +03:00
Alexander Smorkalov 9dee2c6e67 Fixed asserts in fillPoly. 2024-08-06 12:02:01 +03:00
Alexander Smorkalov 49459d46e2 Merge pull request #25932 from asmorkalov:as/HAL_cvtColor_aprox
Added xxxApprox overloads for YUV color conversions in HAL and AlgorithmHint to cvtColor #25932

The xxxApprox to implement HAL functions with less bits for arithmetic of FP.

The hint was introduced in #25792 and #25911

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-08-06 11:40:58 +03:00
Alexander Smorkalov 333054e05e Merge pull request #25943 from asmorkalov:as/fisheye_distrort_newk
Added fisheye::distortPoints with non-identity projection matrix
2024-08-05 19:33:18 +03:00
Alexander Smorkalov ea2a3cb264 Merge pull request #25643 from cpoerschke:issue-25635-find-existing-file-tests
replace lena.jpg in find-existing-file tests
2024-08-05 15:28:16 +03:00
Alexander Smorkalov ecbff5a20c Merge pull request #25786 from plctlab:rvp_3rdparty
3rdparty: NDSRVP - Part 1.5: New Interfaces
2024-08-05 15:26:31 +03:00
Alexander Smorkalov 75fca7d9d0 Added fisheye::distort with non-identity projection matrix. 2024-08-05 15:22:00 +03:00
Maxim Smolskiy 6ed603e917 Merge pull request #25991 from MaximSmolskiy:improve-corners-matching-in-ChessBoardDetector-NeighborsFinder-findCornerNeighbor
Improve corners matching in ChessBoardDetector::NeighborsFinder::findCornerNeighbor #25991

### Pull Request Readiness Checklist

Idea was mentioned in `Section III-B. New Heuristic for Quadrangle Linking` of `Rufli, Martin & Scaramuzza, Davide & Siegwart, Roland. (2008). Automatic Detection of Checkerboards on Blurred and Distorted Images. 2008 IEEE/RSJ International Conference on Intelligent Robots and Systems, IROS. 3121-3126. 10.1109/IROS.2008.4650703` (https://rpg.ifi.uzh.ch/docs/IROS08_scaramuzza_b.pdf):
![Снимок экрана от 2024-08-05 09-51-27](https://github.com/user-attachments/assets/7a090ccc-c24c-4dfb-b0dd-259c8709eb72)
```
* For each candidate pair, focus on the quadrangles they belong to and draw two straight lines passing through the midsections of the respective quadrangle edges (see Fig. 6).
* If the candidate corner and the source corner are on the same side of every of the four straight lines drawn this way (this corresponds to the yellow shaded area in Fig. 6), then the corners are successfully matched.
```

By improving corners matching, we can increase the search radius (`thresh_scale`).

I tested this PR with benchmark
```
python3 objdetect_benchmark.py --configuration=generate_run --board_x=7 --path=res_chessboard --synthetic_object=chessboard
```
PR increases detected chessboards number by `3/7%`:
```
cell_img_size = 100 (default)

before
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.910417                      13110             14400                           0.599746
Total detected time:  147.50906700000002 sec

after
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.941667                      13560             14400                           0.596726
Total detected time:  136.68963200000007 sec

----------------------------------------------------------------------------------------------------------------------------------------------

cell_img_size = 10

before
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.539792                       7773             14400                           4.208237
Total detected time:  2.668964 sec

after
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.579167                       8340             14400                           4.198448
Total detected time:  2.535998999999999 sec
```

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-08-05 13:28:07 +03:00
Alexander Smorkalov ab99f87b6a Merge pull request #25979 from asmorkalov:as/custom_allocator
Set and check allocator pointer for all cv::Mat instances
2024-08-05 11:52:00 +03:00
Alexander Smorkalov 9de2ebbec1 Merge pull request #25978 from chacha21:cuda_stdallocator
Adding getStdAllocator() to cv::cuda::GpuMat
2024-08-05 10:58:33 +03:00
Alexander Smorkalov 992dc932ee Merge pull request #25987 from AvenSun:fix-namespace
fix compilation errors caused by namespace
2024-08-05 10:45:11 +03:00
Alexander Smorkalov a15cd4b63d Set and check allocator pointer for all cv::Mat instances. 2024-08-05 10:07:14 +03:00
Aven 796974cccc fix compilation errors caused by namespace
related: #25199
2024-08-04 05:04:03 +08:00
Alexander Smorkalov 95041f5e65 Merge pull request #25983 from stepkamipt:4.x
Fix path to 3rdparty cmake.
2024-08-02 16:51:26 +03:00
stepkamipt 340a390ea2 Fix path to 3rdparty cmake.
Current code using CMAKE_SOURCE_DIR and it works well if opencv is standalone CMake project,
but in case of building OpenCV as part of a larger CMake project (e.g. one that includes
opencv and opencv_contrib) this path is incorrect, unlike OpenCV_SOURCE_DIR
2024-08-02 10:07:36 +02:00
Junyan721113 35463e079c feat: Part 1.5 - New Interfaces 2024-08-02 13:47:45 +08:00
Alexander Alekhin b79b366859 Merge pull request #25930 from opencv-pushbot:gitee/alalek/cmake_try_detect_feature_without_flags 2024-08-01 20:09:49 +00:00
Alexander Smorkalov b9b2d551ac Merge pull request #25975 from asmorkalov:as/bmp_error_check
Improved error handling in image codecs.
2024-08-01 14:15:40 +03:00
chacha21 f67d4852bf Added no-imp placeholder when HAVE_CUDA is false 2024-08-01 10:00:31 +02:00
chacha21 2db7f8e827 Adding getStdAllocator() to cv::cuda::GpuMat
To be on par with `cv::Mat`, let's add `cv::cuda::GpuMat::getStdAllocator()`
This is useful anyway, because when a user wants to use custom allocators, he might want to resort to the standard default allocator behaviour, not some other allocator that could have been set by `setDefaultAllocator()`
2024-08-01 09:36:08 +02:00
Alexander Smorkalov 93745245a3 Improved error handling in image codecs. 2024-08-01 08:34:29 +03:00
Daniele Affinita 2a333a6c86 Merge pull request #25644 from DaniAffCH:blockwise-quantization
[GSoC] dnn: Blockwise quantization support #25644

This PR introduces blockwise quantization in DNN allowing the parsing of ONNX models quantized in blockwise style. In particular it modifies the `Quantize` and `Dequantize` operations. The related PR opencv/opencv_extra#1181 contains the test data.

Additional notes:
- The original quantization issue has been fixed. Previously, for 1D scale and zero-point, the operation applied was  $y = int8(x/s - z)$ instead of $y = int8(x/s + z)$. Note that the operation was already correctly implemented when the scale and zero-point were scalars. The previous implementation failed the ONNX test cases, but now all have passed successfully.  [Reference](https://github.com/onnx/onnx/blob/main/docs/Operators.md#QuantizeLinear)
- the function `block_repeat` broadcasts scale and zero-point to the input shape. It repeats all the elements of a given axis n times. This function generalizes the behavior of `repeat` from the core module which is defined just for 2 axis assuming `Mat` has 2 dimensions. If appropriate and useful, you might consider moving `block_repeat` to the core module.
- Now, the scale and zero-point can be taken as layer inputs. This increases the ONNX layers' coverage and enables us to run the ONNX test cases (previously disabled) being fully compliant with ONNX standards. Since they are now supported, I have enabled the test cases for: `test_dequantizelinear`, `test_dequantizelinear_axis`, `test_dequantizelinear_blocked`, `test_quantizelinear`, `test_quantizelinear_axis`, `test_quantizelinear_blocked` just in CPU backend. All of them pass successfully.
   
### 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
- [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
2024-07-30 14:16:08 +03:00
Alexander Smorkalov 89fff355c8 Merge pull request #25961 from gblikas:gblikas_4.x_ts_js
fix: js/html perf tests
2024-07-30 08:53:04 +03:00
gaohaoyuan 603344fa54 add API to reinterpret Mat type 2024-07-30 11:04:58 +08:00
Alexander Alekhin 938b9e4bb7 cmake: try baseline optimization feature check without extra flags first 2024-07-29 13:21:23 +00:00
gblikas 99672a2691 fix: js perf tests
modules/js/perf/perf_helpfunc.js and target tests, e.g. perf_gaussianBlur.js contained "const isNodeJs", leading to re-definition when using associated *.html files.
2024-07-26 13:24:26 -07:00
Alexander Smorkalov 1ca526dcdb Merge pull request #25940 from Kumataro:fix25928
python: prefer cv::Mat over cv::UMat in python binding
2024-07-26 14:39:49 +03:00
Alexander Smorkalov 65853aa783 Merge pull request #25955 from Kumataro:fix25946
core: FileStorage: detect invalid attribute value
2024-07-26 11:59:01 +03:00
Kumataro be3c519956 core: FileStorage: detect invalid attribute value 2024-07-26 05:55:00 +09:00
Alexander Smorkalov 5b3f33dd11 Merge pull request #25952 from alexlyulkov:al/java-orb-test
Added ORB detection test for Java and Android
2024-07-25 20:13:38 +03:00
Alexander Lyulkov 0b3dbdd4b3 Added Java ORB test 2024-07-25 16:47:41 +03:00
Alexander Smorkalov eab21b6106 Merge pull request #25814 from sturkmen72:numFrames
add getFrameCount() member function to BaseImageDecoder
2024-07-24 17:13:15 +03:00
Alexander Smorkalov c5de090964 Merge pull request #25944 from vrabaud:depth_check
Avoid future integer overflow in _OutputArray::create
2024-07-24 16:38:42 +03:00
武士风度的牛 160879c100 Merge pull request #25807 from spdfghi:4.x
Search in two directions when try to add new quad in addOuterQuad #25807

In ChessBoardDetector::addOuterQuad, previous code try to connect new quad with inner quad, if possible, but only search for one direction. I have made  three test images, one is normal(a.jpg), one lossed an outer quad(b.jpg), and then i flipped it vertically(c.jpg). Only last one fails. I fixed it by check two directions and row/col.

Here is the test code and images:
```
Mat img;
vector<Point2f> corners;
auto size = cv::Size(6, 6);
img = imread("D:/tmp/a.jpg", 0);
std::cout<<cv::findChessboardCorners(img, size, corners)<<"\n";
std::cout << corners.size() << "\n";
img = imread("D:/tmp/b.jpg", 0);
std::cout<<cv::findChessboardCorners(img, size, corners)<<"\n";
std::cout << corners.size() << "\n";
img = imread("D:/tmp/c.jpg", 0);
std::cout<<cv::findChessboardCorners(img, size, corners)<<"\n";
std::cout << corners.size() << "\n";
```
![a](https://github.com/opencv/opencv/assets/92856207/0dc7f5bf-7637-4333-9a9f-ec4ede790027)
a
![b](https://github.com/opencv/opencv/assets/92856207/39793485-ca0c-44c0-b44d-a593d36c1888)
b
![c](https://github.com/opencv/opencv/assets/92856207/2e7789c8-cfa5-438c-9530-2862a8a3741f)
c
2024-07-24 15:29:13 +03:00
Alexander Smorkalov 14f9d71dd0 Merge pull request #25941 from cudawarped:cuda_fix_default_cuda_arch_with_cmp0104
`cuda`: prevent `CMAKE_CUDA_ARCHITECTURES` default from overiding OpenCV architecture search (issue 25920)
2024-07-24 10:54:17 +03:00
Vincent Rabaud c16927605d Merge pull request #25938 from vrabaud:charuco
Properly check markers when none are provided. #25938

CharucoDetectorImpl::detectBoard finds temporary markers when none are provided but those are discarded when
charucoDetectorImpl::checkBoard is called.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-07-24 09:27:07 +03:00
Vincent Rabaud e1b57057bf Avoid future integer overflow in _OutputArray::create
This fix is useless in 4.x and fixes harmless overflows in 5.x
This belongs to 4.x as it is closer to the intended meaning.
2024-07-23 16:22:55 +02:00
Alexander Smorkalov 93b607dc72 Merge pull request #25942 from asmorkalov:as/hal_report
Report used HAL to test log and xml
2024-07-23 15:39:18 +03:00
Alexander Smorkalov 38cfea981f Report used HAL to test log and xml 2024-07-23 12:03:39 +03:00
Rostislav Vasilikhin 44c814e334 Merge pull request #25936 from savuor:rv/hal_dot
HAL for dot product added #25936

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-07-23 08:06:15 +03:00
cudawarped 012d853474 cuda: prevent CMAKE_CUDA_ARCHITECTURES default from overiding OpenCV architecture search 2024-07-22 18:00:36 +03:00
cudawarped c9b57819b1 Merge pull request #25874 from cudawarped:videoio_ffmpeg_fix_encapsulate_ts
videoio: fix cv::VideoWriter with FFmpeg encapsulation timestamps #25874

Fix https://github.com/opencv/opencv/issues/25873 by modifying `cv::VideoWriter` to use provided presentation indices (pts).

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-07-22 17:41:39 +03:00
Alexander Alekhin 89dd4ee137 Merge pull request #25935 from eplankin:icv_update_2021.12 2024-07-22 11:57:44 +00:00
Kumataro db3654ef51 python: prefer cv::Mat over cv::UMat in python binding 2024-07-21 10:00:29 +09:00
Yuantao Feng 23b244d3a3 Merge pull request #25881 from fengyuentau:dnn/cpu/optimize_activations_with_v_exp
dnn: optimize activations with v_exp #25881

Merge with https://github.com/opencv/opencv_extra/pull/1191.

This PR optimizes the following activations:

- [x] Swish
- [x] Mish
- [x] Elu
- [x] Celu
- [x] Selu
- [x] HardSwish

### Performance (Updated on 2024-07-18)

#### AmLogic A311D2 (ARM Cortex A73 + A53)

```
Geometric mean (ms)

            Name of Test              activations activations.patch activations.patch
                                                                              vs
                                                                         activations
                                                                          (x-factor)
Celu::Layer_Elementwise::OCV/CPU        115.859          27.930              4.15
Elu::Layer_Elementwise::OCV/CPU          27.846          27.003              1.03
Gelu::Layer_Elementwise::OCV/CPU         0.657           0.602               1.09
HardSwish::Layer_Elementwise::OCV/CPU    31.885          6.781               4.70
Mish::Layer_Elementwise::OCV/CPU         35.729          32.089              1.11
Selu::Layer_Elementwise::OCV/CPU         61.955          27.850              2.22
Swish::Layer_Elementwise::OCV/CPU        30.819          26.688              1.15
```

#### Apple M1

```
Geometric mean (ms)

               Name of Test                activations activations.patch activations.patch
                                                                                   vs
                                                                              activations
                                                                               (x-factor)
Celu::Layer_Elementwise::OCV/CPU              16.184          2.118               7.64
Celu::Layer_Elementwise::OCV/CPU_FP16         16.280          2.123               7.67
Elu::Layer_Elementwise::OCV/CPU               9.123           1.878               4.86
Elu::Layer_Elementwise::OCV/CPU_FP16          9.085           1.897               4.79
Gelu::Layer_Elementwise::OCV/CPU              0.089           0.081               1.11
Gelu::Layer_Elementwise::OCV/CPU_FP16         0.086           0.074               1.17
HardSwish::Layer_Elementwise::OCV/CPU         1.560           1.555               1.00
HardSwish::Layer_Elementwise::OCV/CPU_FP16    1.536           1.523               1.01
Mish::Layer_Elementwise::OCV/CPU              6.077           2.476               2.45
Mish::Layer_Elementwise::OCV/CPU_FP16         5.990           2.496               2.40
Selu::Layer_Elementwise::OCV/CPU              11.351          1.976               5.74
Selu::Layer_Elementwise::OCV/CPU_FP16         11.533          1.985               5.81
Swish::Layer_Elementwise::OCV/CPU             4.687           1.890               2.48
Swish::Layer_Elementwise::OCV/CPU_FP16        4.715           1.873               2.52
```

#### Intel i7-12700K

```
Geometric mean (ms)

            Name of Test              activations activations.patch activations.patch
                                                                    vs
                                                               activations
                                                                (x-factor)
Celu::Layer_Elementwise::OCV/CPU        17.106       3.560         4.81
Elu::Layer_Elementwise::OCV/CPU          5.064       3.478         1.46
Gelu::Layer_Elementwise::OCV/CPU         0.036       0.035         1.04
HardSwish::Layer_Elementwise::OCV/CPU    2.914       2.893         1.01
Mish::Layer_Elementwise::OCV/CPU         3.820       3.529         1.08
Selu::Layer_Elementwise::OCV/CPU        10.799       3.593         3.01
Swish::Layer_Elementwise::OCV/CPU        3.651       3.473         1.05
```

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-07-19 16:03:19 +03:00
Alexander Smorkalov 26714f9a34 Merge pull request #25905 from tintou:tintou/glib-cleanup
highgui: Make GThread mandatory with GTK
2024-07-19 14:42:32 +03:00
HAN Liutong b5ea32158a Merge pull request #25883 from hanliutong:rvv-intrin-upgrade
Upgrade RISC-V Vector intrinsic and cleanup the obsolete RVV backend. #25883

This patch upgrade RISC-V Vector intrinsic from `v0.10` to `v0.12`/`v1.0`:
- Update cmake check and options;
- Upgrade RVV implement for Universal Intrinsic;
- Upgrade RVV optimized DNN kernel.
- Cleanup the obsolete RVV backend (`intrin_rvv.hpp`) and compatable header file.

With this patch, RVV backend require Clang 17+ or GCC 14+ (which means `__riscv_v_intrinsic >= 12000`, see https://godbolt.org/z/es7ncETE3)

This patch is test with Clang 17.0.6 (require extra `-DWITH_PNG=OFF` due to ICE), Clang 18.1.8 and GCC 14.1.0 on QEMU and k230 (with `--gtest_filter="*hal_*"`).

### 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
2024-07-19 11:41:42 +03:00
_Ayaka 4dd54bbec9 Merge pull request #25898 from Octopus136:issue-25853
Add a check for src == dst in ocl warpTransform #25898

As mentioned in #25853, when doing WarpAffine with Mat and UMat respectively, if you force the use of the in-place operation (so that src and dst are passed the same variables), Mat produces the correct results, but UMat produces unexpected results.

Obviously in-place operations are not possible with this transformation. When Mat performs the operation, if dst and src are the same variable, the function inherently makes a copy of src without telling the user. 

https://github.com/opencv/opencv/blob/74b50c7af05c91194469a1f059f971dff00ef889/modules/imgproc/src/imgwarp.cpp#L2831-L2834

So I did the same check in UMat, but I'm not sure if it's appropriate, should we just do a copy operation without telling the user (even if the user thinks he's doing an in-place operation), or should we throw an exception to indicate that we shouldn't pass in two same variables here?

The possible reason for this problem is that there is a create function here, so it gives the developer the false impression that this create function has allocated new memory for dst, however it does not.

https://github.com/opencv/opencv/blob/74b50c7af05c91194469a1f059f971dff00ef889/modules/imgproc/src/imgwarp.cpp#L2607-L2609

Because by the time the check is done here, the function has returned back.

https://github.com/opencv/opencv/blob/74b50c7af05c91194469a1f059f971dff00ef889/modules/core/src/umatrix.cpp#L668-L675

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-07-19 09:08:19 +03:00
eplankin a5dacb5bed Update IPP integration 2024-07-18 08:16:19 -07:00
Alexander Smorkalov d892c7b142 Merge pull request #25934 from hanliutong:rvv-clang-toolchain-fix
Fix cmake macro in `riscv64-clang.toolchain.cmake`.
2024-07-18 18:12:11 +03:00
Andy-SAKN 325da2b2f4 Merge pull request #25907 from Andy-SAKN:Andy-SAKN-add_orbbec
Add tutorial on using Orbbec 3D cameras (UVC) #25907

### 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
2024-07-18 17:27:00 +03:00
zihaomu 1125755345 Merge pull request #25931 from zihaomu:clean_code
code clean #25931

Align code and remove redundant CMake code

### 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
2024-07-18 17:18:37 +03:00
Liutong HAN 32d81a8bae Fix toolchain. 2024-07-18 13:47:53 +00:00
Alexander Smorkalov 0020831414 Merge pull request #25927 from yeatse:fix-swift-name
Resolve Swift method name conflicts by adding missing namespace
2024-07-18 11:17:49 +03:00
Alexander Smorkalov 0c2da1dc9b Merge pull request #25914 from r-barnes:4.x
throw() -> noexcept
2024-07-17 19:21:16 +03:00
Yang Chao bcce38c05a fix: resolve Swift method name conflicts by adding missing namespace 2024-07-18 00:20:17 +08:00
Richard Barnes d1505693dd throw() -> noexcept 2024-07-16 06:36:52 -07:00
Alexander Smorkalov 53a5b85d9f Merge pull request #25913 from asmorkalov:as/chessboard_debug_logs
Use CV_LOG_DEBUG for debug logging in chessboard detector.
2024-07-16 08:28:28 +03:00
Alexander Smorkalov 7b176d898b Merge pull request #25912 from asmorkalov:as/round_pair_f64_restore
Restored removed test_round_pair_f64 test after PR 24941
2024-07-15 20:30:49 +03:00
Alexander Smorkalov 9ebf387850 Merge pull request #25911 from asmorkalov:as/HAL_fast_GaussianBlur
Post-merge fixes for algorithm hint API
2024-07-15 20:30:24 +03:00
Corentin Noël da078c4b75 highgui: Make GThread mandatory with GTK
The GThread API is available since more than 11 years with GLib, it is now safe
to assume that it is always available.
2024-07-15 16:30:39 +02:00
Yoshiki Obinata 4842043c6a Merge pull request #25822 from mqcmd196:gtk3-gl-support
Support OpenGL GTK3 New API #25822

Fixes #20001

GSoC2024 Project

### 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-07-15 17:06:30 +03:00
Alexander Smorkalov c53c2f6844 Use CV_LOG_DEBUG for debug logging in chessboard detector. 2024-07-15 16:11:27 +03:00
j3knk e90935e81c Merge pull request #25824 from j3knk:calib3d/fix_projectpoints
calib3d: fix Rodrigues CV_32F and CV_64F type mismatch in projectPoints #25824

Fixes #25318

### 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-07-15 15:10:08 +03:00
Alexander Smorkalov a6b8ea892b Post-merge fixes for algorithm hint API. 2024-07-15 14:44:03 +03:00
Alexander Smorkalov 04f9e3cd4f Restored removed test_round_pair_f64 test afetr PR 24941. 2024-07-15 12:59:12 +03:00
Alexander Smorkalov 81f33103fd Merge pull request #25903 from Kumataro:fixC3767
core: hal: avoid to use _tzcnt_u32 for ARM64EC
2024-07-15 10:07:21 +03:00
Kumataro e906f0f3b3 core: hal: disable _tzcnt_u32 for ARM64EC 2024-07-13 11:16:45 +09:00
Alexander Smorkalov 15783d6598 Merge pull request #25792 from asmorkalov:as/HAL_fast_GaussianBlur
Added flag to GaussianBlur for faster but not bit-exact implementation #25792

Rationale:
Current implementation of GaussianBlur is almost always bit-exact. It helps to get predictable results according platforms, but prohibits most of approximations and optimization tricks.

The patch converts `borderType` parameter to more generic `flags` and introduces `GAUSS_ALLOW_APPROXIMATIONS` flag to allow not bit-exact implementation. With the flag IPP and generic HAL implementation are called first. The flag naming and location is a subject for discussion.

Replaces https://github.com/opencv/opencv/pull/22073
Possibly related issue: https://github.com/opencv/opencv/issues/24135

### 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
- [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
2024-07-12 15:03:33 +03:00
Vincent Rabaud 3ff97c5580 Merge pull request #25899 from vrabaud:move_no_except
Mark cv::Mat(Mat&&) as noexcept #25899

This fixes https://github.com/opencv/opencv/issues/25065

### 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-07-12 14:41:17 +03:00
lamiayous 78195bc3df Merge pull request #25817 from lamiayous:ly/extend_onnxrt_gapi_backend_handle_i32_i64_type
Handling I32/I64 data types in G-API ONNX back-end #25817

### Pull Request Readiness Checklist

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

- [ ] I agree to contribute to the project under Apache 2 License.
- [ ] 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
2024-07-12 11:38:43 +03:00
Alexander Smorkalov c6ace77e21 Merge pull request #25893 from fengyuentau:core/fix_v_erf
core: fix compilation problem with v_erf
2024-07-11 12:57:18 +03:00
Alexander Smorkalov 50f1ea5c9c Merge pull request #25897 from richard28039:4.x
Fix the mistake about yolov10 inference step in dnn_yolo.markdown
2024-07-11 12:56:56 +03:00
Alexander Smorkalov dc2ce2b856 Merge pull request #25888 from sturkmen72:haveImageReader
Update documentation cv::haveImageReader(), cv::haveImageWriter()
2024-07-11 08:51:03 +03:00
richard28039 a9d8d45df4 fix the mistake 2024-07-11 03:15:52 +08:00
Suleyman TURKMEN 63b9cbc2d0 Update imgcodecs.hpp 2024-07-10 15:24:37 +03:00
Alexander Smorkalov 7dcc305301 Merge pull request #25894 from mshabunin:fix-test-templ-match
imgproc: reduce template sizes in templMatch test
2024-07-10 12:40:48 +03:00
Aliaksei Urbanski 35ca2f78d6 Merge pull request #25880 from Jamim:fix/cuda-no-fp16
Fix CUDA for old GPUs without FP16 support #25880

Fixes #21461

~This is a build-time solution that reflects https://github.com/opencv/opencv/blob/4.10.0/modules/dnn/src/cuda4dnn/init.hpp#L68-L82.~
~We shouldn't add an invalid target while building with `CUDA_ARCH_BIN` < 53.~
_(please see [this discussion](https://github.com/opencv/opencv/pull/25880#discussion_r1668074505))_

This is a run-time solution that basically reverts [these lines](https://github.com/opencv/opencv/commit/d0fe6ad10967fd2b007a4cf83b00d6f8446deb42#diff-757c5ab6ddf2f99cdd09f851e3cf17abff203aff4107d908c7ad3d0466f39604L245-R245).

I've debugged these changes, [coupled with other fixes](https://github.com/gentoo/gentoo/pull/37479), on [Gentoo Linux](https://www.gentoo.org/) and [related tests passed](https://github.com/user-attachments/files/16135391/opencv-4.10.0.20240708-224733.log.gz) on my laptop with `GeForce GTX 960M`.

Alternative solution:
  - #21462

_Best regards!_

### 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
- [ ] `n/a` There is accuracy test, performance test and test data in opencv_extra repository, if applicable
- [ ] `n/a` The feature is well documented and sample code can be built with the project CMake
2024-07-10 12:39:30 +03:00
Maksim Shabunin 06b9db6a71 imgproc: reduce template sizes in templMatch test 2024-07-10 11:06:25 +03:00
fengyuentau 11fde3bb89 fix 2024-07-10 14:48:45 +08:00
Mironov Arseny b964943517 Merge pull request #25607 from Fest1veNapkin:imgproc_approx_bounding_poly
Add a new function that approximates the polygon bounding a convex hull with a certain number of sides #25607

merge PR with <https://github.com/opencv/opencv_extra/pull/1179>

This PR is based on the paper [View Frustum Optimization To Maximize Object’s Image Area](https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=1fbd43f3827fffeb76641a9c5ab5b625eb5a75ba).

# Problem
I needed to reduce the number of vertices of the convex hull so that the additional area was minimal, andall vertices of the original contour enter the new contour.

![image](https://github.com/Fest1veNapkin/opencv/assets/98156294/efac35f6-b8f0-46ec-91e4-60800432620c)

![image](https://github.com/Fest1veNapkin/opencv/assets/98156294/2292d9d7-1c10-49c9-8489-23221b4b28f7)

# Description
Initially in the contour of n vertices, at each stage we consider the intersection points of the lines formed by each adjacent edges. Each of these intersection points will form a triangle with vertices through which lines pass. Let's choose a triangle with the minimum area and merge the two vertices at the intersection point. We continue until there are more vertices than the specified number of sides of the approximated polygon.
![image](https://github.com/Fest1veNapkin/opencv/assets/98156294/b87b21c4-112e-450d-a776-2a120048ca30)

# Complexity:
Using a std::priority_queue or std::set  time complexity is **(O(n\*ln(n))**, memory **O(n)**,
n - number of vertices in convex hull.

count of sides - the number of points by which we must reduce.
![image](https://github.com/Fest1veNapkin/opencv/assets/98156294/31ad5562-a67d-4e3c-bdc2-29f8b52caf88)

## Comment
If epsilon_percentage more 0, algorithm can return more values than _side_.
Algorithm returns OutputArray. If OutputArray.type() equals 0, algorithm returns values with InputArray.type().
New test uses image which are not in opencv_extra, needs to be added.

### Pull Request Readiness Checklist

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

- [ ] I agree to contribute to the project under Apache 2 License.
- [ ] 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
2024-07-09 17:11:23 +03:00
Alexander Smorkalov 8d935e2184 Merge pull request #25885 from Sourav6971:4.x
Update imgcodecs.hpp
2024-07-09 10:00:20 +03:00
Sourav Kumar e962395565 Update imgcodecs.hpp 2024-07-09 06:53:16 +05:30
Yuantao Feng e3858cc5a3 Merge pull request #25147 from fengyuentau:dnn/elementwise_layers/speedup
* added v_erf and implemented gelu acceleration via vectorization

* remove anonymous v_erf and use v_erf from intrin_math

* enable perf for ov and cuda backend
2024-07-08 14:24:36 +03:00
Dmitry Yurov 31b308f882 Merge pull request #25808 from DmitryYurov:bug-25806-checkerboard-marker-black-tile
Enable checkerboard detection with a central / corner marker on a black tile #25808

This pull request closes the issue #25806.

The issue doesn't require any documentation - it's quite intuitive that the detection result shouldn't depend on the color of the marker's tile.

### 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
2024-07-08 12:36:56 +03:00
Alexander Smorkalov a54de7d55e Merge pull request #25877 from Kumataro:fix25875
calib3d: doc: enable line breaks in formulas
2024-07-08 08:37:13 +03:00
Kumataro 0b5b40179c calib3d: doc: enable line breaks in formulas 2024-07-07 07:15:28 +09:00
Amir Hassan d7a237aefc Merge pull request #22836 from kallaballa:opengl_cmake_warning_linux
Explicitly prefer legacy GL in cmake on Linux? #22836

Pertaining Issue: #22835

### 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-07-05 16:39:01 +03:00
Yuantao Feng d30b9450c1 Merge pull request #25872 from fengyuentau:core/v_erf
core: add v_erf #25872

This patch adds v_erf, which is needed by https://github.com/opencv/opencv/pull/25147.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-07-05 15:46:01 +03:00
Suleyman TURKMEN cdd8395f68 add getFrameCount() 2024-07-05 14:43:30 +03:00
Alexander Smorkalov 88b28ee2a0 Merge pull request #25844 from dietmar:dont_rely_on_nb_frames
Don't rely on nb_frames to be correct
2024-07-05 11:23:20 +03:00
Vincent Rabaud dfbd18e9aa Merge pull request #25864 from vrabaud:legacy
Make sure all the lines of a JPEG are read #25864

In case of corrupted JPEG, imread would still return a JPEG of the proper size (as indicated by the header) but with some uninitialized values. I do not have a short reproducer I can add as a test as this was found by our fuzzers.

### 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
2024-07-05 08:53:28 +03:00
Maksim Shabunin 94b7a2d320 Merge pull request #25842 from mshabunin:cpp-imgproc-test-4.x
imgproc: remove C-API usage from tests #25842

Final cleanup will be done in 5.x after regular merge.

Some tests have been reworked, some required only slight modifications.
2024-07-04 16:29:08 +03:00
Abduragim Shtanchaev efbc9f0b66 Merge pull request #25861 from Abdurrahheem:ash/torch-attention-export-fix-4x
Merge pull request #25861 from Abdurrahheem:ash/torch-attention-export-fix-4x

Support for Unflatten operation requred by Attention layer - 4.x #25861

### Pull Request Readiness Checklist

All test data and models for PR are located [#1190](https://github.com/opencv/opencv_extra/pull/1190)

This PR fixes issue reised when importing batched  vanilla `Attention` layer from `PyTorch` via ONNX. Currently batched version of `Attention` layer in PyTorch [has unflatten operation inside](https://github.com/pytorch/pytorch/blob/e3b3431c4203e9eeead48f96d4afd462f0b81de5/torch/nn/functional.py#L5500C17-L5500C31). `unflatten` operation causes issue in `reshape` layer (see the Reshape_2 in the graph below) due to incorrect output of `slice` layer. This PR particularly fixes `slice` and `concat` layers to handle `unflatten` operation. 


<img width="673" alt="image" src="https://github.com/opencv/opencv/assets/44877829/5b612b31-657a-47f1-83a4-0ac35a950abd">


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
2024-07-04 16:25:31 +03:00
Alexander Smorkalov 9f5139b575 Merge pull request #25865 from asmorkalov:as/gtk_2_opengl_fix
Hacked gtkglext search in cmake
2024-07-04 16:20:51 +03:00
alexlyulkov 20e72b0b30 Merge pull request #25856 from alexlyulkov:al/android-optional-kotlin
Fixed kotlin requirement in Android build.gradle #25856

Now OpenCV Android SDK doesn't always require kotlin plugin. Kotlin code is compiled only if the application uses kotlin plugin.

Fixes #24663

### 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
2024-07-04 13:26:37 +03:00
Yuantao Feng 5510718381 Merge pull request #25810 from fengyuentau:python/fix_parsing_3d_mat_in_dnn
python: attempts to fix 3d mat parsing problem for dnn #25810

Fixes https://github.com/opencv/opencv/issues/25762 https://github.com/opencv/opencv/issues/23242
Relates https://github.com/opencv/opencv/issues/25763 https://github.com/opencv/opencv/issues/19091

Although `cv.Mat` has already been introduced to workaround this problem, people do not know it and it kind of leads to confusion with `numpy.array`. This patch adds a "switch" to turn off the auto multichannel feature when the API is from cv::dnn::Net (more specifically, `setInput`) and the parameter is of type `Mat`. This patch only leads to changes of three places in `pyopencv_generated_types_content.h`:

```.diff
static PyObject* pyopencv_cv_dnn_dnn_Net_setInput(PyObject* self, PyObject* py_args, PyObject* kw)
{
...
- pyopencv_to_safe(pyobj_blob, blob, ArgInfo("blob", 0)) &&
+ pyopencv_to_safe(pyobj_blob, blob, ArgInfo("blob", 8)) &&
...
}

// I guess we also need to change this as one-channel blob is expected for param
static PyObject* pyopencv_cv_dnn_dnn_Net_setParam(PyObject* self, PyObject* py_args, PyObject* kw)
{
...
- pyopencv_to_safe(pyobj_blob, blob, ArgInfo("blob", 0)) )
+ pyopencv_to_safe(pyobj_blob, blob, ArgInfo("blob", 8)) )
...
- pyopencv_to_safe(pyobj_blob, blob, ArgInfo("blob", 0)) )
+ pyopencv_to_safe(pyobj_blob, blob, ArgInfo("blob", 8)) )
...
}
```

Others are unchanged, e.g. `dnn_SegmentationModel` and stuff like that.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-07-04 08:33:20 +03:00
Alexander Smorkalov e644ab0b40 Merge pull request #25858 from asmorkalov:as/kleidicv_on
Enable KleidiCV for Android aarch64 by default.
2024-07-04 08:30:08 +03:00
Alexander Smorkalov e28c6eb3b6 Fixed gtkglext search in cmake. 2024-07-03 19:22:06 +03:00
Alexander Smorkalov 99c0a96a2f Enable KleidiCV for Android aarch64 by default. 2024-07-03 15:17:51 +03:00
Alexander Smorkalov 53f51275e4 Merge pull request #25857 from asmorkalov:as/yolov9_harrowing_conversion
Fixed narrowing conversion warning with MSVC compiler.
2024-07-03 12:42:29 +03:00
Alexander Smorkalov 25fb55601b Fixed narrowing conversion warning with MSVC compiler. 2024-07-03 12:10:31 +03:00
Alexander Smorkalov aac8bc877a Merge pull request #25799 from asmorkalov:as/HAL_GaussianBlurBinomial_Carotene
Use Carotene implementation of TEGRA_GaussianBlurBinomial 3x3 and 5x5 on ARM
2024-07-03 11:24:36 +03:00
Wanli bef6c110a4 Merge pull request #25781 from WanliZhong:v_log
Add support for v_log (Natural Logarithm) #25781

This PR aims to implement `v_log(v_float16 x)`, `v_log(v_float32 x)` and `v_log(v_float64 x)`. 
Merged after https://github.com/opencv/opencv/pull/24941

TODO:
- [x] double and half float precision
- [x] tests for them
- [x] doc to explain the implementation

### 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
2024-07-03 10:59:44 +03:00
zihaomu 934e6899f8 Merge pull request #25809 from zihaomu:imread_rgb_flag
imgcodecs: Add rgb flag for imread and imdecode #25809

Try to `imread` images by RGB to save R-B swapping costs.

## How to use it?
```
img_rgb = cv2.imread("PATH", IMREAD_COLOR_RGB) # OpenCV decode the image by RGB format.
```

## TODO
- [x] Fix the broken code
- [x] Add imread rgb test
- [x] Speed test of rgb mode.

## Performance test

| file name | IMREAD_COLOR  | IMREAD_COLOR_RGB |
| --------- | ------ | --------- |
| jpg01     | 284 ms | 277 ms    |
| jpg02     | 376 ms | 366 ms    |
| png01     | 62 ms  | 60 ms     |
| Png02     | 97 ms  | 94 ms     |

Test with [image_test.zip](https://github.com/user-attachments/files/15982949/image_test.zip)
```.cpp
string img_path = "/Users/mzh/work/data/image_test/png02.png";
int loop = 20;

TickMeter t;

double t0 = 10000;
for (int i = 0; i < loop; i++)
{
    t.reset();
    t.start();
    img_bgr = imread(img_path, IMREAD_COLOR);
    t.stop();

    if (t.getTimeMilli() < t0) t0 = t.getTimeMilli();
}

std::cout<<"bgr time = "<<t0<<std::endl;

t0 = 10000;
for (int i = 0; i < loop; i++)
{
    t.reset();
    t.start();
    img_rgb = imread(img_path, IMREAD_COLOR_RGB);
    t.stop();
    if (t.getTimeMilli() < t0) t0 = t.getTimeMilli();
}
std::cout<<"rgb time = "<<t0<<std::endl;
``` 
### 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
2024-07-03 10:58:25 +03:00
Yuantao Feng a7fd9446cf Merge pull request #25630 from fengyuentau:nary-multi-thread
dnn: parallelize nary elementwise forward implementation & enable related conformance tests #25630

This PR introduces the following changes:

- [x] Parallelize binary forward impl
- [x] Parallelize ternary forward impl (Where)
- [x] Parallelize nary (Operator that can take >=1 operands)
- [x] Enable conformance tests if workable

## Performance

### i7-12700K, RAM 64GB, Ubuntu 22.04

```
Geometric mean (ms)

                Name of Test                     opencv        opencv        opencv
                                                  perf          perf          perf
                                              core.x64.0606 core.x64.0606 core.x64.0606
                                                                               vs
                                                                             opencv
                                                                              perf
                                                                          core.x64.0606
                                                                           (x-factor)
NCHW_C_sum::Layer_NaryEltwise::OCV/CPU           16.116        11.161         1.44
NCHW_NCHW_add::Layer_NaryEltwise::OCV/CPU        17.469        11.446         1.53
NCHW_NCHW_div::Layer_NaryEltwise::OCV/CPU        17.531        11.469         1.53
NCHW_NCHW_equal::Layer_NaryEltwise::OCV/CPU      28.653        13.682         2.09
NCHW_NCHW_greater::Layer_NaryEltwise::OCV/CPU    21.899        13.422         1.63
NCHW_NCHW_less::Layer_NaryEltwise::OCV/CPU       21.738        13.185         1.65
NCHW_NCHW_max::Layer_NaryEltwise::OCV/CPU        16.172        11.473         1.41
NCHW_NCHW_mean::Layer_NaryEltwise::OCV/CPU       16.309        11.565         1.41
NCHW_NCHW_min::Layer_NaryEltwise::OCV/CPU        16.166        11.454         1.41
NCHW_NCHW_mul::Layer_NaryEltwise::OCV/CPU        16.157        11.443         1.41
NCHW_NCHW_pow::Layer_NaryEltwise::OCV/CPU        163.459       15.234         10.73
NCHW_NCHW_ref_div::Layer_NaryEltwise::OCV/CPU    10.880        10.868         1.00
NCHW_NCHW_ref_max::Layer_NaryEltwise::OCV/CPU    10.947        11.058         0.99
NCHW_NCHW_ref_min::Layer_NaryEltwise::OCV/CPU    10.948        10.910         1.00
NCHW_NCHW_ref_mul::Layer_NaryEltwise::OCV/CPU    10.874        10.871         1.00
NCHW_NCHW_ref_sum::Layer_NaryEltwise::OCV/CPU    10.971        10.920         1.00
NCHW_NCHW_sub::Layer_NaryEltwise::OCV/CPU        17.546        11.462         1.53
NCHW_NCHW_sum::Layer_NaryEltwise::OCV/CPU        16.175        11.475         1.41
NHWC_C::Layer_NaryEltwise::OCV/CPU               11.339        11.333         1.00
NHWC_H::Layer_NaryEltwise::OCV/CPU               16.154        11.102         1.46
```

### Apple M1, RAM 16GB, macOS 14.4.1

```
Geometric mean (ms)

                Name of Test                     opencv          opencv             opencv      
                                                  perf            perf               perf       
                                              core.m1.0606 core.m1.0606.patch core.m1.0606.patch
                                                                                      vs        
                                                                                    opencv      
                                                                                     perf       
                                                                                 core.m1.0606   
                                                                                  (x-factor)    
NCHW_C_sum::Layer_NaryEltwise::OCV/CPU           28.418          3.768               7.54       
NCHW_NCHW_add::Layer_NaryEltwise::OCV/CPU        6.942           5.679               1.22       
NCHW_NCHW_div::Layer_NaryEltwise::OCV/CPU        5.822           5.653               1.03       
NCHW_NCHW_equal::Layer_NaryEltwise::OCV/CPU      5.751           5.628               1.02       
NCHW_NCHW_greater::Layer_NaryEltwise::OCV/CPU    5.797           5.599               1.04       
NCHW_NCHW_less::Layer_NaryEltwise::OCV/CPU       7.272           5.578               1.30       
NCHW_NCHW_max::Layer_NaryEltwise::OCV/CPU        5.777           5.562               1.04       
NCHW_NCHW_mean::Layer_NaryEltwise::OCV/CPU       5.819           5.559               1.05       
NCHW_NCHW_min::Layer_NaryEltwise::OCV/CPU        5.830           5.574               1.05       
NCHW_NCHW_mul::Layer_NaryEltwise::OCV/CPU        5.759           5.567               1.03       
NCHW_NCHW_pow::Layer_NaryEltwise::OCV/CPU       342.260          74.655              4.58       
NCHW_NCHW_ref_div::Layer_NaryEltwise::OCV/CPU    8.338           8.280               1.01       
NCHW_NCHW_ref_max::Layer_NaryEltwise::OCV/CPU    8.359           8.309               1.01       
NCHW_NCHW_ref_min::Layer_NaryEltwise::OCV/CPU    8.412           8.295               1.01       
NCHW_NCHW_ref_mul::Layer_NaryEltwise::OCV/CPU    8.380           8.297               1.01       
NCHW_NCHW_ref_sum::Layer_NaryEltwise::OCV/CPU    8.356           8.323               1.00       
NCHW_NCHW_sub::Layer_NaryEltwise::OCV/CPU        6.818           5.561               1.23       
NCHW_NCHW_sum::Layer_NaryEltwise::OCV/CPU        5.805           5.570               1.04       
NHWC_C::Layer_NaryEltwise::OCV/CPU               3.834           4.817               0.80       
NHWC_H::Layer_NaryEltwise::OCV/CPU               28.402          3.771               7.53
```

### 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
2024-07-03 10:09:05 +03:00
Abduragim Shtanchaev a8d1373919 Merge pull request #25794 from Abdurrahheem:ash/yolov10-support
Add sample support of YOLOv9 and YOLOv10 in OpenCV #25794

This PR adds sample support of  [`YOLOv9`](https://github.com/WongKinYiu/yolov9) and [`YOLOv10`](https://github.com/THU-MIG/yolov10/tree/main)) in OpenCV. Models for this test are located in this [PR](https://github.com/opencv/opencv_extra/pull/1186). 

**Running YOLOv10 using OpenCV.** 
1. In oder to run `YOLOv10` one needs to cut off postporcessing with dynamic shapes from torch and then convert it to ONNX. If someone is looking for ready solution, there is [this forked branch](https://github.com/Abdurrahheem/yolov10/tree/ash/opencv-export) from official YOLOv10.  Particularty follow this proceduce. 

```bash
git clone git@github.com:Abdurrahheem/yolov10.git
conda create -n yolov10 python=3.9
conda activate yolov10
pip install -r requirements.txt
python export_opencv.py --model=<model-name> --imgsz=<input-img-size>
```
By default `model="yolov10s"` and `imgsz=(480,640)`. This will generate file `yolov10s.onnx`, which can be use for inference in OpenCV

2. For inference part on OpenCV.  one can use `yolo_detector.cpp` [sample](https://github.com/opencv/opencv/blob/4.x/samples/dnn/yolo_detector.cpp). If you have followed above exporting procedure, then you can use following command to run the model. 

``` bash
build opencv from source 
cd build 
./bin/example_dnn_yolo_detector --model=<path-to-yolov10s.onnx-file> --yolo=yolov10 --width=640 --height=480 --input=<path-to-image> --scale=0.003921568627 --padvalue=114
```
If you do not specify `--input` argument, OpenCV will grab first camera that is avaliable on your platform. 
For more deatils on how to run the `yolo_detector.cpp` file see this [guide](https://docs.opencv.org/4.x/da/d9d/tutorial_dnn_yolo.html#autotoc_md443) 


**Running YOLOv9 using OpenCV**

1. Export model following [official guide](https://github.com/WongKinYiu/yolov9)of the YOLOv9 repository. Particularly you can do following for converting.

```bash
git clone https://github.com/WongKinYiu/yolov9.git
cd yolov9
conda create -n yolov9 python=3.9
conda activate yolov9
pip install -r requirements.txt
wget https://github.com/WongKinYiu/yolov9/releases/download/v0.1/yolov9-t-converted.pt
python export.py --weights=./yolov9-t-converted.pt --include=onnx --img-size=(480,640) 
```

This will generate <yolov9-t-converted.onnx> file.

2.  Inference on OpenCV.

```bash
build opencv from source 
cd build 
./bin/example_dnn_yolo_detector --model=<path-to-yolov9-t-converted.onnx> --yolo=yolov9 --width=640 --height=480 --scale=0.003921568627 --padvalue=114 --path=<path-to-image>
```

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-07-02 18:26:34 +03:00
Alexander Smorkalov 939cb58cd6 Merge pull request #25845 from kaingwade:orbbecsdk_mac_off
Set using Orbbec SDK on MacOS OFF by default.
2024-07-02 14:02:42 +03:00
Alexander Smorkalov 2799c74d50 Use Carotene implementation of TEGRA_GaussianBlurBinomial 3x3 and 5x5 on ARM. 2024-07-02 12:50:09 +03:00
Wanli 6e1864e3fc Merge pull request #24941 from WanliZhong:v_exp
Add support for v_exp (exponential) #24941

This PR aims to implement `v_exp(v_float16 x)`, `v_exp(v_float32 x)` and `v_exp(v_float64 x)`.

### 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
2024-07-02 12:32:49 +03:00
kaingwade 883faf8871 Set using Orbbec SDK on MacOS OFF by default. 2024-07-02 17:23:20 +08:00
Alexander Smorkalov 75339a5528 Merge pull request #25800 from xndcn:patch-2
photo: doc: Fix window range for fastNlMeansDenoisingMulti
2024-07-02 10:26:56 +03:00
Alexander Smorkalov 35d9e8ef5c Merge pull request #25841 from asmorkalov:as/cudnn9_version_check
Fixed CuDNN runtime version check for CuDNN 9+.
2024-07-02 10:05:04 +03:00
Dietmar Schabus fd5efabdd9 Don't rely on nb_frames to be correct 2024-07-02 06:45:05 +02:00
Alexander Smorkalov 3d74d646d8 Fixed CuDNN runtime version check for CuDNN 9+. 2024-07-01 17:33:24 +03:00
WU Jia 39a7b3d186 Merge pull request #25813 from kaingwade:orbbec-astra
Update the tutorial of using Orbbec Astra cameras #25813

This PR is the backport of Orbbec OpenNI-based Astra camera related changes from #25410 to the 4.x branch, which includes updating the tutorial of Orbbec Astra cameras, renaming `orbbec_astra.cpp`.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-07-01 10:55:35 +03:00
Alexander Smorkalov 930af15f47 Merge pull request #25834 from thiru31:4.x
Fix: compilation Issue on ARM64 (msys2 clangarm)
2024-07-01 10:34:36 +03:00
Alexander Smorkalov 34ed88d7fb Merge pull request #25836 from dan-masek:fix_win32_topmost_toggle
Fix #25833: The correct way to disable top-most state is with HWND_NOTOPMOST, not HWND_TOP.
2024-07-01 10:30:23 +03:00
Alexander Smorkalov 25609ef5fd Merge pull request #25838 from tyler92:fix-fd-leak
Fix file descriptor leak in HDR decoder
2024-07-01 10:11:27 +03:00
Alexander Smorkalov 996ed0a2eb Merge pull request #25829 from asmorkalov:as/force_legal_requirements
Force contributors to define Apache 2.0 license for the new PRs.
2024-07-01 09:51:07 +03:00
Thirumalai Nagalingam ce1d840adf Fix: compilation Issue on ARM64 (msys2 clangarm)
Added a definition for M_PI in the code to resolve a compilation error encountered when building OpenCV on the MSYS2 environment. The M_PI constant was not defined, causing the compilation to fail.
2024-06-30 18:58:56 +00:00
Mikhail Khachayants bbf65a166e Fix file descriptor leak in HDR decoder 2024-06-30 18:43:04 +03:00
Dan Mašek 1e5407a9ba Fix #25833: The correct way to disable top-most state is with HWND_NOTOPMOST, not HWND_TOP. 2024-06-29 21:39:49 +02:00
Alexander Smorkalov b7c9221b80 Force contributors to define Apache 2.0 license for the new PRs. 2024-06-28 16:54:14 +03:00
Alexander Smorkalov be00247ca0 Merge pull request #25820 from asmorkalov:as/HAL_non_strict_equalizeHist
Relax equalizeHist test for some HAL implementations
2024-06-28 16:51:15 +03:00
Alexander Smorkalov 855f6cfdd4 Merge pull request #25827 from asmorkalov:as/exclude_ios_platform_header
Exclude cap_ios.h from installation where it's not needed
2024-06-28 14:54:15 +03:00
Alexander Smorkalov 310169490a Exclude cap_ios.h from installation where it's not needed. 2024-06-28 14:11:25 +03:00
Alexander Smorkalov aab7239f38 Merge pull request #25826 from asmorkalov:as/clean_download_models_deps
Drop redundant dependency from download_models.py
2024-06-28 14:01:29 +03:00
Alexander Smorkalov 4500eb937f Drop redundant dependency from download_models.py 2024-06-28 10:45:52 +03:00
Maxim Milashchenko 786726719f Merge pull request #25793 from MaximMilashchenko:hal_rvv
Fixed build error hal_rvv_071 #25793

Fixed bug with enabling vector header when vector extension is disabled (RVV=OFF) in hal_rvv_071
2024-06-28 09:00:16 +03:00
Alexander Smorkalov 284a79446a Merge pull request #25816 from FantasqueX:remove-unused-brow-1
Remove unused brow variable
2024-06-28 08:56:37 +03:00
Alexander Smorkalov ee2b0f9d63 Relax equalizeHist test for some HAL implementations. 2024-06-27 19:14:30 +03:00
Alexander Smorkalov 445022682e Merge pull request #25789 from asmorkalov:as/HAL_meanStdDev_tails
Fill mean and stdDev tails with zeros for HAL branch in meanStdDev #25789

as it's done for other branches.

### 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
2024-06-27 19:11:05 +03:00
Alexander Smorkalov 204d62ae12 Merge pull request #25815 from FantasqueX:remove-unused-variable-1
Remove unused variables in rgb2hsv_b simd
2024-06-27 12:58:51 +03:00
kozinove efa4d9176a Merge pull request #25661 from itlab-vision:framebuffer
Highgui backend on top of Framebuffer #25661

### 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
- [ 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

Environment variables used:
OPENCV_UI_BACKEND - you need to add the value “FB”
OPENCV_UI_PRIORITY_FB - requires priority indication
OPENCV_HIGHGUI_FB_MODE={FB|XVFB|EMU} - mode of using Framebuffer (default "FB")
- FB - Linux Framebuffer
- XVFB - virtual Framebuffer
- EMU - emulation (images are not displayed)
OPENCV_HIGHGUI_FB_DEVICE (FRAMEBUFFER) - path to the Framebuffer file (default "/dev/fb0").

Examples of using:

sudo OPENCV_UI_BACKEND=FB ./opencv_test_highgui
sudo OPENCV_UI_PRIORITY_FB=1111 ./opencv_test_highgui
OPENCV_UI_BACKEND=FB OPENCV_HIGHGUI_FB_MODE=EMU ./opencv_test_highgui
sudo OPENCV_UI_BACKEND=FB OPENCV_HIGHGUI_FB_MODE=FB ./opencv_test_highgui

export DISPLAY=:99
Xvfb $DISPLAY -screen 0 1024x768x24 -fbdir /tmp/ -f /tmp/user.xvfb.auth&
sudo -u sipeed XAUTHORITY=/tmp/user.xvfb.auth x11vnc -display $DISPLAY -listen localhost&
DISPLAY=:0 gvncviewer localhost&

FRAMEBUFFER=/tmp/Xvfb_screen0 OPENCV_UI_BACKEND=FB OPENCV_HIGHGUI_FB_MODE=XVFB ./opencv_test_highgui
2024-06-26 15:31:19 +03:00
Letu Ren 2179186a51 Remove unused variables in rgb2hsv_b simd 2024-06-26 19:07:53 +08:00
Alexander Smorkalov 76a1d26bcd Merge pull request #25805 from TFiFiE:patch-1
Replace use of "eval()" with "getattr()".
2024-06-25 13:26:28 +03:00
richard28039 11c69bb171 Merge pull request #25775 from richard28039:4.x
Add yolov8l.onnx to samples #25775

### 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

Hello, I noticed that the /samples/dnn/models.yml said it should be used for all yolov8 models, but the YOLOv8l is not included in the file, so I added it to the file, thanks.
![image](https://github.com/opencv/opencv/assets/89371302/7a7b0090-ef4c-478d-8f24-7d99260fe0c9)
2024-06-24 10:28:38 +03:00
TFiFiE 8be2056cff Replace use of "eval()" with "getattr()". 2024-06-22 17:53:47 +02:00
Alexander Smorkalov 2028998e00 Merge pull request #25803 from Kumataro/fix25802
cmake: support 10+ minor version(10,11,...)
2024-06-22 18:39:54 +03:00
Kumataro d8c7debe52 cmake: support 10+ minor version(10,11,...) 2024-06-22 12:23:25 +09:00
Yuantao Feng 3f13ce797b Merge pull request #25779 from fengyuentau:dnn/fix_onnx_depthtospace
dnn: add DepthToSpace and SpaceToDepth #25779

We are working on updating WeChat QRCode module. One of the new models is a fully convolutional model and hence it should be able to run with different input shapes. However,  it has an operator `DepthToSpace`, which is parsed as a subgraph of `Reshape -> Permute -> Reshape` with a fixed shape getting during parsing. The subgraph itself is not a problem, but the true problem is the subgraph with a fixed input and output shape regardless input changes. This does not allow the model to run with different input shapes.

Solution is to add a dedicated layer for DepthtoSpace and SpaceToDepth.

Backend support:

- [x] CPU
- [x] CUDA
- [x] OpenCL
- [x] OpenVINO
- [x] CANN
- [x] TIMVX
-  ~Vulkan~ (missing fundamental tools, like permutation and reshape)

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-06-21 19:28:22 +03:00
Alexander Smorkalov acd16e384f Merge pull request #25773 from eplankin:eplankin/fix_layout
fix for IPP
2024-06-21 16:51:30 +03:00
xndcn 5cfa44d2a2 photo: doc: Fix window range for fastNlMeansDenoisingMulti 2024-06-21 21:04:22 +08:00
Ujjayant Kadian 5dc1b39e4c Merge pull request #25791 from ujjayant-kadian:uk/extend-gapi-onnx-params-arbitrary-session-options
Extending G-API onnx::Params to pass arbitrary session options #25791

### Pull Request Readiness Checklist

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

- [ ] I agree to contribute to the project under Apache 2 License.
- [ ] 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
2024-06-21 14:34:26 +03:00
Simon Kämpe 7ef42d7706 Merge pull request #25751 from simonkampe:fix-eigen-rowmajor
Add missing cv2eigen overload #25751

Fixes #16606

Add overloads to cv2eigen to handle eigen matrices of type
Eigen::Matrix<Tp_, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>

### 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-06-20 20:05:06 +03:00
Alexander Smorkalov 57984e689b Merge pull request #25788 from asmorkalov:as/bilateralFilter_test
Extended bilateralFilter test to cover more branches
2024-06-20 10:27:15 +03:00
Alexander Smorkalov 0cba7020a1 Merge pull request #25787 from asmorkalov:as/lut_fp16
Added LUT for FP16 and accuracy test
2024-06-20 08:59:48 +03:00
Alexander Smorkalov a102b24285 Added LUT for FP16 and accuracy test. 2024-06-19 16:16:11 +03:00
Alexander Smorkalov e7108f48ab Extended bilateralFilter test to cover more branches. 2024-06-19 15:35:03 +03:00
Alexander Smorkalov d1b643a05a Merge pull request #25780 from asmorkalov:as/gapi_arm_overflow
Fixed input buffer read overflow in vectorized G-API convertTo implementation
2024-06-19 08:13:34 +03:00
Rostislav Vasilikhin 766f3f5fc4 Merge pull request #25746 from savuor:rv/hwasan_flag_release
Android SDK build script: HWAsan flags added for release mode #25746

A quick fix for #25718

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-06-18 18:15:41 +03:00
Alexander Smorkalov 553c111c5a Fixed input buffer read overflow in vectorized G-API convertTo implementation. 2024-06-18 15:46:42 +03:00
Yuantao Feng e3884a9ea8 Merge pull request #25771 from fengyuentau:vittrack_black_input
video: fix vittrack in the case where crop size grows until out-of-memory when the input is black #25771

Fixes https://github.com/opencv/opencv/issues/25760

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-06-18 12:48:28 +03:00
Alexander Smorkalov 0fac5d52bc Merge pull request #25778 from asmorkalov:as/svgfig_update
Svgfig library update to version 1.0.1 as it uses BSD-3 license.
2024-06-18 12:47:01 +03:00
Alexander Smorkalov 60819979d4 Svgfig library update to version 1.0.1 as it uses BSD-3 license. 2024-06-18 11:13:32 +03:00
Letu Ren b9d2ecb72f Remove unused brow variable 2024-06-17 18:50:53 +08:00
eplankin 860b688cdd Enable build with both old and new layouts of IPP 2024-06-17 03:26:01 -07:00
Dmitry Kurtaev 24907f35a3 Merge pull request #25757 from dkurt:d.kurtaev/opencv_js_tests_old_emsdk
Use onRuntimeInitialized with OpenCV.js Node tests #25757

### Pull Request Readiness Checklist

tests: https://github.com/opencv/ci-gha-workflow/pull/174

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
2024-06-17 12:46:10 +03:00
Alexander Smorkalov 4bf95ac2df Merge pull request #25602 from asmorkalov:as/gstreamer_alpha_channel
Handle BGRA streams in GStreamer backend
2024-06-16 18:18:03 +03:00
Alexander Smorkalov 0a12c7d9de Merge pull request #25725 from asmorkalov:as/intersectConvexConvex_fix
Fixed result buffer overflow in intersectConvexConvex_ for non-convex input
2024-06-16 17:07:01 +03:00
Rostislav Vasilikhin 7ff531b8ab Merge pull request #25759 from savuor:rv/equalizeHist_tests
Accuracy tests for equalizeHist() added #25759

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-06-15 12:44:36 +03:00
Alexander Smorkalov 88c6c7d9f7 Handle BGRA sterams in GStreamer backend 2024-06-11 12:21:05 +03:00
Dmitry Kurtaev a03b813167 Merge pull request #25732 from dkurt:opencv_js_tests_update
Fix OpenCV.js tests #25732

### Pull Request Readiness Checklist

* Firefox tests passed

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
2024-06-11 12:01:51 +03:00
Alexander Smorkalov 8e9307074c Merge pull request #25738 from rlexmann:imgproc_fix_divSpectrums
Fix arithmetics in CV_32F branch of divSpectrums()
2024-06-11 11:16:23 +03:00
Alexander Smorkalov 2629688d11 Merge pull request #25706 from cudawarped:fix_cuda_first_python_dep
`cuda`: Add missing python CUDA dependency when CUDA is a first class language
2024-06-11 10:49:14 +03:00
Rostislav Vasilikhin 3ea7ed9ebf Merge pull request #25718 from savuor:rv/hwasan_flag
Android SDK build script: HWAsan support added #25718

### 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
- [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
2024-06-11 10:12:38 +03:00
Alexander Smorkalov 6623c62f56 Fixed result buffer overflow in intersectConvexConvex_ for non-convex input. 2024-06-10 19:38:35 +03:00
Robert Lexmann e1dba2c6d2 Perform arithmetics in CV_32F branch of divSpectrums() with doubles to prevent infs/NaNs (+ corresponding test). 2024-06-10 15:47:29 +02:00
Pierre Chatelier bdf986ee51 Merge pull request #25726 from chacha21:remap_relative_doc
Relates to #24603

### 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-06-10 11:09:25 +03:00
Maxim Smolskiy cc6f85e1ba Merge pull request #25427 from MaximSmolskiy:make-finding-corner-neighbor-symmetrical-in-ChessBoardDetector-findQuadNeighbors
Make finding corner neighbor symmetrical in ChessBoardDetector::findQuadNeighbors #25427

### Pull Request Readiness Checklist

The basic idea of finding pair of corners neighbors is to find best candidate for first corner and check if first corner quite good candidate for its best candidate. And we test first corner for its best candidate less than best candidate for first corner.

Idea of changes is to make finding corner neighbor symmetrical - find best candidate for first corner, find best candidate for second corner and match them as pair iff they are both best candidates for each other.

Additional advantage - it simplifies code and removes some code duplication.

I tested this PR with benchmark
```
python3 objdetect_benchmark.py --configuration=generate_run --board_x=7 --path=res_chessboard --synthetic_object=chessboard
```

There are minor changes in results
```
cell_img_size = 100 (default)

before

                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                          _none_none_blur             1.000000                        360               360                           0.630345
                    _none_none_gaussNoise             0.833333                        300               360                           0.623405
                          _none_none_none             1.000000                        360               360                           0.631517
                    _none_none_strongBlur             1.000000                        360               360                           0.630316
                   _none_undistorted_blur             1.000000                        360               360                           0.671232
             _none_undistorted_gaussNoise             1.000000                        360               360                           0.672619
                   _none_undistorted_none             1.000000                        360               360                           0.673669
             _none_undistorted_strongBlur             1.000000                        360               360                           0.671257
                   _perspective_none_blur             1.000000                       1080              1080                           0.588694
             _perspective_none_gaussNoise             0.805556                        870              1080                           0.599312
                   _perspective_none_none             1.000000                       1080              1080                           0.591063
             _perspective_none_strongBlur             1.000000                       1080              1080                           0.588604
            _perspective_undistorted_blur             1.000000                       1080              1080                           0.622081
      _perspective_undistorted_gaussNoise             1.000000                       1080              1080                           0.625704
            _perspective_undistorted_none             1.000000                       1080              1080                           0.624191
      _perspective_undistorted_strongBlur             1.000000                       1080              1080                           0.621618
             _strongPerspective_none_blur             1.000000                        360               360                           0.482934
       _strongPerspective_none_gaussNoise             0.166667                         60               360                           0.391551
             _strongPerspective_none_none             1.000000                        360               360                           0.480290
       _strongPerspective_none_strongBlur             0.333333                        120               360                           0.469080
      _strongPerspective_undistorted_blur             1.000000                        360               360                           0.503458
_strongPerspective_undistorted_gaussNoise             0.250000                         90               360                           0.448713
      _strongPerspective_undistorted_none             1.000000                        360               360                           0.504412
_strongPerspective_undistorted_strongBlur             0.166667                         60               360                           0.473791
                                      all             0.904167                      13020             14400                           0.600512
Total detected time:  139.65614900000008 sec

after

                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                          _none_none_blur             1.000000                        360               360                           0.630345
                    _none_none_gaussNoise             0.750000                        270               360                           0.636279
                          _none_none_none             1.000000                        360               360                           0.631517
                    _none_none_strongBlur             1.000000                        360               360                           0.630316
                   _none_undistorted_blur             1.000000                        360               360                           0.671232
             _none_undistorted_gaussNoise             1.000000                        360               360                           0.672619
                   _none_undistorted_none             1.000000                        360               360                           0.673669
             _none_undistorted_strongBlur             1.000000                        360               360                           0.671257
                   _perspective_none_blur             1.000000                       1080              1080                           0.588694
             _perspective_none_gaussNoise             0.888889                        960              1080                           0.594106
                   _perspective_none_none             1.000000                       1080              1080                           0.591064
             _perspective_none_strongBlur             1.000000                       1080              1080                           0.588604
            _perspective_undistorted_blur             1.000000                       1080              1080                           0.622081
      _perspective_undistorted_gaussNoise             1.000000                       1080              1080                           0.625703
            _perspective_undistorted_none             1.000000                       1080              1080                           0.624191
      _perspective_undistorted_strongBlur             1.000000                       1080              1080                           0.621618
             _strongPerspective_none_blur             1.000000                        360               360                           0.482934
       _strongPerspective_none_gaussNoise             0.166667                         60               360                           0.391551
             _strongPerspective_none_none             1.000000                        360               360                           0.480290
       _strongPerspective_none_strongBlur             0.333333                        120               360                           0.469080
      _strongPerspective_undistorted_blur             1.000000                        360               360                           0.503458
_strongPerspective_undistorted_gaussNoise             0.333333                        120               360                           0.422259
      _strongPerspective_undistorted_none             1.000000                        360               360                           0.504412
_strongPerspective_undistorted_strongBlur             0.166667                         60               360                           0.473791
                                      all             0.910417                      13110             14400                           0.599746
Total detected time:  142.40333700000005 sec

----------------------------------------------------------------------------------------------------------------------------------------------

cell_img_size = 10

before

                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                          _none_none_blur             0.991667                        357               360                           4.905091
                    _none_none_gaussNoise             0.750000                        270               360                           5.215633
                          _none_none_none             1.000000                        360               360                           4.943304
                    _none_none_strongBlur             0.916667                        330               360                           3.806217
                   _none_undistorted_blur             0.994444                        358               360                           5.220915
             _none_undistorted_gaussNoise             0.997222                        359               360                           4.542443
                   _none_undistorted_none             0.997222                        359               360                           4.340208
             _none_undistorted_strongBlur             0.161111                         58               360                           5.024331
                   _perspective_none_blur             0.629630                        680              1080                           4.825401
             _perspective_none_gaussNoise             0.966667                       1044              1080                           3.895425
                   _perspective_none_none             0.971296                       1049              1080                           3.920378
             _perspective_none_strongBlur             0.000000                          0              1080                                NaN
            _perspective_undistorted_blur             0.583333                        630              1080                           4.594335
      _perspective_undistorted_gaussNoise             0.999074                       1079              1080                           3.553195
            _perspective_undistorted_none             0.750000                        810              1080                           3.604110
      _perspective_undistorted_strongBlur             0.000000                          0              1080                                NaN
             _strongPerspective_none_blur             0.000000                          0               360                                NaN
       _strongPerspective_none_gaussNoise             0.000000                          0               360                                NaN
             _strongPerspective_none_none             0.083333                         30               360                           2.382460
       _strongPerspective_none_strongBlur             0.000000                          0               360                                NaN
      _strongPerspective_undistorted_blur             0.000000                          0               360                                NaN
_strongPerspective_undistorted_gaussNoise             0.000000                          0               360                                NaN
      _strongPerspective_undistorted_none             0.000000                          0               360                                NaN
_strongPerspective_undistorted_strongBlur             0.000000                          0               360                                NaN
                                      all             0.539792                       7773             14400                           4.209964
Total detected time:  2.6968930000000015 sec

after

                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                          _none_none_blur             0.991667                        357               360                           4.905091
                    _none_none_gaussNoise             0.750000                        270               360                           5.215633
                          _none_none_none             1.000000                        360               360                           4.943304
                    _none_none_strongBlur             0.916667                        330               360                           3.806217
                   _none_undistorted_blur             0.994444                        358               360                           5.220915
             _none_undistorted_gaussNoise             0.997222                        359               360                           4.542443
                   _none_undistorted_none             0.997222                        359               360                           4.340208
             _none_undistorted_strongBlur             0.161111                         58               360                           5.024331
                   _perspective_none_blur             0.629630                        680              1080                           4.825401
             _perspective_none_gaussNoise             0.966667                       1044              1080                           3.895425
                   _perspective_none_none             0.999074                       1079              1080                           3.865684
             _perspective_none_strongBlur             0.000000                          0              1080                                NaN
            _perspective_undistorted_blur             0.583333                        630              1080                           4.594335
      _perspective_undistorted_gaussNoise             0.999074                       1079              1080                           3.553195
            _perspective_undistorted_none             0.750000                        810              1080                           3.604110
      _perspective_undistorted_strongBlur             0.000000                          0              1080                                NaN
             _strongPerspective_none_blur             0.000000                          0               360                                NaN
       _strongPerspective_none_gaussNoise             0.000000                          0               360                                NaN
             _strongPerspective_none_none             0.000000                          0               360                                NaN
       _strongPerspective_none_strongBlur             0.000000                          0               360                                NaN
      _strongPerspective_undistorted_blur             0.000000                          0               360                                NaN
_strongPerspective_undistorted_gaussNoise             0.000000                          0               360                                NaN
      _strongPerspective_undistorted_none             0.000000                          0               360                                NaN
_strongPerspective_undistorted_strongBlur             0.000000                          0               360                                NaN
                                      all             0.539792                       7773             14400                           4.208308
Total detected time:  2.7706419999999983 sec
```

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
2024-06-10 09:42:56 +03:00
Alexander Smorkalov 3282954c2e Merge pull request #25723 from mshabunin:fix-ts-rng
test: use cv::theRNG instead of own generator
2024-06-07 20:41:11 +03:00
Dmitry Kurtaev 3700f9e1e9 Merge pull request #25709 from dkurt:wrap_addLayer
* Wrap dnn addLayer
* Add typing stubs
2024-06-07 20:39:44 +03:00
Maksim Shabunin ef3303716e test: use cv::theRNG instead of own generator 2024-06-07 13:36:11 +03:00
Alexander Smorkalov bef5a87680 Merge pull request #25722 from AleksandrPanov:update_testSeveralBoardsWithCustomIds
updated testSeveralBoardsWithCustomIds to enable in 5.x
2024-06-06 20:01:33 +03:00
Maxim Milashchenko adcb070396 Merge pull request #25307 from MaximMilashchenko:halrvv071
* added hal for cv_hal_cvtBGRtoBGR rvv 0.7.1
2024-06-06 15:31:59 +03:00
Alexander Panov cbc08514fd updated testSeveralBoardsWithCustomIds to enable in 5.x 2024-06-06 14:22:58 +03:00
Alexander Smorkalov cbf3b1187d Merge pull request #25720 from VadimLevin:dev/vlevin/floodFill-optional-mask
fix: mark floodFill mask as optional in Python typing stubs
2024-06-06 13:36:00 +03:00
Alexander Smorkalov 0d1ed49d2a Merge pull request #25703 from mshabunin:fix-imread-arg
imgproc: fixed imread with output image argument
2024-06-06 12:50:30 +03:00
Alexander Smorkalov a5d9c29b12 Merge pull request #25716 from alexlyulkov:al/mediandk-fix
Added potential fix for Android H264 Encoding Bug
2024-06-06 12:48:20 +03:00
Vadim Levin 5dd7b5f0e5 fix: mark floodFill mask as optional in Python typing stubs 2024-06-06 11:51:10 +03:00
Alexander Lyulkov 99f32f17b4 Added potential fix for Android H264 Encoding Bug 2024-06-05 19:17:49 +03:00
Maksim Shabunin b77c74b6fc imgproc: fixed imread with output image argument, minor refactoring, fixes in HDR 2024-06-04 19:52:22 +03:00
cudawarped 9c05b27ba0 cuda: Add missing python CUDA dependency when CUDA is a first class language 2024-06-04 18:58:09 +03:00
Alexander Smorkalov 92b588f30b Merge pull request #25702 from asmorkalov:as/gapi_disable_steaming_again
Disable more G-API streaming test due to unstability.
2024-06-04 13:01:21 +03:00
Alexander Smorkalov 2bb8b2b173 Disable more G-API streaming test due to unstability. 2024-06-04 11:07:22 +03:00
Alexander Smorkalov d8f0838fa3 Merge pull request #25701 from keanep:I25700
Update cv::FaceRecognizerSF class documentation
2024-06-04 11:03:31 +03:00
Patrick Keane 3f26664e8d ISSUE-25700 update cv::FaceRecognizerSF class documentation 2024-06-03 17:29:41 -04:00
Alexander Alekhin 337c183b9d Merge tag '4.10.0' 2024-06-02 18:24:06 +00:00
Christine Poerschke 8b2783e9ff replace lena.jpg in find-existing-file tests 2024-05-25 08:53:33 +01:00
Alexander Alekhin 4c7a70cb5f video(test): filter very long debug tests 2024-02-15 07:52:28 +00:00
1986 changed files with 124678 additions and 95667 deletions
+2 -2
View File
@@ -2,8 +2,8 @@
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
- [ ] I agree to contribute to the project under Apache 2 License.
- [ ] 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] 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
+14
View File
@@ -0,0 +1,14 @@
name: 4.x
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
CodeQL:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-CodeQL.yaml@main
with:
target_branch: '4.x'
workflow_branch: main
+13 -23
View File
@@ -6,37 +6,30 @@ on:
- 4.x
jobs:
Ubuntu2004-ARM64:
Linux:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-Linux.yaml@main
with:
workflow_branch: main
Windows:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-Windows.yaml@main
with:
workflow_branch: main
Ubuntu2404-ARM64:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-ARM64.yaml@main
Ubuntu2004-ARM64-Debug:
Ubuntu2404-ARM64-Debug:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-ARM64-Debug.yaml@main
Ubuntu2004-x64:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-U20.yaml@main
Ubuntu2004-x64-OpenVINO:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-U20-OpenVINO.yaml@main
Ubuntu2204-x64:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-U22.yaml@main
Ubuntu2404-x64:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-U24.yaml@main
Ubuntu2004-x64-CUDA:
if: "${{ contains(github.event.pull_request.labels.*.name, 'category: dnn') }} || ${{ contains(github.event.pull_request.labels.*.name, 'category: dnn (onnx)') }}"
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-U20-Cuda.yaml@main
Windows10-x64:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-W10.yaml@main
Windows10-ARM64:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-W10-ARM64.yaml@main
Windows10-x64-Vulkan:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-W10-Vulkan.yaml@main
macOS-ARM64:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-macOS-ARM64.yaml@main
@@ -52,9 +45,6 @@ jobs:
Android-SDK:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-4.x-Android-SDK.yaml@main
Android-Test:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-Android-Test.yaml@main
TIM-VX:
uses: opencv/ci-gha-workflow/.github/workflows/OCV-timvx-backend-tests-4.x.yml@main
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2017 by Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+366
View File
@@ -0,0 +1,366 @@
/*!
* Copyright (c) 2017 by Contributors
* \file dlpack.h
* \brief The common header of DLPack.
*/
#ifndef DLPACK_DLPACK_H_
#define DLPACK_DLPACK_H_
/**
* \brief Compatibility with C++
*/
#ifdef __cplusplus
#define DLPACK_EXTERN_C extern "C"
#else
#define DLPACK_EXTERN_C
#endif
/*! \brief The current major version of dlpack */
#define DLPACK_MAJOR_VERSION 1
/*! \brief The current minor version of dlpack */
#define DLPACK_MINOR_VERSION 1
/*! \brief DLPACK_DLL prefix for windows */
#ifdef _WIN32
#ifdef DLPACK_EXPORTS
#define DLPACK_DLL __declspec(dllexport)
#else
#define DLPACK_DLL __declspec(dllimport)
#endif
#else
#define DLPACK_DLL
#endif
#include <stdint.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/*!
* \brief The DLPack version.
*
* A change in major version indicates that we have changed the
* data layout of the ABI - DLManagedTensorVersioned.
*
* A change in minor version indicates that we have added new
* code, such as a new device type, but the ABI is kept the same.
*
* If an obtained DLPack tensor has a major version that disagrees
* with the version number specified in this header file
* (i.e. major != DLPACK_MAJOR_VERSION), the consumer must call the deleter
* (and it is safe to do so). It is not safe to access any other fields
* as the memory layout will have changed.
*
* In the case of a minor version mismatch, the tensor can be safely used as
* long as the consumer knows how to interpret all fields. Minor version
* updates indicate the addition of enumeration values.
*/
typedef struct {
/*! \brief DLPack major version. */
uint32_t major;
/*! \brief DLPack minor version. */
uint32_t minor;
} DLPackVersion;
/*!
* \brief The device type in DLDevice.
*/
#ifdef __cplusplus
typedef enum : int32_t {
#else
typedef enum {
#endif
/*! \brief CPU device */
kDLCPU = 1,
/*! \brief CUDA GPU device */
kDLCUDA = 2,
/*!
* \brief Pinned CUDA CPU memory by cudaMallocHost
*/
kDLCUDAHost = 3,
/*! \brief OpenCL devices. */
kDLOpenCL = 4,
/*! \brief Vulkan buffer for next generation graphics. */
kDLVulkan = 7,
/*! \brief Metal for Apple GPU. */
kDLMetal = 8,
/*! \brief Verilog simulator buffer */
kDLVPI = 9,
/*! \brief ROCm GPUs for AMD GPUs */
kDLROCM = 10,
/*!
* \brief Pinned ROCm CPU memory allocated by hipMallocHost
*/
kDLROCMHost = 11,
/*!
* \brief Reserved extension device type,
* used for quickly test extension device
* The semantics can differ depending on the implementation.
*/
kDLExtDev = 12,
/*!
* \brief CUDA managed/unified memory allocated by cudaMallocManaged
*/
kDLCUDAManaged = 13,
/*!
* \brief Unified shared memory allocated on a oneAPI non-partititioned
* device. Call to oneAPI runtime is required to determine the device
* type, the USM allocation type and the sycl context it is bound to.
*
*/
kDLOneAPI = 14,
/*! \brief GPU support for next generation WebGPU standard. */
kDLWebGPU = 15,
/*! \brief Qualcomm Hexagon DSP */
kDLHexagon = 16,
/*! \brief Microsoft MAIA devices */
kDLMAIA = 17,
} DLDeviceType;
/*!
* \brief A Device for Tensor and operator.
*/
typedef struct {
/*! \brief The device type used in the device. */
DLDeviceType device_type;
/*!
* \brief The device index.
* For vanilla CPU memory, pinned memory, or managed memory, this is set to 0.
*/
int32_t device_id;
} DLDevice;
/*!
* \brief The type code options DLDataType.
*/
typedef enum {
/*! \brief signed integer */
kDLInt = 0U,
/*! \brief unsigned integer */
kDLUInt = 1U,
/*! \brief IEEE floating point */
kDLFloat = 2U,
/*!
* \brief Opaque handle type, reserved for testing purposes.
* Frameworks need to agree on the handle data type for the exchange to be well-defined.
*/
kDLOpaqueHandle = 3U,
/*! \brief bfloat16 */
kDLBfloat = 4U,
/*!
* \brief complex number
* (C/C++/Python layout: compact struct per complex number)
*/
kDLComplex = 5U,
/*! \brief boolean */
kDLBool = 6U,
/*! \brief FP8 data types */
kDLFloat8_e3m4 = 7U,
kDLFloat8_e4m3 = 8U,
kDLFloat8_e4m3b11fnuz = 9U,
kDLFloat8_e4m3fn = 10U,
kDLFloat8_e4m3fnuz = 11U,
kDLFloat8_e5m2 = 12U,
kDLFloat8_e5m2fnuz = 13U,
kDLFloat8_e8m0fnu = 14U,
/*! \brief FP6 data types
* Setting bits != 6 is currently unspecified, and the producer must ensure it is set
* while the consumer must stop importing if the value is unexpected.
*/
kDLFloat6_e2m3fn = 15U,
kDLFloat6_e3m2fn = 16U,
/*! \brief FP4 data types
* Setting bits != 4 is currently unspecified, and the producer must ensure it is set
* while the consumer must stop importing if the value is unexpected.
*/
kDLFloat4_e2m1fn = 17U,
} DLDataTypeCode;
/*!
* \brief The data type the tensor can hold. The data type is assumed to follow the
* native endian-ness. An explicit error message should be raised when attempting to
* export an array with non-native endianness
*
* Examples
* - float: type_code = 2, bits = 32, lanes = 1
* - float4(vectorized 4 float): type_code = 2, bits = 32, lanes = 4
* - int8: type_code = 0, bits = 8, lanes = 1
* - std::complex<float>: type_code = 5, bits = 64, lanes = 1
* - bool: type_code = 6, bits = 8, lanes = 1 (as per common array library convention, the underlying storage size of bool is 8 bits)
* - float8_e4m3: type_code = 8, bits = 8, lanes = 1 (packed in memory)
* - float6_e3m2fn: type_code = 16, bits = 6, lanes = 1 (packed in memory)
* - float4_e2m1fn: type_code = 17, bits = 4, lanes = 1 (packed in memory)
*
* When a sub-byte type is packed, DLPack requires the data to be in little bit-endian, i.e.,
* for a packed data set D ((D >> (i * bits)) && bit_mask) stores the i-th element.
*/
typedef struct {
/*!
* \brief Type code of base types.
* We keep it uint8_t instead of DLDataTypeCode for minimal memory
* footprint, but the value should be one of DLDataTypeCode enum values.
* */
uint8_t code;
/*!
* \brief Number of bits, common choices are 8, 16, 32.
*/
uint8_t bits;
/*! \brief Number of lanes in the type, used for vector types. */
uint16_t lanes;
} DLDataType;
/*!
* \brief Plain C Tensor object, does not manage memory.
*/
typedef struct {
/*!
* \brief The data pointer points to the allocated data. This will be CUDA
* device pointer or cl_mem handle in OpenCL. It may be opaque on some device
* types. This pointer is always aligned to 256 bytes as in CUDA. The
* `byte_offset` field should be used to point to the beginning of the data.
*
* Note that as of Nov 2021, multiply libraries (CuPy, PyTorch, TensorFlow,
* TVM, perhaps others) do not adhere to this 256 byte aligment requirement
* on CPU/CUDA/ROCm, and always use `byte_offset=0`. This must be fixed
* (after which this note will be updated); at the moment it is recommended
* to not rely on the data pointer being correctly aligned.
*
* For given DLTensor, the size of memory required to store the contents of
* data is calculated as follows:
*
* \code{.c}
* static inline size_t GetDataSize(const DLTensor* t) {
* size_t size = 1;
* for (tvm_index_t i = 0; i < t->ndim; ++i) {
* size *= t->shape[i];
* }
* size *= (t->dtype.bits * t->dtype.lanes + 7) / 8;
* return size;
* }
* \endcode
*
* Note that if the tensor is of size zero, then the data pointer should be
* set to `NULL`.
*/
void* data;
/*! \brief The device of the tensor */
DLDevice device;
/*! \brief Number of dimensions */
int32_t ndim;
/*! \brief The data type of the pointer*/
DLDataType dtype;
/*! \brief The shape of the tensor */
int64_t* shape;
/*!
* \brief strides of the tensor (in number of elements, not bytes)
* can be NULL, indicating tensor is compact and row-majored.
*/
int64_t* strides;
/*! \brief The offset in bytes to the beginning pointer to data */
uint64_t byte_offset;
} DLTensor;
/*!
* \brief C Tensor object, manage memory of DLTensor. This data structure is
* intended to facilitate the borrowing of DLTensor by another framework. It is
* not meant to transfer the tensor. When the borrowing framework doesn't need
* the tensor, it should call the deleter to notify the host that the resource
* is no longer needed.
*
* \note This data structure is used as Legacy DLManagedTensor
* in DLPack exchange and is deprecated after DLPack v0.8
* Use DLManagedTensorVersioned instead.
* This data structure may get renamed or deleted in future versions.
*
* \sa DLManagedTensorVersioned
*/
typedef struct DLManagedTensor {
/*! \brief DLTensor which is being memory managed */
DLTensor dl_tensor;
/*! \brief the context of the original host framework of DLManagedTensor in
* which DLManagedTensor is used in the framework. It can also be NULL.
*/
void * manager_ctx;
/*!
* \brief Destructor - this should be called
* to destruct the manager_ctx which backs the DLManagedTensor. It can be
* NULL if there is no way for the caller to provide a reasonable destructor.
* The destructor deletes the argument self as well.
*/
void (*deleter)(struct DLManagedTensor * self);
} DLManagedTensor;
// bit masks used in in the DLManagedTensorVersioned
/*! \brief bit mask to indicate that the tensor is read only. */
#define DLPACK_FLAG_BITMASK_READ_ONLY (1UL << 0UL)
/*!
* \brief bit mask to indicate that the tensor is a copy made by the producer.
*
* If set, the tensor is considered solely owned throughout its lifetime by the
* consumer, until the producer-provided deleter is invoked.
*/
#define DLPACK_FLAG_BITMASK_IS_COPIED (1UL << 1UL)
/*
* \brief bit mask to indicate that whether a sub-byte type is packed or padded.
*
* The default for sub-byte types (ex: fp4/fp6) is assumed packed. This flag can
* be set by the producer to signal that a tensor of sub-byte type is padded.
*/
#define DLPACK_FLAG_BITMASK_IS_SUBBYTE_TYPE_PADDED (1UL << 2UL)
/*!
* \brief A versioned and managed C Tensor object, manage memory of DLTensor.
*
* This data structure is intended to facilitate the borrowing of DLTensor by
* another framework. It is not meant to transfer the tensor. When the borrowing
* framework doesn't need the tensor, it should call the deleter to notify the
* host that the resource is no longer needed.
*
* \note This is the current standard DLPack exchange data structure.
*/
struct DLManagedTensorVersioned {
/*!
* \brief The API and ABI version of the current managed Tensor
*/
DLPackVersion version;
/*!
* \brief the context of the original host framework.
*
* Stores DLManagedTensorVersioned is used in the
* framework. It can also be NULL.
*/
void *manager_ctx;
/*!
* \brief Destructor.
*
* This should be called to destruct manager_ctx which holds the DLManagedTensorVersioned.
* It can be NULL if there is no way for the caller to provide a reasonable
* destructor. The destructor deletes the argument self as well.
*/
void (*deleter)(struct DLManagedTensorVersioned *self);
/*!
* \brief Additional bitmask flags information about the tensor.
*
* By default the flags should be set to 0.
*
* \note Future ABI changes should keep everything until this field
* stable, to ensure that deleter can be correctly called.
*
* \sa DLPACK_FLAG_BITMASK_READ_ONLY
* \sa DLPACK_FLAG_BITMASK_IS_COPIED
*/
uint64_t flags;
/*! \brief DLTensor which is being memory managed */
DLTensor dl_tensor;
};
#ifdef __cplusplus
} // DLPACK_EXTERN_C
#endif
#endif // DLPACK_DLPACK_H_
+44
View File
@@ -0,0 +1,44 @@
function(download_fastcv root_dir)
# Commit SHA in the opencv_3rdparty repo
set(FASTCV_COMMIT "9e8d42b6d7e769548d70b2e5674e263b056de8b4")
# Define actual FastCV versions
if(ANDROID)
if(AARCH64)
message(STATUS "Download FastCV for Android aarch64")
set(FCV_PACKAGE_NAME "fastcv_android_aarch64_2025_07_09.tgz")
set(FCV_PACKAGE_HASH "8b9497858cf3c3502a0be4369d06ebf8")
else()
message(STATUS "Download FastCV for Android armv7")
set(FCV_PACKAGE_NAME "fastcv_android_arm32_2025_07_09.tgz")
set(FCV_PACKAGE_HASH "e0e6009c9f2f2b96140cd6a639c7383f")
endif()
elseif(UNIX AND NOT APPLE AND NOT IOS AND NOT XROS)
if(AARCH64)
set(FCV_PACKAGE_NAME "fastcv_linux_aarch64_2025_07_09.tgz")
set(FCV_PACKAGE_HASH "05e254e0eb3c13fa23eb7213f0fe6d82")
else()
message("FastCV: fastcv lib for 32-bit Linux is not supported for now!")
endif()
endif(ANDROID)
# Download Package
set(OPENCV_FASTCV_URL "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FASTCV_COMMIT}/fastcv/")
ocv_download( FILENAME ${FCV_PACKAGE_NAME}
HASH ${FCV_PACKAGE_HASH}
URL ${OPENCV_FASTCV_URL}
DESTINATION_DIR ${root_dir}
ID FASTCV
STATUS res
UNPACK
RELATIVE_URL)
if(res)
set(HAVE_FASTCV TRUE CACHE BOOL "FastCV status")
else()
message(WARNING "FastCV: package download failed!")
endif()
endfunction()
+5 -5
View File
@@ -1,8 +1,8 @@
# Binaries branch name: ffmpeg/4.x_20240522
# Binaries were created for OpenCV: 8393885a39dac1e650bf5d0aaff84c04ad8bcdd3
ocv_update(FFMPEG_BINARIES_COMMIT "394dca6ceb3085c979415e6385996b6570e94153")
ocv_update(FFMPEG_FILE_HASH_BIN32 "bdfbd1efb295f3e54c07d2cb7a843bf9")
ocv_update(FFMPEG_FILE_HASH_BIN64 "bfef029900f788480a363d6dc05c4f0e")
# Binaries branch name: ffmpeg/4.x_20251226
# Binaries were created for OpenCV: cff7581175d2abfc6aef2e4f04f482e258b5c864
ocv_update(FFMPEG_BINARIES_COMMIT "d82ad9a54a7b42a1648a9cae8fed5c2f20ea396c")
ocv_update(FFMPEG_FILE_HASH_BIN32 "47730de2286110b0d1250ff9cf50ce56")
ocv_update(FFMPEG_FILE_HASH_BIN64 "3248b4663ffef770cdb54ec8b9d16a28")
ocv_update(FFMPEG_FILE_HASH_CMAKE "8862c87496e2e8c375965e1277dee1c7")
function(download_win_ffmpeg script_var)
+1 -1
View File
@@ -1 +1 @@
Origin: https://github.com/google/flatbuffers/tree/v23.5.9
Origin: https://github.com/google/flatbuffers/tree/v25.9.23
+5 -5
View File
@@ -28,21 +28,21 @@ class Allocator {
virtual ~Allocator() {}
// Allocate `size` bytes of memory.
virtual uint8_t *allocate(size_t size) = 0;
virtual uint8_t* allocate(size_t size) = 0;
// Deallocate `size` bytes of memory at `p` allocated by this allocator.
virtual void deallocate(uint8_t *p, size_t size) = 0;
virtual void deallocate(uint8_t* p, size_t size) = 0;
// Reallocate `new_size` bytes of memory, replacing the old region of size
// `old_size` at `p`. In contrast to a normal realloc, this grows downwards,
// and is intended specifcally for `vector_downward` use.
// `in_use_back` and `in_use_front` indicate how much of `old_size` is
// actually in use at each end, and needs to be copied.
virtual uint8_t *reallocate_downward(uint8_t *old_p, size_t old_size,
virtual uint8_t* reallocate_downward(uint8_t* old_p, size_t old_size,
size_t new_size, size_t in_use_back,
size_t in_use_front) {
FLATBUFFERS_ASSERT(new_size > old_size); // vector_downward only grows
uint8_t *new_p = allocate(new_size);
uint8_t* new_p = allocate(new_size);
memcpy_downward(old_p, old_size, new_p, new_size, in_use_back,
in_use_front);
deallocate(old_p, old_size);
@@ -54,7 +54,7 @@ class Allocator {
// to `new_p` of `new_size`. Only memory of size `in_use_front` and
// `in_use_back` will be copied from the front and back of the old memory
// allocation.
void memcpy_downward(uint8_t *old_p, size_t old_size, uint8_t *new_p,
void memcpy_downward(uint8_t* old_p, size_t old_size, uint8_t* new_p,
size_t new_size, size_t in_use_back,
size_t in_use_front) {
memcpy(new_p + new_size - in_use_back, old_p + old_size - in_use_back,
+49 -48
View File
@@ -27,17 +27,15 @@
namespace flatbuffers {
// This is used as a helper type for accessing arrays.
template<typename T, uint16_t length> class Array {
template <typename T, uint16_t length>
class Array {
// Array<T> can carry only POD data types (scalars or structs).
typedef typename flatbuffers::bool_constant<flatbuffers::is_scalar<T>::value>
scalar_tag;
typedef
typename flatbuffers::conditional<scalar_tag::value, T, const T *>::type
IndirectHelperType;
public:
typedef uint16_t size_type;
typedef typename IndirectHelper<IndirectHelperType>::return_type return_type;
typedef typename IndirectHelper<T>::return_type return_type;
typedef VectorConstIterator<T, return_type, uoffset_t> const_iterator;
typedef VectorReverseIterator<const_iterator> const_reverse_iterator;
@@ -50,7 +48,7 @@ template<typename T, uint16_t length> class Array {
return_type Get(uoffset_t i) const {
FLATBUFFERS_ASSERT(i < size());
return IndirectHelper<IndirectHelperType>::Read(Data(), i);
return IndirectHelper<T>::Read(Data(), i);
}
return_type operator[](uoffset_t i) const { return Get(i); }
@@ -58,7 +56,8 @@ template<typename T, uint16_t length> class Array {
// If this is a Vector of enums, T will be its storage type, not the enum
// type. This function makes it convenient to retrieve value with enum
// type E.
template<typename E> E GetEnum(uoffset_t i) const {
template <typename E>
E GetEnum(uoffset_t i) const {
return static_cast<E>(Get(i));
}
@@ -83,28 +82,28 @@ template<typename T, uint16_t length> class Array {
// operation. For primitive types use @p Mutate directly.
// @warning Assignments and reads to/from the dereferenced pointer are not
// automatically converted to the correct endianness.
typename flatbuffers::conditional<scalar_tag::value, void, T *>::type
typename flatbuffers::conditional<scalar_tag::value, void, T*>::type
GetMutablePointer(uoffset_t i) const {
FLATBUFFERS_ASSERT(i < size());
return const_cast<T *>(&data()[i]);
return const_cast<T*>(&data()[i]);
}
// Change elements if you have a non-const pointer to this object.
void Mutate(uoffset_t i, const T &val) { MutateImpl(scalar_tag(), i, val); }
void Mutate(uoffset_t i, const T& val) { MutateImpl(scalar_tag(), i, val); }
// The raw data in little endian format. Use with care.
const uint8_t *Data() const { return data_; }
const uint8_t* Data() const { return data_; }
uint8_t *Data() { return data_; }
uint8_t* Data() { return data_; }
// Similarly, but typed, much like std::vector::data
const T *data() const { return reinterpret_cast<const T *>(Data()); }
T *data() { return reinterpret_cast<T *>(Data()); }
const T* data() const { return reinterpret_cast<const T*>(Data()); }
T* data() { return reinterpret_cast<T*>(Data()); }
// Copy data from a span with endian conversion.
// If this Array and the span overlap, the behavior is undefined.
void CopyFromSpan(flatbuffers::span<const T, length> src) {
const auto p1 = reinterpret_cast<const uint8_t *>(src.data());
const auto p1 = reinterpret_cast<const uint8_t*>(src.data());
const auto p2 = Data();
FLATBUFFERS_ASSERT(!(p1 >= p2 && p1 < (p2 + length)) &&
!(p2 >= p1 && p2 < (p1 + length)));
@@ -114,12 +113,12 @@ template<typename T, uint16_t length> class Array {
}
protected:
void MutateImpl(flatbuffers::true_type, uoffset_t i, const T &val) {
void MutateImpl(flatbuffers::true_type, uoffset_t i, const T& val) {
FLATBUFFERS_ASSERT(i < size());
WriteScalar(data() + i, val);
}
void MutateImpl(flatbuffers::false_type, uoffset_t i, const T &val) {
void MutateImpl(flatbuffers::false_type, uoffset_t i, const T& val) {
*(GetMutablePointer(i)) = val;
}
@@ -134,7 +133,9 @@ template<typename T, uint16_t length> class Array {
// Copy data from flatbuffers::span with endian conversion.
void CopyFromSpanImpl(flatbuffers::false_type,
flatbuffers::span<const T, length> src) {
for (size_type k = 0; k < length; k++) { Mutate(k, src[k]); }
for (size_type k = 0; k < length; k++) {
Mutate(k, src[k]);
}
}
// This class is only used to access pre-existing data. Don't ever
@@ -153,21 +154,21 @@ template<typename T, uint16_t length> class Array {
private:
// This class is a pointer. Copying will therefore create an invalid object.
// Private and unimplemented copy constructor.
Array(const Array &);
Array &operator=(const Array &);
Array(const Array&);
Array& operator=(const Array&);
};
// Specialization for Array[struct] with access using Offset<void> pointer.
// This specialization used by idl_gen_text.cpp.
template<typename T, uint16_t length, template<typename> class OffsetT>
template <typename T, uint16_t length, template <typename> class OffsetT>
class Array<OffsetT<T>, length> {
static_assert(flatbuffers::is_same<T, void>::value, "unexpected type T");
public:
typedef const void *return_type;
typedef const void* return_type;
typedef uint16_t size_type;
const uint8_t *Data() const { return data_; }
const uint8_t* Data() const { return data_; }
// Make idl_gen_text.cpp::PrintContainer happy.
return_type operator[](uoffset_t) const {
@@ -178,14 +179,14 @@ class Array<OffsetT<T>, length> {
private:
// This class is only used to access pre-existing data.
Array();
Array(const Array &);
Array &operator=(const Array &);
Array(const Array&);
Array& operator=(const Array&);
uint8_t data_[1];
};
template<class U, uint16_t N>
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<U, N> make_span(Array<U, N> &arr)
template <class U, uint16_t N>
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<U, N> make_span(Array<U, N>& arr)
FLATBUFFERS_NOEXCEPT {
static_assert(
Array<U, N>::is_span_observable,
@@ -193,26 +194,26 @@ FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<U, N> make_span(Array<U, N> &arr)
return span<U, N>(arr.data(), N);
}
template<class U, uint16_t N>
template <class U, uint16_t N>
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<const U, N> make_span(
const Array<U, N> &arr) FLATBUFFERS_NOEXCEPT {
const Array<U, N>& arr) FLATBUFFERS_NOEXCEPT {
static_assert(
Array<U, N>::is_span_observable,
"wrong type U, only plain struct, LE-scalar, or byte types are allowed");
return span<const U, N>(arr.data(), N);
}
template<class U, uint16_t N>
template <class U, uint16_t N>
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<uint8_t, sizeof(U) * N>
make_bytes_span(Array<U, N> &arr) FLATBUFFERS_NOEXCEPT {
make_bytes_span(Array<U, N>& arr) FLATBUFFERS_NOEXCEPT {
static_assert(Array<U, N>::is_span_observable,
"internal error, Array<T> might hold only scalars or structs");
return span<uint8_t, sizeof(U) * N>(arr.Data(), sizeof(U) * N);
}
template<class U, uint16_t N>
template <class U, uint16_t N>
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<const uint8_t, sizeof(U) * N>
make_bytes_span(const Array<U, N> &arr) FLATBUFFERS_NOEXCEPT {
make_bytes_span(const Array<U, N>& arr) FLATBUFFERS_NOEXCEPT {
static_assert(Array<U, N>::is_span_observable,
"internal error, Array<T> might hold only scalars or structs");
return span<const uint8_t, sizeof(U) * N>(arr.Data(), sizeof(U) * N);
@@ -221,31 +222,31 @@ make_bytes_span(const Array<U, N> &arr) FLATBUFFERS_NOEXCEPT {
// Cast a raw T[length] to a raw flatbuffers::Array<T, length>
// without endian conversion. Use with care.
// TODO: move these Cast-methods to `internal` namespace.
template<typename T, uint16_t length>
Array<T, length> &CastToArray(T (&arr)[length]) {
return *reinterpret_cast<Array<T, length> *>(arr);
template <typename T, uint16_t length>
Array<T, length>& CastToArray(T (&arr)[length]) {
return *reinterpret_cast<Array<T, length>*>(arr);
}
template<typename T, uint16_t length>
const Array<T, length> &CastToArray(const T (&arr)[length]) {
return *reinterpret_cast<const Array<T, length> *>(arr);
template <typename T, uint16_t length>
const Array<T, length>& CastToArray(const T (&arr)[length]) {
return *reinterpret_cast<const Array<T, length>*>(arr);
}
template<typename E, typename T, uint16_t length>
Array<E, length> &CastToArrayOfEnum(T (&arr)[length]) {
template <typename E, typename T, uint16_t length>
Array<E, length>& CastToArrayOfEnum(T (&arr)[length]) {
static_assert(sizeof(E) == sizeof(T), "invalid enum type E");
return *reinterpret_cast<Array<E, length> *>(arr);
return *reinterpret_cast<Array<E, length>*>(arr);
}
template<typename E, typename T, uint16_t length>
const Array<E, length> &CastToArrayOfEnum(const T (&arr)[length]) {
template <typename E, typename T, uint16_t length>
const Array<E, length>& CastToArrayOfEnum(const T (&arr)[length]) {
static_assert(sizeof(E) == sizeof(T), "invalid enum type E");
return *reinterpret_cast<const Array<E, length> *>(arr);
return *reinterpret_cast<const Array<E, length>*>(arr);
}
template<typename T, uint16_t length>
bool operator==(const Array<T, length> &lhs,
const Array<T, length> &rhs) noexcept {
template <typename T, uint16_t length>
bool operator==(const Array<T, length>& lhs,
const Array<T, length>& rhs) noexcept {
return std::addressof(lhs) == std::addressof(rhs) ||
(lhs.size() == rhs.size() &&
std::memcmp(lhs.Data(), rhs.Data(), rhs.size() * sizeof(T)) == 0);
+30 -22
View File
@@ -139,9 +139,9 @@
#endif
#endif // !defined(FLATBUFFERS_LITTLEENDIAN)
#define FLATBUFFERS_VERSION_MAJOR 23
#define FLATBUFFERS_VERSION_MINOR 5
#define FLATBUFFERS_VERSION_REVISION 9
#define FLATBUFFERS_VERSION_MAJOR 25
#define FLATBUFFERS_VERSION_MINOR 9
#define FLATBUFFERS_VERSION_REVISION 23
#define FLATBUFFERS_STRING_EXPAND(X) #X
#define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X)
namespace flatbuffers {
@@ -155,7 +155,7 @@ namespace flatbuffers {
#define FLATBUFFERS_FINAL_CLASS final
#define FLATBUFFERS_OVERRIDE override
#define FLATBUFFERS_EXPLICIT_CPP11 explicit
#define FLATBUFFERS_VTABLE_UNDERLYING_TYPE : flatbuffers::voffset_t
#define FLATBUFFERS_VTABLE_UNDERLYING_TYPE : ::flatbuffers::voffset_t
#else
#define FLATBUFFERS_FINAL_CLASS
#define FLATBUFFERS_OVERRIDE
@@ -279,20 +279,22 @@ namespace flatbuffers {
#endif // !FLATBUFFERS_LOCALE_INDEPENDENT
// Suppress Undefined Behavior Sanitizer (recoverable only). Usage:
// - __suppress_ubsan__("undefined")
// - __suppress_ubsan__("signed-integer-overflow")
// - FLATBUFFERS_SUPPRESS_UBSAN("undefined")
// - FLATBUFFERS_SUPPRESS_UBSAN("signed-integer-overflow")
#if defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >=7))
#define __suppress_ubsan__(type) __attribute__((no_sanitize(type)))
#define FLATBUFFERS_SUPPRESS_UBSAN(type) __attribute__((no_sanitize(type)))
#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)
#define __suppress_ubsan__(type) __attribute__((no_sanitize_undefined))
#define FLATBUFFERS_SUPPRESS_UBSAN(type) __attribute__((no_sanitize_undefined))
#else
#define __suppress_ubsan__(type)
#define FLATBUFFERS_SUPPRESS_UBSAN(type)
#endif
// This is constexpr function used for checking compile-time constants.
// Avoid `#pragma warning(disable: 4127) // C4127: expression is constant`.
template<typename T> FLATBUFFERS_CONSTEXPR inline bool IsConstTrue(T t) {
return !!t;
namespace flatbuffers {
// This is constexpr function used for checking compile-time constants.
// Avoid `#pragma warning(disable: 4127) // C4127: expression is constant`.
template<typename T> FLATBUFFERS_CONSTEXPR inline bool IsConstTrue(T t) {
return !!t;
}
}
// Enable C++ attribute [[]] if std:c++17 or higher.
@@ -337,15 +339,15 @@ typedef uint16_t voffset_t;
typedef uintmax_t largest_scalar_t;
// In 32bits, this evaluates to 2GB - 1
#define FLATBUFFERS_MAX_BUFFER_SIZE std::numeric_limits<::flatbuffers::soffset_t>::max()
#define FLATBUFFERS_MAX_64_BUFFER_SIZE std::numeric_limits<::flatbuffers::soffset64_t>::max()
#define FLATBUFFERS_MAX_BUFFER_SIZE (std::numeric_limits<::flatbuffers::soffset_t>::max)()
#define FLATBUFFERS_MAX_64_BUFFER_SIZE (std::numeric_limits<::flatbuffers::soffset64_t>::max)()
// The minimum size buffer that can be a valid flatbuffer.
// Includes the offset to the root table (uoffset_t), the offset to the vtable
// of the root table (soffset_t), the size of the vtable (uint16_t), and the
// size of the referring table (uint16_t).
#define FLATBUFFERS_MIN_BUFFER_SIZE sizeof(uoffset_t) + sizeof(soffset_t) + \
sizeof(uint16_t) + sizeof(uint16_t)
#define FLATBUFFERS_MIN_BUFFER_SIZE sizeof(::flatbuffers::uoffset_t) + \
sizeof(::flatbuffers::soffset_t) + sizeof(uint16_t) + sizeof(uint16_t)
// We support aligning the contents of buffers up to this size.
#ifndef FLATBUFFERS_MAX_ALIGNMENT
@@ -361,7 +363,6 @@ inline bool VerifyAlignmentRequirements(size_t align, size_t min_align = 1) {
}
#if defined(_MSC_VER)
#pragma warning(disable: 4351) // C4351: new behavior: elements of array ... will be default initialized
#pragma warning(push)
#pragma warning(disable: 4127) // C4127: conditional expression is constant
#endif
@@ -422,7 +423,7 @@ template<typename T> T EndianScalar(T t) {
template<typename T>
// UBSAN: C++ aliasing type rules, see std::bit_cast<> for details.
__suppress_ubsan__("alignment")
FLATBUFFERS_SUPPRESS_UBSAN("alignment")
T ReadScalar(const void *p) {
return EndianScalar(*reinterpret_cast<const T *>(p));
}
@@ -436,13 +437,13 @@ T ReadScalar(const void *p) {
template<typename T>
// UBSAN: C++ aliasing type rules, see std::bit_cast<> for details.
__suppress_ubsan__("alignment")
FLATBUFFERS_SUPPRESS_UBSAN("alignment")
void WriteScalar(void *p, T t) {
*reinterpret_cast<T *>(p) = EndianScalar(t);
}
template<typename T> struct Offset;
template<typename T> __suppress_ubsan__("alignment") void WriteScalar(void *p, Offset<T> t) {
template<typename T> FLATBUFFERS_SUPPRESS_UBSAN("alignment") void WriteScalar(void *p, Offset<T> t) {
*reinterpret_cast<uoffset_t *>(p) = EndianScalar(t.o);
}
@@ -453,15 +454,22 @@ template<typename T> __suppress_ubsan__("alignment") void WriteScalar(void *p, O
// Computes how many bytes you'd have to pad to be able to write an
// "scalar_size" scalar if the buffer had grown to "buf_size" (downwards in
// memory).
__suppress_ubsan__("unsigned-integer-overflow")
FLATBUFFERS_SUPPRESS_UBSAN("unsigned-integer-overflow")
inline size_t PaddingBytes(size_t buf_size, size_t scalar_size) {
return ((~buf_size) + 1) & (scalar_size - 1);
}
#if !defined(_MSC_VER)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
// Generic 'operator==' with conditional specialisations.
// T e - new value of a scalar field.
// T def - default of scalar (is known at compile-time).
template<typename T> inline bool IsTheSameAs(T e, T def) { return e == def; }
#if !defined(_MSC_VER)
#pragma GCC diagnostic pop
#endif
#if defined(FLATBUFFERS_NAN_DEFAULTS) && \
defined(FLATBUFFERS_HAS_NEW_STRTOD) && (FLATBUFFERS_HAS_NEW_STRTOD > 0)
+65 -39
View File
@@ -20,12 +20,14 @@
#include <algorithm>
#include "flatbuffers/base.h"
#include "flatbuffers/stl_emulation.h"
namespace flatbuffers {
// Wrapper for uoffset_t to allow safe template specialization.
// Value is allowed to be 0 to indicate a null object (see e.g. AddOffset).
template<typename T = void> struct Offset {
template <typename T = void>
struct Offset {
// The type of offset to use.
typedef uoffset_t offset_type;
@@ -36,8 +38,14 @@ template<typename T = void> struct Offset {
bool IsNull() const { return !o; }
};
template <typename T>
struct is_specialisation_of_Offset : false_type {};
template <typename T>
struct is_specialisation_of_Offset<Offset<T>> : true_type {};
// Wrapper for uoffset64_t Offsets.
template<typename T = void> struct Offset64 {
template <typename T = void>
struct Offset64 {
// The type of offset to use.
typedef uoffset64_t offset_type;
@@ -48,6 +56,11 @@ template<typename T = void> struct Offset64 {
bool IsNull() const { return !o; }
};
template <typename T>
struct is_specialisation_of_Offset64 : false_type {};
template <typename T>
struct is_specialisation_of_Offset64<Offset64<T>> : true_type {};
// Litmus check for ensuring the Offsets are the expected size.
static_assert(sizeof(Offset<>) == 4, "Offset has wrong size");
static_assert(sizeof(Offset64<>) == 8, "Offset64 has wrong size");
@@ -55,12 +68,13 @@ static_assert(sizeof(Offset64<>) == 8, "Offset64 has wrong size");
inline void EndianCheck() {
int endiantest = 1;
// If this fails, see FLATBUFFERS_LITTLEENDIAN above.
FLATBUFFERS_ASSERT(*reinterpret_cast<char *>(&endiantest) ==
FLATBUFFERS_ASSERT(*reinterpret_cast<char*>(&endiantest) ==
FLATBUFFERS_LITTLEENDIAN);
(void)endiantest;
}
template<typename T> FLATBUFFERS_CONSTEXPR size_t AlignOf() {
template <typename T>
FLATBUFFERS_CONSTEXPR size_t AlignOf() {
// clang-format off
#ifdef _MSC_VER
return __alignof(T);
@@ -76,8 +90,8 @@ template<typename T> FLATBUFFERS_CONSTEXPR size_t AlignOf() {
// Lexicographically compare two strings (possibly containing nulls), and
// return true if the first is less than the second.
static inline bool StringLessThan(const char *a_data, uoffset_t a_size,
const char *b_data, uoffset_t b_size) {
static inline bool StringLessThan(const char* a_data, uoffset_t a_size,
const char* b_data, uoffset_t b_size) {
const auto cmp = memcmp(a_data, b_data, (std::min)(a_size, b_size));
return cmp == 0 ? a_size < b_size : cmp < 0;
}
@@ -90,42 +104,43 @@ static inline bool StringLessThan(const char *a_data, uoffset_t a_size,
// return type like this.
// The typedef is for the convenience of callers of this function
// (avoiding the need for a trailing return decltype)
template<typename T> struct IndirectHelper {
template <typename T, typename Enable = void>
struct IndirectHelper {
typedef T return_type;
typedef T mutable_return_type;
static const size_t element_stride = sizeof(T);
static return_type Read(const uint8_t *p, const size_t i) {
return EndianScalar((reinterpret_cast<const T *>(p))[i]);
static return_type Read(const uint8_t* p, const size_t i) {
return EndianScalar((reinterpret_cast<const T*>(p))[i]);
}
static mutable_return_type Read(uint8_t *p, const size_t i) {
static mutable_return_type Read(uint8_t* p, const size_t i) {
return reinterpret_cast<mutable_return_type>(
Read(const_cast<const uint8_t *>(p), i));
Read(const_cast<const uint8_t*>(p), i));
}
};
// For vector of Offsets.
template<typename T, template<typename> class OffsetT>
template <typename T, template <typename> class OffsetT>
struct IndirectHelper<OffsetT<T>> {
typedef const T *return_type;
typedef T *mutable_return_type;
typedef const T* return_type;
typedef T* mutable_return_type;
typedef typename OffsetT<T>::offset_type offset_type;
static const offset_type element_stride = sizeof(offset_type);
static return_type Read(const uint8_t *const p, const offset_type i) {
static return_type Read(const uint8_t* const p, const offset_type i) {
// Offsets are relative to themselves, so first update the pointer to
// point to the offset location.
const uint8_t *const offset_location = p + i * element_stride;
const uint8_t* const offset_location = p + i * element_stride;
// Then read the scalar value of the offset (which may be 32 or 64-bits) and
// then determine the relative location from the offset location.
return reinterpret_cast<return_type>(
offset_location + ReadScalar<offset_type>(offset_location));
}
static mutable_return_type Read(uint8_t *const p, const offset_type i) {
static mutable_return_type Read(uint8_t* const p, const offset_type i) {
// Offsets are relative to themselves, so first update the pointer to
// point to the offset location.
uint8_t *const offset_location = p + i * element_stride;
uint8_t* const offset_location = p + i * element_stride;
// Then read the scalar value of the offset (which may be 32 or 64-bits) and
// then determine the relative location from the offset location.
@@ -135,16 +150,26 @@ struct IndirectHelper<OffsetT<T>> {
};
// For vector of structs.
template<typename T> struct IndirectHelper<const T *> {
typedef const T *return_type;
typedef T *mutable_return_type;
static const size_t element_stride = sizeof(T);
template <typename T>
struct IndirectHelper<
T, typename std::enable_if<
!std::is_scalar<typename std::remove_pointer<T>::type>::value &&
!is_specialisation_of_Offset<T>::value &&
!is_specialisation_of_Offset64<T>::value>::type> {
private:
typedef typename std::remove_pointer<typename std::remove_cv<T>::type>::type
pointee_type;
static return_type Read(const uint8_t *const p, const size_t i) {
public:
typedef const pointee_type* return_type;
typedef pointee_type* mutable_return_type;
static const size_t element_stride = sizeof(pointee_type);
static return_type Read(const uint8_t* const p, const size_t i) {
// Structs are stored inline, relative to the first struct pointer.
return reinterpret_cast<return_type>(p + i * element_stride);
}
static mutable_return_type Read(uint8_t *const p, const size_t i) {
static mutable_return_type Read(uint8_t* const p, const size_t i) {
// Structs are stored inline, relative to the first struct pointer.
return reinterpret_cast<mutable_return_type>(p + i * element_stride);
}
@@ -157,14 +182,14 @@ template<typename T> struct IndirectHelper<const T *> {
/// This function is UNDEFINED for FlatBuffers whose schema does not include
/// a file_identifier (likely points at padding or the start of a the root
/// vtable).
inline const char *GetBufferIdentifier(const void *buf,
inline const char* GetBufferIdentifier(const void* buf,
bool size_prefixed = false) {
return reinterpret_cast<const char *>(buf) +
return reinterpret_cast<const char*>(buf) +
((size_prefixed) ? 2 * sizeof(uoffset_t) : sizeof(uoffset_t));
}
// Helper to see if the identifier in a buffer has the expected value.
inline bool BufferHasIdentifier(const void *buf, const char *identifier,
inline bool BufferHasIdentifier(const void* buf, const char* identifier,
bool size_prefixed = false) {
return strncmp(GetBufferIdentifier(buf, size_prefixed), identifier,
flatbuffers::kFileIdentifierLength) == 0;
@@ -172,26 +197,27 @@ inline bool BufferHasIdentifier(const void *buf, const char *identifier,
/// @cond FLATBUFFERS_INTERNAL
// Helpers to get a typed pointer to the root object contained in the buffer.
template<typename T> T *GetMutableRoot(void *buf) {
template <typename T>
T* GetMutableRoot(void* buf) {
if (!buf) return nullptr;
EndianCheck();
return reinterpret_cast<T *>(
reinterpret_cast<uint8_t *>(buf) +
EndianScalar(*reinterpret_cast<uoffset_t *>(buf)));
return reinterpret_cast<T*>(reinterpret_cast<uint8_t*>(buf) +
EndianScalar(*reinterpret_cast<uoffset_t*>(buf)));
}
template<typename T, typename SizeT = uoffset_t>
T *GetMutableSizePrefixedRoot(void *buf) {
return GetMutableRoot<T>(reinterpret_cast<uint8_t *>(buf) + sizeof(SizeT));
template <typename T, typename SizeT = uoffset_t>
T* GetMutableSizePrefixedRoot(void* buf) {
return GetMutableRoot<T>(reinterpret_cast<uint8_t*>(buf) + sizeof(SizeT));
}
template<typename T> const T *GetRoot(const void *buf) {
return GetMutableRoot<T>(const_cast<void *>(buf));
template <typename T>
const T* GetRoot(const void* buf) {
return GetMutableRoot<T>(const_cast<void*>(buf));
}
template<typename T, typename SizeT = uoffset_t>
const T *GetSizePrefixedRoot(const void *buf) {
return GetRoot<T>(reinterpret_cast<const uint8_t *>(buf) + sizeof(SizeT));
template <typename T, typename SizeT = uoffset_t>
const T* GetSizePrefixedRoot(const void* buf) {
return GetRoot<T>(reinterpret_cast<const uint8_t*>(buf) + sizeof(SizeT));
}
} // namespace flatbuffers
+5 -4
View File
@@ -27,23 +27,24 @@ namespace flatbuffers {
// A BufferRef does not own its buffer.
struct BufferRefBase {}; // for std::is_base_of
template<typename T> struct BufferRef : BufferRefBase {
template <typename T>
struct BufferRef : BufferRefBase {
BufferRef() : buf(nullptr), len(0), must_free(false) {}
BufferRef(uint8_t *_buf, uoffset_t _len)
BufferRef(uint8_t* _buf, uoffset_t _len)
: buf(_buf), len(_len), must_free(false) {}
~BufferRef() {
if (must_free) free(buf);
}
const T *GetRoot() const { return flatbuffers::GetRoot<T>(buf); }
const T* GetRoot() const { return flatbuffers::GetRoot<T>(buf); }
bool Verify() {
Verifier verifier(buf, len);
return verifier.VerifyBuffer<T>(nullptr);
}
uint8_t *buf;
uint8_t* buf;
uoffset_t len;
bool must_free;
};
@@ -25,32 +25,32 @@ namespace flatbuffers {
// DefaultAllocator uses new/delete to allocate memory regions
class DefaultAllocator : public Allocator {
public:
uint8_t *allocate(size_t size) FLATBUFFERS_OVERRIDE {
uint8_t* allocate(size_t size) FLATBUFFERS_OVERRIDE {
return new uint8_t[size];
}
void deallocate(uint8_t *p, size_t) FLATBUFFERS_OVERRIDE { delete[] p; }
void deallocate(uint8_t* p, size_t) FLATBUFFERS_OVERRIDE { delete[] p; }
static void dealloc(void *p, size_t) { delete[] static_cast<uint8_t *>(p); }
static void dealloc(void* p, size_t) { delete[] static_cast<uint8_t*>(p); }
};
// These functions allow for a null allocator to mean use the default allocator,
// as used by DetachedBuffer and vector_downward below.
// This is to avoid having a statically or dynamically allocated default
// allocator, or having to move it between the classes that may own it.
inline uint8_t *Allocate(Allocator *allocator, size_t size) {
inline uint8_t* Allocate(Allocator* allocator, size_t size) {
return allocator ? allocator->allocate(size)
: DefaultAllocator().allocate(size);
}
inline void Deallocate(Allocator *allocator, uint8_t *p, size_t size) {
inline void Deallocate(Allocator* allocator, uint8_t* p, size_t size) {
if (allocator)
allocator->deallocate(p, size);
else
DefaultAllocator().deallocate(p, size);
}
inline uint8_t *ReallocateDownward(Allocator *allocator, uint8_t *old_p,
inline uint8_t* ReallocateDownward(Allocator* allocator, uint8_t* old_p,
size_t old_size, size_t new_size,
size_t in_use_back, size_t in_use_front) {
return allocator ? allocator->reallocate_downward(old_p, old_size, new_size,
+19 -12
View File
@@ -36,8 +36,8 @@ class DetachedBuffer {
cur_(nullptr),
size_(0) {}
DetachedBuffer(Allocator *allocator, bool own_allocator, uint8_t *buf,
size_t reserved, uint8_t *cur, size_t sz)
DetachedBuffer(Allocator* allocator, bool own_allocator, uint8_t* buf,
size_t reserved, uint8_t* cur, size_t sz)
: allocator_(allocator),
own_allocator_(own_allocator),
buf_(buf),
@@ -45,7 +45,7 @@ class DetachedBuffer {
cur_(cur),
size_(sz) {}
DetachedBuffer(DetachedBuffer &&other) noexcept
DetachedBuffer(DetachedBuffer&& other) noexcept
: allocator_(other.allocator_),
own_allocator_(other.own_allocator_),
buf_(other.buf_),
@@ -55,7 +55,7 @@ class DetachedBuffer {
other.reset();
}
DetachedBuffer &operator=(DetachedBuffer &&other) noexcept {
DetachedBuffer& operator=(DetachedBuffer&& other) noexcept {
if (this == &other) return *this;
destroy();
@@ -74,28 +74,35 @@ class DetachedBuffer {
~DetachedBuffer() { destroy(); }
const uint8_t *data() const { return cur_; }
const uint8_t* data() const { return cur_; }
uint8_t *data() { return cur_; }
uint8_t* data() { return cur_; }
size_t size() const { return size_; }
uint8_t* begin() { return data(); }
const uint8_t* begin() const { return data(); }
uint8_t* end() { return data() + size(); }
const uint8_t* end() const { return data() + size(); }
// These may change access mode, leave these at end of public section
FLATBUFFERS_DELETE_FUNC(DetachedBuffer(const DetachedBuffer &other));
FLATBUFFERS_DELETE_FUNC(DetachedBuffer(const DetachedBuffer& other));
FLATBUFFERS_DELETE_FUNC(
DetachedBuffer &operator=(const DetachedBuffer &other));
DetachedBuffer& operator=(const DetachedBuffer& other));
protected:
Allocator *allocator_;
Allocator* allocator_;
bool own_allocator_;
uint8_t *buf_;
uint8_t* buf_;
size_t reserved_;
uint8_t *cur_;
uint8_t* cur_;
size_t size_;
inline void destroy() {
if (buf_) Deallocate(allocator_, buf_, reserved_);
if (own_allocator_ && allocator_) { delete allocator_; }
if (own_allocator_ && allocator_) {
delete allocator_;
}
reset();
}
File diff suppressed because it is too large Load Diff
+41 -30
View File
@@ -41,14 +41,14 @@ namespace flatbuffers {
/// it is the opposite transformation of GetRoot().
/// This may be useful if you want to pass on a root and have the recipient
/// delete the buffer afterwards.
inline const uint8_t *GetBufferStartFromRootPointer(const void *root) {
auto table = reinterpret_cast<const Table *>(root);
inline const uint8_t* GetBufferStartFromRootPointer(const void* root) {
auto table = reinterpret_cast<const Table*>(root);
auto vtable = table->GetVTable();
// Either the vtable is before the root or after the root.
auto start = (std::min)(vtable, reinterpret_cast<const uint8_t *>(root));
auto start = (std::min)(vtable, reinterpret_cast<const uint8_t*>(root));
// Align to at least sizeof(uoffset_t).
start = reinterpret_cast<const uint8_t *>(reinterpret_cast<uintptr_t>(start) &
~(sizeof(uoffset_t) - 1));
start = reinterpret_cast<const uint8_t*>(reinterpret_cast<uintptr_t>(start) &
~(sizeof(uoffset_t) - 1));
// Additionally, there may be a file_identifier in the buffer, and the root
// offset. The buffer may have been aligned to any size between
// sizeof(uoffset_t) and FLATBUFFERS_MAX_ALIGNMENT (see "force_align").
@@ -64,7 +64,7 @@ inline const uint8_t *GetBufferStartFromRootPointer(const void *root) {
possible_roots; possible_roots--) {
start -= sizeof(uoffset_t);
if (ReadScalar<uoffset_t>(start) + start ==
reinterpret_cast<const uint8_t *>(root))
reinterpret_cast<const uint8_t*>(root))
return start;
}
// We didn't find the root, either the "root" passed isn't really a root,
@@ -76,11 +76,22 @@ inline const uint8_t *GetBufferStartFromRootPointer(const void *root) {
}
/// @brief This return the prefixed size of a FlatBuffer.
template<typename SizeT = uoffset_t>
inline SizeT GetPrefixedSize(const uint8_t *buf) {
template <typename SizeT = uoffset_t>
inline SizeT GetPrefixedSize(const uint8_t* buf) {
return ReadScalar<SizeT>(buf);
}
// Gets the total length of the buffer given a sized prefixed FlatBuffer.
//
// This includes the size of the prefix as well as the buffer:
//
// [size prefix][flatbuffer]
// |---------length--------|
template <typename SizeT = uoffset_t>
inline SizeT GetSizePrefixedBufferLength(const uint8_t* const buf) {
return ReadScalar<SizeT>(buf) + sizeof(SizeT);
}
// Base class for native objects (FlatBuffer data de-serialized into native
// C++ data structures).
// Contains no functionality, purely documentative.
@@ -95,9 +106,9 @@ struct NativeTable {};
/// if you wish. The resolver does the opposite lookup, for when the object
/// is being serialized again.
typedef uint64_t hash_value_t;
typedef std::function<void(void **pointer_adr, hash_value_t hash)>
typedef std::function<void(void** pointer_adr, hash_value_t hash)>
resolver_function_t;
typedef std::function<hash_value_t(void *pointer)> rehasher_function_t;
typedef std::function<hash_value_t(void* pointer)> rehasher_function_t;
// Helper function to test if a field is present, using any of the field
// enums in the generated code.
@@ -106,18 +117,18 @@ typedef std::function<hash_value_t(void *pointer)> rehasher_function_t;
// Note: this function will return false for fields equal to the default
// value, since they're not stored in the buffer (unless force_defaults was
// used).
template<typename T>
bool IsFieldPresent(const T *table, typename T::FlatBuffersVTableOffset field) {
template <typename T>
bool IsFieldPresent(const T* table, typename T::FlatBuffersVTableOffset field) {
// Cast, since Table is a private baseclass of any table types.
return reinterpret_cast<const Table *>(table)->CheckField(
return reinterpret_cast<const Table*>(table)->CheckField(
static_cast<voffset_t>(field));
}
// Utility function for reverse lookups on the EnumNames*() functions
// (in the generated C++ code)
// names must be NULL terminated.
inline int LookupEnum(const char **names, const char *name) {
for (const char **p = names; *p; p++)
inline int LookupEnum(const char** names, const char* name) {
for (const char** p = names; *p; p++)
if (!strcmp(*p, name)) return static_cast<int>(p - names);
return -1;
}
@@ -216,20 +227,20 @@ static_assert(sizeof(TypeCode) == 2, "TypeCode");
struct TypeTable;
// Signature of the static method present in each type.
typedef const TypeTable *(*TypeFunction)();
typedef const TypeTable* (*TypeFunction)();
struct TypeTable {
SequenceType st;
size_t num_elems; // of type_codes, values, names (but not type_refs).
const TypeCode *type_codes; // num_elems count
const TypeFunction *type_refs; // less than num_elems entries (see TypeCode).
const int16_t *array_sizes; // less than num_elems entries (see TypeCode).
const int64_t *values; // Only set for non-consecutive enum/union or structs.
const char *const *names; // Only set if compiled with --reflect-names.
const TypeCode* type_codes; // num_elems count
const TypeFunction* type_refs; // less than num_elems entries (see TypeCode).
const int16_t* array_sizes; // less than num_elems entries (see TypeCode).
const int64_t* values; // Only set for non-consecutive enum/union or structs.
const char* const* names; // Only set if compiled with --reflect-names.
};
// String which identifies the current version of FlatBuffers.
inline const char *flatbuffers_version_string() {
inline const char* flatbuffers_version_string() {
return "FlatBuffers " FLATBUFFERS_STRING(FLATBUFFERS_VERSION_MAJOR) "."
FLATBUFFERS_STRING(FLATBUFFERS_VERSION_MINOR) "."
FLATBUFFERS_STRING(FLATBUFFERS_VERSION_REVISION);
@@ -237,31 +248,31 @@ inline const char *flatbuffers_version_string() {
// clang-format off
#define FLATBUFFERS_DEFINE_BITMASK_OPERATORS(E, T)\
inline E operator | (E lhs, E rhs){\
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator | (E lhs, E rhs){\
return E(T(lhs) | T(rhs));\
}\
inline E operator & (E lhs, E rhs){\
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator & (E lhs, E rhs){\
return E(T(lhs) & T(rhs));\
}\
inline E operator ^ (E lhs, E rhs){\
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator ^ (E lhs, E rhs){\
return E(T(lhs) ^ T(rhs));\
}\
inline E operator ~ (E lhs){\
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator ~ (E lhs){\
return E(~T(lhs));\
}\
inline E operator |= (E &lhs, E rhs){\
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator |= (E &lhs, E rhs){\
lhs = lhs | rhs;\
return lhs;\
}\
inline E operator &= (E &lhs, E rhs){\
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator &= (E &lhs, E rhs){\
lhs = lhs & rhs;\
return lhs;\
}\
inline E operator ^= (E &lhs, E rhs){\
inline FLATBUFFERS_CONSTEXPR_CPP11 E operator ^= (E &lhs, E rhs){\
lhs = lhs ^ rhs;\
return lhs;\
}\
inline bool operator !(E rhs) \
inline FLATBUFFERS_CONSTEXPR_CPP11 bool operator !(E rhs) \
{\
return !bool(T(rhs)); \
}
+3 -2
View File
@@ -45,7 +45,8 @@
// Testing __cpp_lib_span requires including either <version> or <span>,
// both of which were added in C++20.
// See: https://en.cppreference.com/w/cpp/utility/feature_test
#if defined(__cplusplus) && __cplusplus >= 202002L
#if defined(__cplusplus) && __cplusplus >= 202002L \
|| (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
#define FLATBUFFERS_USE_STD_SPAN 1
#endif
#endif // FLATBUFFERS_USE_STD_SPAN
@@ -272,7 +273,7 @@ template<class T, class U>
FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(const Optional<T>& lhs, const Optional<U>& rhs) FLATBUFFERS_NOEXCEPT {
return static_cast<bool>(lhs) != static_cast<bool>(rhs)
? false
: !static_cast<bool>(lhs) ? false : (*lhs == *rhs);
: !static_cast<bool>(lhs) ? true : (*lhs == *rhs);
}
#endif // FLATBUFFERS_USE_STD_OPTIONAL
+10 -5
View File
@@ -23,7 +23,7 @@
namespace flatbuffers {
struct String : public Vector<char> {
const char *c_str() const { return reinterpret_cast<const char *>(Data()); }
const char* c_str() const { return reinterpret_cast<const char*>(Data()); }
std::string str() const { return std::string(c_str(), size()); }
// clang-format off
@@ -31,30 +31,35 @@ struct String : public Vector<char> {
flatbuffers::string_view string_view() const {
return flatbuffers::string_view(c_str(), size());
}
/* implicit */
operator flatbuffers::string_view() const {
return flatbuffers::string_view(c_str(), size());
}
#endif // FLATBUFFERS_HAS_STRING_VIEW
// clang-format on
bool operator<(const String &o) const {
bool operator<(const String& o) const {
return StringLessThan(this->data(), this->size(), o.data(), o.size());
}
};
// Convenience function to get std::string from a String returning an empty
// string on null pointer.
static inline std::string GetString(const String *str) {
static inline std::string GetString(const String* str) {
return str ? str->str() : "";
}
// Convenience function to get char* from a String returning an empty string on
// null pointer.
static inline const char *GetCstring(const String *str) {
static inline const char* GetCstring(const String* str) {
return str ? str->c_str() : "";
}
#ifdef FLATBUFFERS_HAS_STRING_VIEW
// Convenience function to get string_view from a String returning an empty
// string_view on null pointer.
static inline flatbuffers::string_view GetStringView(const String *str) {
static inline flatbuffers::string_view GetStringView(const String* str) {
return str ? str->string_view() : flatbuffers::string_view();
}
#endif // FLATBUFFERS_HAS_STRING_VIEW
+8 -6
View File
@@ -27,23 +27,25 @@ namespace flatbuffers {
class Struct FLATBUFFERS_FINAL_CLASS {
public:
template<typename T> T GetField(uoffset_t o) const {
template <typename T>
T GetField(uoffset_t o) const {
return ReadScalar<T>(&data_[o]);
}
template<typename T> T GetStruct(uoffset_t o) const {
template <typename T>
T GetStruct(uoffset_t o) const {
return reinterpret_cast<T>(&data_[o]);
}
const uint8_t *GetAddressOf(uoffset_t o) const { return &data_[o]; }
uint8_t *GetAddressOf(uoffset_t o) { return &data_[o]; }
const uint8_t* GetAddressOf(uoffset_t o) const { return &data_[o]; }
uint8_t* GetAddressOf(uoffset_t o) { return &data_[o]; }
private:
// private constructor & copy constructor: you obtain instances of this
// class by pointing to existing data only
Struct();
Struct(const Struct &);
Struct &operator=(const Struct &);
Struct(const Struct&);
Struct& operator=(const Struct&);
uint8_t data_[1];
};
+37 -31
View File
@@ -26,7 +26,7 @@ namespace flatbuffers {
// omitted and added at will, but uses an extra indirection to read.
class Table {
public:
const uint8_t *GetVTable() const {
const uint8_t* GetVTable() const {
return data_ - ReadScalar<soffset_t>(data_);
}
@@ -42,38 +42,42 @@ class Table {
return field < vtsize ? ReadScalar<voffset_t>(vtable + field) : 0;
}
template<typename T> T GetField(voffset_t field, T defaultval) const {
template <typename T>
T GetField(voffset_t field, T defaultval) const {
auto field_offset = GetOptionalFieldOffset(field);
return field_offset ? ReadScalar<T>(data_ + field_offset) : defaultval;
}
template<typename P, typename OffsetSize = uoffset_t>
template <typename P, typename OffsetSize = uoffset_t>
P GetPointer(voffset_t field) {
auto field_offset = GetOptionalFieldOffset(field);
auto p = data_ + field_offset;
return field_offset ? reinterpret_cast<P>(p + ReadScalar<OffsetSize>(p))
: nullptr;
}
template<typename P, typename OffsetSize = uoffset_t>
template <typename P, typename OffsetSize = uoffset_t>
P GetPointer(voffset_t field) const {
return const_cast<Table *>(this)->GetPointer<P, OffsetSize>(field);
return const_cast<Table*>(this)->GetPointer<P, OffsetSize>(field);
}
template<typename P> P GetPointer64(voffset_t field) {
template <typename P>
P GetPointer64(voffset_t field) {
return GetPointer<P, uoffset64_t>(field);
}
template<typename P> P GetPointer64(voffset_t field) const {
template <typename P>
P GetPointer64(voffset_t field) const {
return GetPointer<P, uoffset64_t>(field);
}
template<typename P> P GetStruct(voffset_t field) const {
template <typename P>
P GetStruct(voffset_t field) const {
auto field_offset = GetOptionalFieldOffset(field);
auto p = const_cast<uint8_t *>(data_ + field_offset);
auto p = const_cast<uint8_t*>(data_ + field_offset);
return field_offset ? reinterpret_cast<P>(p) : nullptr;
}
template<typename Raw, typename Face>
template <typename Raw, typename Face>
flatbuffers::Optional<Face> GetOptional(voffset_t field) const {
auto field_offset = GetOptionalFieldOffset(field);
auto p = data_ + field_offset;
@@ -81,20 +85,22 @@ class Table {
: Optional<Face>();
}
template<typename T> bool SetField(voffset_t field, T val, T def) {
template <typename T>
bool SetField(voffset_t field, T val, T def) {
auto field_offset = GetOptionalFieldOffset(field);
if (!field_offset) return IsTheSameAs(val, def);
WriteScalar(data_ + field_offset, val);
return true;
}
template<typename T> bool SetField(voffset_t field, T val) {
template <typename T>
bool SetField(voffset_t field, T val) {
auto field_offset = GetOptionalFieldOffset(field);
if (!field_offset) return false;
WriteScalar(data_ + field_offset, val);
return true;
}
bool SetPointer(voffset_t field, const uint8_t *val) {
bool SetPointer(voffset_t field, const uint8_t* val) {
auto field_offset = GetOptionalFieldOffset(field);
if (!field_offset) return false;
WriteScalar(data_ + field_offset,
@@ -102,12 +108,12 @@ class Table {
return true;
}
uint8_t *GetAddressOf(voffset_t field) {
uint8_t* GetAddressOf(voffset_t field) {
auto field_offset = GetOptionalFieldOffset(field);
return field_offset ? data_ + field_offset : nullptr;
}
const uint8_t *GetAddressOf(voffset_t field) const {
return const_cast<Table *>(this)->GetAddressOf(field);
const uint8_t* GetAddressOf(voffset_t field) const {
return const_cast<Table*>(this)->GetAddressOf(field);
}
bool CheckField(voffset_t field) const {
@@ -116,13 +122,13 @@ class Table {
// Verify the vtable of this table.
// Call this once per table, followed by VerifyField once per field.
bool VerifyTableStart(Verifier &verifier) const {
bool VerifyTableStart(Verifier& verifier) const {
return verifier.VerifyTableStart(data_);
}
// Verify a particular field.
template<typename T>
bool VerifyField(const Verifier &verifier, voffset_t field,
template <typename T>
bool VerifyField(const Verifier& verifier, voffset_t field,
size_t align) const {
// Calling GetOptionalFieldOffset should be safe now thanks to
// VerifyTable().
@@ -132,8 +138,8 @@ class Table {
}
// VerifyField for required fields.
template<typename T>
bool VerifyFieldRequired(const Verifier &verifier, voffset_t field,
template <typename T>
bool VerifyFieldRequired(const Verifier& verifier, voffset_t field,
size_t align) const {
auto field_offset = GetOptionalFieldOffset(field);
return verifier.Check(field_offset != 0) &&
@@ -141,24 +147,24 @@ class Table {
}
// Versions for offsets.
template<typename OffsetT = uoffset_t>
bool VerifyOffset(const Verifier &verifier, voffset_t field) const {
template <typename OffsetT = uoffset_t>
bool VerifyOffset(const Verifier& verifier, voffset_t field) const {
auto field_offset = GetOptionalFieldOffset(field);
return !field_offset || verifier.VerifyOffset<OffsetT>(data_, field_offset);
}
template<typename OffsetT = uoffset_t>
bool VerifyOffsetRequired(const Verifier &verifier, voffset_t field) const {
template <typename OffsetT = uoffset_t>
bool VerifyOffsetRequired(const Verifier& verifier, voffset_t field) const {
auto field_offset = GetOptionalFieldOffset(field);
return verifier.Check(field_offset != 0) &&
verifier.VerifyOffset<OffsetT>(data_, field_offset);
}
bool VerifyOffset64(const Verifier &verifier, voffset_t field) const {
bool VerifyOffset64(const Verifier& verifier, voffset_t field) const {
return VerifyOffset<uoffset64_t>(verifier, field);
}
bool VerifyOffset64Required(const Verifier &verifier, voffset_t field) const {
bool VerifyOffset64Required(const Verifier& verifier, voffset_t field) const {
return VerifyOffsetRequired<uoffset64_t>(verifier, field);
}
@@ -166,15 +172,15 @@ class Table {
// private constructor & copy constructor: you obtain instances of this
// class by pointing to existing data only
Table();
Table(const Table &other);
Table &operator=(const Table &);
Table(const Table& other);
Table& operator=(const Table&);
uint8_t data_[1];
};
// This specialization allows avoiding warnings like:
// MSVC C4800: type: forcing value to bool 'true' or 'false'.
template<>
template <>
inline flatbuffers::Optional<bool> Table::GetOptional<uint8_t, bool>(
voffset_t field) const {
auto field_offset = GetOptionalFieldOffset(field);
+101 -79
View File
@@ -27,44 +27,56 @@ struct String;
// An STL compatible iterator implementation for Vector below, effectively
// calling Get() for every element.
template<typename T, typename IT, typename Data = uint8_t *,
typename SizeT = uoffset_t>
template <typename T, typename IT, typename Data = uint8_t*,
typename SizeT = uoffset_t>
struct VectorIterator {
typedef std::random_access_iterator_tag iterator_category;
typedef IT value_type;
typedef ptrdiff_t difference_type;
typedef IT *pointer;
typedef IT &reference;
typedef IT* pointer;
typedef IT& reference;
static const SizeT element_stride = IndirectHelper<T>::element_stride;
VectorIterator(Data data, SizeT i) : data_(data + element_stride * i) {}
VectorIterator(const VectorIterator &other) : data_(other.data_) {}
VectorIterator(const VectorIterator& other) : data_(other.data_) {}
VectorIterator() : data_(nullptr) {}
VectorIterator &operator=(const VectorIterator &other) {
VectorIterator& operator=(const VectorIterator& other) {
data_ = other.data_;
return *this;
}
VectorIterator &operator=(VectorIterator &&other) {
VectorIterator& operator=(VectorIterator&& other) {
data_ = other.data_;
return *this;
}
bool operator==(const VectorIterator &other) const {
bool operator==(const VectorIterator& other) const {
return data_ == other.data_;
}
bool operator<(const VectorIterator &other) const {
return data_ < other.data_;
}
bool operator!=(const VectorIterator &other) const {
bool operator!=(const VectorIterator& other) const {
return data_ != other.data_;
}
difference_type operator-(const VectorIterator &other) const {
bool operator<(const VectorIterator& other) const {
return data_ < other.data_;
}
bool operator>(const VectorIterator& other) const {
return data_ > other.data_;
}
bool operator<=(const VectorIterator& other) const {
return !(data_ > other.data_);
}
bool operator>=(const VectorIterator& other) const {
return !(data_ < other.data_);
}
difference_type operator-(const VectorIterator& other) const {
return (data_ - other.data_) / element_stride;
}
@@ -76,7 +88,7 @@ struct VectorIterator {
// `pointer operator->()`.
IT operator->() const { return IndirectHelper<T>::Read(data_, 0); }
VectorIterator &operator++() {
VectorIterator& operator++() {
data_ += element_stride;
return *this;
}
@@ -87,16 +99,16 @@ struct VectorIterator {
return temp;
}
VectorIterator operator+(const SizeT &offset) const {
VectorIterator operator+(const SizeT& offset) const {
return VectorIterator(data_ + offset * element_stride, 0);
}
VectorIterator &operator+=(const SizeT &offset) {
VectorIterator& operator+=(const SizeT& offset) {
data_ += offset * element_stride;
return *this;
}
VectorIterator &operator--() {
VectorIterator& operator--() {
data_ -= element_stride;
return *this;
}
@@ -107,11 +119,11 @@ struct VectorIterator {
return temp;
}
VectorIterator operator-(const SizeT &offset) const {
VectorIterator operator-(const SizeT& offset) const {
return VectorIterator(data_ - offset * element_stride, 0);
}
VectorIterator &operator-=(const SizeT &offset) {
VectorIterator& operator-=(const SizeT& offset) {
data_ -= offset * element_stride;
return *this;
}
@@ -120,10 +132,10 @@ struct VectorIterator {
Data data_;
};
template<typename T, typename IT, typename SizeT = uoffset_t>
using VectorConstIterator = VectorIterator<T, IT, const uint8_t *, SizeT>;
template <typename T, typename IT, typename SizeT = uoffset_t>
using VectorConstIterator = VectorIterator<T, IT, const uint8_t*, SizeT>;
template<typename Iterator>
template <typename Iterator>
struct VectorReverseIterator : public std::reverse_iterator<Iterator> {
explicit VectorReverseIterator(Iterator iter)
: std::reverse_iterator<Iterator>(iter) {}
@@ -145,14 +157,13 @@ struct VectorReverseIterator : public std::reverse_iterator<Iterator> {
// This is used as a helper type for accessing vectors.
// Vector::data() assumes the vector elements start after the length field.
template<typename T, typename SizeT = uoffset_t> class Vector {
template <typename T, typename SizeT = uoffset_t>
class Vector {
public:
typedef VectorIterator<T,
typename IndirectHelper<T>::mutable_return_type,
uint8_t *, SizeT>
typedef VectorIterator<T, typename IndirectHelper<T>::mutable_return_type,
uint8_t*, SizeT>
iterator;
typedef VectorConstIterator<T, typename IndirectHelper<T>::return_type,
SizeT>
typedef VectorConstIterator<T, typename IndirectHelper<T>::return_type, SizeT>
const_iterator;
typedef VectorReverseIterator<iterator> reverse_iterator;
typedef VectorReverseIterator<const_iterator> const_reverse_iterator;
@@ -165,14 +176,18 @@ template<typename T, typename SizeT = uoffset_t> class Vector {
SizeT size() const { return EndianScalar(length_); }
// Returns true if the vector is empty.
//
// This just provides another standardized method that is expected of vectors.
bool empty() const { return size() == 0; }
// Deprecated: use size(). Here for backwards compatibility.
FLATBUFFERS_ATTRIBUTE([[deprecated("use size() instead")]])
SizeT Length() const { return size(); }
typedef SizeT size_type;
typedef typename IndirectHelper<T>::return_type return_type;
typedef typename IndirectHelper<T>::mutable_return_type
mutable_return_type;
typedef typename IndirectHelper<T>::mutable_return_type mutable_return_type;
typedef return_type value_type;
return_type Get(SizeT i) const {
@@ -185,24 +200,26 @@ template<typename T, typename SizeT = uoffset_t> class Vector {
// If this is a Vector of enums, T will be its storage type, not the enum
// type. This function makes it convenient to retrieve value with enum
// type E.
template<typename E> E GetEnum(SizeT i) const {
template <typename E>
E GetEnum(SizeT i) const {
return static_cast<E>(Get(i));
}
// If this a vector of unions, this does the cast for you. There's no check
// to make sure this is the right type!
template<typename U> const U *GetAs(SizeT i) const {
return reinterpret_cast<const U *>(Get(i));
template <typename U>
const U* GetAs(SizeT i) const {
return reinterpret_cast<const U*>(Get(i));
}
// If this a vector of unions, this does the cast for you. There's no check
// to make sure this is actually a string!
const String *GetAsString(SizeT i) const {
return reinterpret_cast<const String *>(Get(i));
const String* GetAsString(SizeT i) const {
return reinterpret_cast<const String*>(Get(i));
}
const void *GetStructFromOffset(size_t o) const {
return reinterpret_cast<const void *>(Data() + o);
const void* GetStructFromOffset(size_t o) const {
return reinterpret_cast<const void*>(Data() + o);
}
iterator begin() { return iterator(Data(), 0); }
@@ -231,7 +248,7 @@ template<typename T, typename SizeT = uoffset_t> class Vector {
// Change elements if you have a non-const pointer to this object.
// Scalars only. See reflection.h, and the documentation.
void Mutate(SizeT i, const T &val) {
void Mutate(SizeT i, const T& val) {
FLATBUFFERS_ASSERT(i < size());
WriteScalar(data() + i, val);
}
@@ -239,7 +256,7 @@ template<typename T, typename SizeT = uoffset_t> class Vector {
// Change an element of a vector of tables (or strings).
// "val" points to the new table/string, as you can obtain from
// e.g. reflection::AddFlatBuffer().
void MutateOffset(SizeT i, const uint8_t *val) {
void MutateOffset(SizeT i, const uint8_t* val) {
FLATBUFFERS_ASSERT(i < size());
static_assert(sizeof(T) == sizeof(SizeT), "Unrelated types");
WriteScalar(data() + i,
@@ -253,30 +270,32 @@ template<typename T, typename SizeT = uoffset_t> class Vector {
}
// The raw data in little endian format. Use with care.
const uint8_t *Data() const {
return reinterpret_cast<const uint8_t *>(&length_ + 1);
const uint8_t* Data() const {
return reinterpret_cast<const uint8_t*>(&length_ + 1);
}
uint8_t *Data() { return reinterpret_cast<uint8_t *>(&length_ + 1); }
uint8_t* Data() { return reinterpret_cast<uint8_t*>(&length_ + 1); }
// Similarly, but typed, much like std::vector::data
const T *data() const { return reinterpret_cast<const T *>(Data()); }
T *data() { return reinterpret_cast<T *>(Data()); }
const T* data() const { return reinterpret_cast<const T*>(Data()); }
T* data() { return reinterpret_cast<T*>(Data()); }
template<typename K> return_type LookupByKey(K key) const {
void *search_result = std::bsearch(
template <typename K>
return_type LookupByKey(K key) const {
void* search_result = std::bsearch(
&key, Data(), size(), IndirectHelper<T>::element_stride, KeyCompare<K>);
if (!search_result) {
return nullptr; // Key not found.
}
const uint8_t *element = reinterpret_cast<const uint8_t *>(search_result);
const uint8_t* element = reinterpret_cast<const uint8_t*>(search_result);
return IndirectHelper<T>::Read(element, 0);
}
template<typename K> mutable_return_type MutableLookupByKey(K key) {
template <typename K>
mutable_return_type MutableLookupByKey(K key) {
return const_cast<mutable_return_type>(LookupByKey(key));
}
@@ -290,12 +309,13 @@ template<typename T, typename SizeT = uoffset_t> class Vector {
private:
// This class is a pointer. Copying will therefore create an invalid object.
// Private and unimplemented copy constructor.
Vector(const Vector &);
Vector &operator=(const Vector &);
Vector(const Vector&);
Vector& operator=(const Vector&);
template<typename K> static int KeyCompare(const void *ap, const void *bp) {
const K *key = reinterpret_cast<const K *>(ap);
const uint8_t *data = reinterpret_cast<const uint8_t *>(bp);
template <typename K>
static int KeyCompare(const void* ap, const void* bp) {
const K* key = reinterpret_cast<const K*>(ap);
const uint8_t* data = reinterpret_cast<const uint8_t*>(bp);
auto table = IndirectHelper<T>::Read(data, 0);
// std::bsearch compares with the operands transposed, so we negate the
@@ -304,35 +324,36 @@ template<typename T, typename SizeT = uoffset_t> class Vector {
}
};
template<typename T> using Vector64 = Vector<T, uoffset64_t>;
template <typename T>
using Vector64 = Vector<T, uoffset64_t>;
template<class U>
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<U> make_span(Vector<U> &vec)
template <class U>
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<U> make_span(Vector<U>& vec)
FLATBUFFERS_NOEXCEPT {
static_assert(Vector<U>::is_span_observable,
"wrong type U, only LE-scalar, or byte types are allowed");
return span<U>(vec.data(), vec.size());
}
template<class U>
template <class U>
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<const U> make_span(
const Vector<U> &vec) FLATBUFFERS_NOEXCEPT {
const Vector<U>& vec) FLATBUFFERS_NOEXCEPT {
static_assert(Vector<U>::is_span_observable,
"wrong type U, only LE-scalar, or byte types are allowed");
return span<const U>(vec.data(), vec.size());
}
template<class U>
template <class U>
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<uint8_t> make_bytes_span(
Vector<U> &vec) FLATBUFFERS_NOEXCEPT {
Vector<U>& vec) FLATBUFFERS_NOEXCEPT {
static_assert(Vector<U>::scalar_tag::value,
"wrong type U, only LE-scalar, or byte types are allowed");
return span<uint8_t>(vec.Data(), vec.size() * sizeof(U));
}
template<class U>
template <class U>
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<const uint8_t> make_bytes_span(
const Vector<U> &vec) FLATBUFFERS_NOEXCEPT {
const Vector<U>& vec) FLATBUFFERS_NOEXCEPT {
static_assert(Vector<U>::scalar_tag::value,
"wrong type U, only LE-scalar, or byte types are allowed");
return span<const uint8_t>(vec.Data(), vec.size() * sizeof(U));
@@ -340,17 +361,17 @@ FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<const uint8_t> make_bytes_span(
// Convenient helper functions to get a span of any vector, regardless
// of whether it is null or not (the field is not set).
template<class U>
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<U> make_span(Vector<U> *ptr)
template <class U>
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<U> make_span(Vector<U>* ptr)
FLATBUFFERS_NOEXCEPT {
static_assert(Vector<U>::is_span_observable,
"wrong type U, only LE-scalar, or byte types are allowed");
return ptr ? make_span(*ptr) : span<U>();
}
template<class U>
template <class U>
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<const U> make_span(
const Vector<U> *ptr) FLATBUFFERS_NOEXCEPT {
const Vector<U>* ptr) FLATBUFFERS_NOEXCEPT {
static_assert(Vector<U>::is_span_observable,
"wrong type U, only LE-scalar, or byte types are allowed");
return ptr ? make_span(*ptr) : span<const U>();
@@ -362,10 +383,10 @@ class VectorOfAny {
public:
uoffset_t size() const { return EndianScalar(length_); }
const uint8_t *Data() const {
return reinterpret_cast<const uint8_t *>(&length_ + 1);
const uint8_t* Data() const {
return reinterpret_cast<const uint8_t*>(&length_ + 1);
}
uint8_t *Data() { return reinterpret_cast<uint8_t *>(&length_ + 1); }
uint8_t* Data() { return reinterpret_cast<uint8_t*>(&length_ + 1); }
protected:
VectorOfAny();
@@ -373,25 +394,26 @@ class VectorOfAny {
uoffset_t length_;
private:
VectorOfAny(const VectorOfAny &);
VectorOfAny &operator=(const VectorOfAny &);
VectorOfAny(const VectorOfAny&);
VectorOfAny& operator=(const VectorOfAny&);
};
template<typename T, typename U>
Vector<Offset<T>> *VectorCast(Vector<Offset<U>> *ptr) {
template <typename T, typename U>
Vector<Offset<T>>* VectorCast(Vector<Offset<U>>* ptr) {
static_assert(std::is_base_of<T, U>::value, "Unrelated types");
return reinterpret_cast<Vector<Offset<T>> *>(ptr);
return reinterpret_cast<Vector<Offset<T>>*>(ptr);
}
template<typename T, typename U>
const Vector<Offset<T>> *VectorCast(const Vector<Offset<U>> *ptr) {
template <typename T, typename U>
const Vector<Offset<T>>* VectorCast(const Vector<Offset<U>>* ptr) {
static_assert(std::is_base_of<T, U>::value, "Unrelated types");
return reinterpret_cast<const Vector<Offset<T>> *>(ptr);
return reinterpret_cast<const Vector<Offset<T>>*>(ptr);
}
// Convenient helper function to get the length of any vector, regardless
// of whether it is null or not (the field is not set).
template<typename T> static inline size_t VectorLength(const Vector<T> *v) {
template <typename T>
static inline size_t VectorLength(const Vector<T>* v) {
return v ? v->size() : 0;
}
+41 -31
View File
@@ -17,9 +17,8 @@
#ifndef FLATBUFFERS_VECTOR_DOWNWARD_H_
#define FLATBUFFERS_VECTOR_DOWNWARD_H_
#include <cstdint>
#include <algorithm>
#include <cstdint>
#include "flatbuffers/base.h"
#include "flatbuffers/default_allocator.h"
@@ -33,9 +32,10 @@ namespace flatbuffers {
// Since this vector leaves the lower part unused, we support a "scratch-pad"
// that can be stored there for temporary data, to share the allocated space.
// Essentially, this supports 2 std::vectors in a single buffer.
template<typename SizeT = uoffset_t> class vector_downward {
template <typename SizeT = uoffset_t>
class vector_downward {
public:
explicit vector_downward(size_t initial_size, Allocator *allocator,
explicit vector_downward(size_t initial_size, Allocator* allocator,
bool own_allocator, size_t buffer_minalign,
const SizeT max_size = FLATBUFFERS_MAX_BUFFER_SIZE)
: allocator_(allocator),
@@ -49,7 +49,7 @@ template<typename SizeT = uoffset_t> class vector_downward {
cur_(nullptr),
scratch_(nullptr) {}
vector_downward(vector_downward &&other) noexcept
vector_downward(vector_downward&& other) noexcept
// clang-format on
: allocator_(other.allocator_),
own_allocator_(other.own_allocator_),
@@ -71,7 +71,7 @@ template<typename SizeT = uoffset_t> class vector_downward {
other.scratch_ = nullptr;
}
vector_downward &operator=(vector_downward &&other) noexcept {
vector_downward& operator=(vector_downward&& other) noexcept {
// Move construct a temporary and swap idiom
vector_downward temp(std::move(other));
swap(temp);
@@ -102,7 +102,9 @@ template<typename SizeT = uoffset_t> class vector_downward {
void clear_scratch() { scratch_ = buf_; }
void clear_allocator() {
if (own_allocator_ && allocator_) { delete allocator_; }
if (own_allocator_ && allocator_) {
delete allocator_;
}
allocator_ = nullptr;
own_allocator_ = false;
}
@@ -113,8 +115,8 @@ template<typename SizeT = uoffset_t> class vector_downward {
}
// Relinquish the pointer to the caller.
uint8_t *release_raw(size_t &allocated_bytes, size_t &offset) {
auto *buf = buf_;
uint8_t* release_raw(size_t& allocated_bytes, size_t& offset) {
auto* buf = buf_;
allocated_bytes = reserved_;
offset = vector_downward::offset();
@@ -143,12 +145,14 @@ template<typename SizeT = uoffset_t> class vector_downward {
FLATBUFFERS_ASSERT(cur_ >= scratch_ && scratch_ >= buf_);
// If the length is larger than the unused part of the buffer, we need to
// grow.
if (len > unused_buffer_size()) { reallocate(len); }
if (len > unused_buffer_size()) {
reallocate(len);
}
FLATBUFFERS_ASSERT(size() < max_size_);
return len;
}
inline uint8_t *make_space(size_t len) {
inline uint8_t* make_space(size_t len) {
if (len) {
ensure_space(len);
cur_ -= len;
@@ -158,7 +162,7 @@ template<typename SizeT = uoffset_t> class vector_downward {
}
// Returns nullptr if using the DefaultAllocator.
Allocator *get_custom_allocator() { return allocator_; }
Allocator* get_custom_allocator() { return allocator_; }
// The current offset into the buffer.
size_t offset() const { return cur_ - buf_; }
@@ -167,43 +171,49 @@ template<typename SizeT = uoffset_t> class vector_downward {
inline SizeT size() const { return size_; }
// The size of the buffer part of the vector that is currently unused.
SizeT unused_buffer_size() const { return static_cast<SizeT>(cur_ - scratch_); }
SizeT unused_buffer_size() const {
return static_cast<SizeT>(cur_ - scratch_);
}
// The size of the scratch part of the vector.
SizeT scratch_size() const { return static_cast<SizeT>(scratch_ - buf_); }
size_t capacity() const { return reserved_; }
uint8_t *data() const {
uint8_t* data() const {
FLATBUFFERS_ASSERT(cur_);
return cur_;
}
uint8_t *scratch_data() const {
uint8_t* scratch_data() const {
FLATBUFFERS_ASSERT(buf_);
return buf_;
}
uint8_t *scratch_end() const {
uint8_t* scratch_end() const {
FLATBUFFERS_ASSERT(scratch_);
return scratch_;
}
uint8_t *data_at(size_t offset) const { return buf_ + reserved_ - offset; }
uint8_t* data_at(size_t offset) const { return buf_ + reserved_ - offset; }
void push(const uint8_t *bytes, size_t num) {
if (num > 0) { memcpy(make_space(num), bytes, num); }
void push(const uint8_t* bytes, size_t num) {
if (num > 0) {
memcpy(make_space(num), bytes, num);
}
}
// Specialized version of push() that avoids memcpy call for small data.
template<typename T> void push_small(const T &little_endian_t) {
template <typename T>
void push_small(const T& little_endian_t) {
make_space(sizeof(T));
*reinterpret_cast<T *>(cur_) = little_endian_t;
*reinterpret_cast<T*>(cur_) = little_endian_t;
}
template<typename T> void scratch_push_small(const T &t) {
template <typename T>
void scratch_push_small(const T& t) {
ensure_space(sizeof(T));
*reinterpret_cast<T *>(scratch_) = t;
*reinterpret_cast<T*>(scratch_) = t;
scratch_ += sizeof(T);
}
@@ -227,7 +237,7 @@ template<typename SizeT = uoffset_t> class vector_downward {
void scratch_pop(size_t bytes_to_remove) { scratch_ -= bytes_to_remove; }
void swap(vector_downward &other) {
void swap(vector_downward& other) {
using std::swap;
swap(allocator_, other.allocator_);
swap(own_allocator_, other.own_allocator_);
@@ -241,7 +251,7 @@ template<typename SizeT = uoffset_t> class vector_downward {
swap(scratch_, other.scratch_);
}
void swap_allocator(vector_downward &other) {
void swap_allocator(vector_downward& other) {
using std::swap;
swap(allocator_, other.allocator_);
swap(own_allocator_, other.own_allocator_);
@@ -249,10 +259,10 @@ template<typename SizeT = uoffset_t> class vector_downward {
private:
// You shouldn't really be copying instances of this class.
FLATBUFFERS_DELETE_FUNC(vector_downward(const vector_downward &));
FLATBUFFERS_DELETE_FUNC(vector_downward &operator=(const vector_downward &));
FLATBUFFERS_DELETE_FUNC(vector_downward(const vector_downward&));
FLATBUFFERS_DELETE_FUNC(vector_downward& operator=(const vector_downward&));
Allocator *allocator_;
Allocator* allocator_;
bool own_allocator_;
size_t initial_size_;
@@ -261,9 +271,9 @@ template<typename SizeT = uoffset_t> class vector_downward {
size_t buffer_minalign_;
size_t reserved_;
SizeT size_;
uint8_t *buf_;
uint8_t *cur_; // Points at location between empty (below) and used (above).
uint8_t *scratch_; // Points to the end of the scratchpad in use.
uint8_t* buf_;
uint8_t* cur_; // Points at location between empty (below) and used (above).
uint8_t* scratch_; // Points to the end of the scratchpad in use.
void reallocate(size_t len) {
auto old_reserved = reserved_;
+120 -80
View File
@@ -23,7 +23,8 @@
namespace flatbuffers {
// Helper class to verify the integrity of a FlatBuffer
class Verifier FLATBUFFERS_FINAL_CLASS {
template <bool TrackVerifierBufferSize>
class VerifierTemplate FLATBUFFERS_FINAL_CLASS {
public:
struct Options {
// The maximum nesting of tables and vectors before we call it invalid.
@@ -40,17 +41,18 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
bool assert = false;
};
explicit Verifier(const uint8_t *const buf, const size_t buf_len,
const Options &opts)
explicit VerifierTemplate(const uint8_t* const buf, const size_t buf_len,
const Options& opts)
: buf_(buf), size_(buf_len), opts_(opts) {
FLATBUFFERS_ASSERT(size_ < opts.max_size);
}
// Deprecated API, please construct with Verifier::Options.
Verifier(const uint8_t *const buf, const size_t buf_len,
const uoffset_t max_depth = 64, const uoffset_t max_tables = 1000000,
const bool check_alignment = true)
: Verifier(buf, buf_len, [&] {
// Deprecated API, please construct with VerifierTemplate::Options.
VerifierTemplate(const uint8_t* const buf, const size_t buf_len,
const uoffset_t max_depth = 64,
const uoffset_t max_tables = 1000000,
const bool check_alignment = true)
: VerifierTemplate(buf, buf_len, [&] {
Options opts;
opts.max_depth = max_depth;
opts.max_tables = max_tables;
@@ -62,25 +64,25 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
bool Check(const bool ok) const {
// clang-format off
#ifdef FLATBUFFERS_DEBUG_VERIFICATION_FAILURE
if (opts_.assert) { FLATBUFFERS_ASSERT(ok); }
#endif
#ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE
if (!ok)
upper_bound_ = 0;
if (opts_.assert) { FLATBUFFERS_ASSERT(ok); }
#endif
// clang-format on
if (TrackVerifierBufferSize) {
if (!ok) {
upper_bound_ = 0;
}
}
return ok;
}
// Verify any range within the buffer.
bool Verify(const size_t elem, const size_t elem_len) const {
// clang-format off
#ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE
if (TrackVerifierBufferSize) {
auto upper_bound = elem + elem_len;
if (upper_bound_ < upper_bound)
upper_bound_ = upper_bound;
#endif
// clang-format on
if (upper_bound_ < upper_bound) {
upper_bound_ = upper_bound;
}
}
return Check(elem_len < size_ && elem <= size_ - elem_len);
}
@@ -89,59 +91,61 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
}
// Verify a range indicated by sizeof(T).
template<typename T> bool Verify(const size_t elem) const {
template <typename T>
bool Verify(const size_t elem) const {
return VerifyAlignment(elem, sizeof(T)) && Verify(elem, sizeof(T));
}
bool VerifyFromPointer(const uint8_t *const p, const size_t len) {
bool VerifyFromPointer(const uint8_t* const p, const size_t len) {
return Verify(static_cast<size_t>(p - buf_), len);
}
// Verify relative to a known-good base pointer.
bool VerifyFieldStruct(const uint8_t *const base, const voffset_t elem_off,
bool VerifyFieldStruct(const uint8_t* const base, const voffset_t elem_off,
const size_t elem_len, const size_t align) const {
const auto f = static_cast<size_t>(base - buf_) + elem_off;
return VerifyAlignment(f, align) && Verify(f, elem_len);
}
template<typename T>
bool VerifyField(const uint8_t *const base, const voffset_t elem_off,
template <typename T>
bool VerifyField(const uint8_t* const base, const voffset_t elem_off,
const size_t align) const {
const auto f = static_cast<size_t>(base - buf_) + elem_off;
return VerifyAlignment(f, align) && Verify(f, sizeof(T));
}
// Verify a pointer (may be NULL) of a table type.
template<typename T> bool VerifyTable(const T *const table) {
template <typename T>
bool VerifyTable(const T* const table) {
return !table || table->Verify(*this);
}
// Verify a pointer (may be NULL) of any vector type.
template<int &..., typename T, typename LenT>
bool VerifyVector(const Vector<T, LenT> *const vec) const {
template <int&..., typename T, typename LenT>
bool VerifyVector(const Vector<T, LenT>* const vec) const {
return !vec || VerifyVectorOrString<LenT>(
reinterpret_cast<const uint8_t *>(vec), sizeof(T));
reinterpret_cast<const uint8_t*>(vec), sizeof(T));
}
// Verify a pointer (may be NULL) of a vector to struct.
template<int &..., typename T, typename LenT>
bool VerifyVector(const Vector<const T *, LenT> *const vec) const {
return VerifyVector(reinterpret_cast<const Vector<T, LenT> *>(vec));
template <int&..., typename T, typename LenT>
bool VerifyVector(const Vector<const T*, LenT>* const vec) const {
return VerifyVector(reinterpret_cast<const Vector<T, LenT>*>(vec));
}
// Verify a pointer (may be NULL) to string.
bool VerifyString(const String *const str) const {
bool VerifyString(const String* const str) const {
size_t end;
return !str || (VerifyVectorOrString<uoffset_t>(
reinterpret_cast<const uint8_t *>(str), 1, &end) &&
reinterpret_cast<const uint8_t*>(str), 1, &end) &&
Verify(end, 1) && // Must have terminator
Check(buf_[end] == '\0')); // Terminating byte must be 0.
}
// Common code between vectors and strings.
template<typename LenT = uoffset_t>
bool VerifyVectorOrString(const uint8_t *const vec, const size_t elem_size,
size_t *const end = nullptr) const {
template <typename LenT = uoffset_t>
bool VerifyVectorOrString(const uint8_t* const vec, const size_t elem_size,
size_t* const end = nullptr) const {
const auto vec_offset = static_cast<size_t>(vec - buf_);
// Check we can read the size field.
if (!Verify<LenT>(vec_offset)) return false;
@@ -157,7 +161,7 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
}
// Special case for string contents, after the above has been called.
bool VerifyVectorOfStrings(const Vector<Offset<String>> *const vec) const {
bool VerifyVectorOfStrings(const Vector<Offset<String>>* const vec) const {
if (vec) {
for (uoffset_t i = 0; i < vec->size(); i++) {
if (!VerifyString(vec->Get(i))) return false;
@@ -167,8 +171,8 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
}
// Special case for table contents, after the above has been called.
template<typename T>
bool VerifyVectorOfTables(const Vector<Offset<T>> *const vec) {
template <typename T>
bool VerifyVectorOfTables(const Vector<Offset<T>>* const vec) {
if (vec) {
for (uoffset_t i = 0; i < vec->size(); i++) {
if (!vec->Get(i)->Verify(*this)) return false;
@@ -177,8 +181,8 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
return true;
}
__suppress_ubsan__("unsigned-integer-overflow") bool VerifyTableStart(
const uint8_t *const table) {
FLATBUFFERS_SUPPRESS_UBSAN("unsigned-integer-overflow")
bool VerifyTableStart(const uint8_t* const table) {
// Check the vtable offset.
const auto tableo = static_cast<size_t>(table - buf_);
if (!Verify<soffset_t>(tableo)) return false;
@@ -195,8 +199,8 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
return Check((vsize & 1) == 0) && Verify(vtableo, vsize);
}
template<typename T>
bool VerifyBufferFromStart(const char *const identifier, const size_t start) {
template <typename T>
bool VerifyBufferFromStart(const char* const identifier, const size_t start) {
// Buffers have to be of some size to be valid. The reason it is a runtime
// check instead of static_assert, is that nested flatbuffers go through
// this call and their size is determined at runtime.
@@ -210,19 +214,19 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
// Call T::Verify, which must be in the generated code for this type.
const auto o = VerifyOffset<uoffset_t>(start);
return Check(o != 0) &&
reinterpret_cast<const T *>(buf_ + start + o)->Verify(*this)
// clang-format off
#ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE
&& GetComputedSize()
#endif
;
// clang-format on
if (!Check(o != 0)) return false;
if (!(reinterpret_cast<const T*>(buf_ + start + o)->Verify(*this))) {
return false;
}
if (TrackVerifierBufferSize) {
if (GetComputedSize() == 0) return false;
}
return true;
}
template<typename T, int &..., typename SizeT>
bool VerifyNestedFlatBuffer(const Vector<uint8_t, SizeT> *const buf,
const char *const identifier) {
template <typename T, int&..., typename SizeT>
bool VerifyNestedFlatBuffer(const Vector<uint8_t, SizeT>* const buf,
const char* const identifier) {
// Caller opted out of this.
if (!opts_.check_nested_flatbuffers) return true;
@@ -232,25 +236,32 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
// If there is a nested buffer, it must be greater than the min size.
if (!Check(buf->size() >= FLATBUFFERS_MIN_BUFFER_SIZE)) return false;
Verifier nested_verifier(buf->data(), buf->size(), opts_);
VerifierTemplate<TrackVerifierBufferSize> nested_verifier(
buf->data(), buf->size(), opts_);
return nested_verifier.VerifyBuffer<T>(identifier);
}
// Verify this whole buffer, starting with root type T.
template<typename T> bool VerifyBuffer() { return VerifyBuffer<T>(nullptr); }
template <typename T>
bool VerifyBuffer() {
return VerifyBuffer<T>(nullptr);
}
template<typename T> bool VerifyBuffer(const char *const identifier) {
template <typename T>
bool VerifyBuffer(const char* const identifier) {
return VerifyBufferFromStart<T>(identifier, 0);
}
template<typename T, typename SizeT = uoffset_t>
bool VerifySizePrefixedBuffer(const char *const identifier) {
template <typename T, typename SizeT = uoffset_t>
bool VerifySizePrefixedBuffer(const char* const identifier) {
return Verify<SizeT>(0U) &&
Check(ReadScalar<SizeT>(buf_) == size_ - sizeof(SizeT)) &&
// Ensure the prefixed size is within the bounds of the provided
// length.
Check(ReadScalar<SizeT>(buf_) + sizeof(SizeT) <= size_) &&
VerifyBufferFromStart<T>(identifier, sizeof(SizeT));
}
template<typename OffsetT = uoffset_t, typename SOffsetT = soffset_t>
template <typename OffsetT = uoffset_t, typename SOffsetT = soffset_t>
size_t VerifyOffset(const size_t start) const {
if (!Verify<OffsetT>(start)) return 0;
const auto o = ReadScalar<OffsetT>(buf_ + start);
@@ -264,8 +275,8 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
return o;
}
template<typename OffsetT = uoffset_t>
size_t VerifyOffset(const uint8_t *const base, const voffset_t start) const {
template <typename OffsetT = uoffset_t>
size_t VerifyOffset(const uint8_t* const base, const voffset_t start) const {
return VerifyOffset<OffsetT>(static_cast<size_t>(base - buf_) + start);
}
@@ -284,31 +295,37 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
return true;
}
// Returns the message size in bytes
// Returns the message size in bytes.
//
// This should only be called after first calling VerifyBuffer or
// VerifySizePrefixedBuffer.
//
// This method should only be called for VerifierTemplate instances
// where the TrackVerifierBufferSize template parameter is true,
// i.e. for SizeVerifier. For instances where TrackVerifierBufferSize
// is false, this fails at runtime or returns zero.
size_t GetComputedSize() const {
// clang-format off
#ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE
if (TrackVerifierBufferSize) {
uintptr_t size = upper_bound_;
// Align the size to uoffset_t
size = (size - 1 + sizeof(uoffset_t)) & ~(sizeof(uoffset_t) - 1);
return (size > size_) ? 0 : size;
#else
// Must turn on FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE for this to work.
(void)upper_bound_;
FLATBUFFERS_ASSERT(false);
return 0;
#endif
// clang-format on
return (size > size_) ? 0 : size;
}
// Must use SizeVerifier, or (deprecated) turn on
// FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE, for this to work.
(void)upper_bound_;
FLATBUFFERS_ASSERT(false);
return 0;
}
std::vector<uint8_t> *GetFlexReuseTracker() { return flex_reuse_tracker_; }
std::vector<uint8_t>* GetFlexReuseTracker() { return flex_reuse_tracker_; }
void SetFlexReuseTracker(std::vector<uint8_t> *const rt) {
void SetFlexReuseTracker(std::vector<uint8_t>* const rt) {
flex_reuse_tracker_ = rt;
}
private:
const uint8_t *buf_;
const uint8_t* buf_;
const size_t size_;
const Options opts_;
@@ -316,14 +333,37 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
uoffset_t depth_ = 0;
uoffset_t num_tables_ = 0;
std::vector<uint8_t> *flex_reuse_tracker_ = nullptr;
std::vector<uint8_t>* flex_reuse_tracker_ = nullptr;
};
// Specialization for 64-bit offsets.
template<>
inline size_t Verifier::VerifyOffset<uoffset64_t>(const size_t start) const {
template <>
template <>
inline size_t VerifierTemplate<false>::VerifyOffset<uoffset64_t>(
const size_t start) const {
return VerifyOffset<uoffset64_t, soffset64_t>(start);
}
template <>
template <>
inline size_t VerifierTemplate<true>::VerifyOffset<uoffset64_t>(
const size_t start) const {
return VerifyOffset<uoffset64_t, soffset64_t>(start);
}
// Instance of VerifierTemplate that supports GetComputedSize().
using SizeVerifier = VerifierTemplate</*TrackVerifierBufferSize = */ true>;
// The FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE build configuration macro is
// deprecated, and should not be defined, since it is easy to misuse in ways
// that result in ODR violations. Rather than using Verifier and defining
// FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE, please use SizeVerifier instead.
#ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE // Deprecated, see above.
using Verifier = SizeVerifier;
#else
// Instance of VerifierTemplate that is slightly faster, but does not
// support GetComputedSize().
using Verifier = VerifierTemplate</*TrackVerifierBufferSize = */ false>;
#endif
} // namespace flatbuffers
+1 -1
View File
@@ -10,7 +10,7 @@ if(HAVE_IPP_ICV)
add_definitions(-DICV_BASE)
endif()
file(GLOB lib_srcs ${IPP_IW_PATH}/src/*.c)
file(GLOB lib_srcs ${IPP_IW_PATH}/src/*.c ${IPP_IW_PATH}/src/*.cpp)
file(GLOB lib_hdrs ${IPP_IW_PATH}/include/*.h ${IPP_IW_PATH}/include/iw/*.h ${IPP_IW_PATH}/include/iw++/*.hpp)
# ----------------------------------------------------------------------------------
+17 -9
View File
@@ -2,7 +2,7 @@ function(download_ippicv root_var)
set(${root_var} "" PARENT_SCOPE)
# Commit SHA in the opencv_3rdparty repo
set(IPPICV_COMMIT "fd27188235d85e552de31425e7ea0f53ba73ba53")
set(IPPICV_COMMIT "c934a2a15a6df020446ac3dfa07e3acf72b63a8f")
# Define actual ICV versions
if(APPLE)
set(IPPICV_COMMIT "0cc4aa06bf2bef4b05d237c69a5a96b9cd0cb85a")
@@ -14,21 +14,29 @@ function(download_ippicv root_var)
set(OPENCV_ICV_PLATFORM "linux")
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_lnx")
if(X86_64)
set(OPENCV_ICV_NAME "ippicv_2021.11.0_lnx_intel64_20240201_general.tgz")
set(OPENCV_ICV_HASH "0f2745ff705ecae31176dad437608f6f")
set(OPENCV_ICV_NAME "ippicv_2022.2.0_lnx_intel64_20250730_general.tgz")
set(OPENCV_ICV_HASH "55d18247d8ef707f009b94f69d77b948")
else()
set(OPENCV_ICV_NAME "ippicv_2021.11.0_lnx_ia32_20240201_general.tgz")
set(OPENCV_ICV_HASH "63e381bf08076ca34fd5264203043a45")
if(ANDROID)
set(IPPICV_COMMIT "c7c6d527dde5fee7cb914ee9e4e20f7436aab3a1")
set(OPENCV_ICV_NAME "ippicv_2021.10.1_lnx_ia32_20231206_general.tgz")
set(OPENCV_ICV_HASH "d9510f3ce08f6074aac472a5c19a3b53")
else()
set(IPPICV_COMMIT "7f55c0c26be418d494615afca15218566775c725")
set(OPENCV_ICV_NAME "ippicv_2021.12.0_lnx_ia32_20240425_general.tgz")
set(OPENCV_ICV_HASH "85ffa2b9ed7802b93c23fa27b0097d36")
endif()
endif()
elseif(WIN32 AND NOT ARM)
set(OPENCV_ICV_PLATFORM "windows")
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_win")
if(X86_64)
set(OPENCV_ICV_NAME "ippicv_2021.11.0_win_intel64_20240201_general.zip")
set(OPENCV_ICV_HASH "59d154bf54a1e3eea20d7248f81a2a8e")
set(OPENCV_ICV_NAME "ippicv_2022.2.0_win_intel64_20250730_general.zip")
set(OPENCV_ICV_HASH "7c0973976ab0716bc33f03a76a50017f")
else()
set(OPENCV_ICV_NAME "ippicv_2021.11.0_win_ia32_20240201_general.zip")
set(OPENCV_ICV_HASH "7a6d8ac5825c02fea6cbfc1201b521b5")
set(IPPICV_COMMIT "7f55c0c26be418d494615afca15218566775c725")
set(OPENCV_ICV_NAME "ippicv_2021.12.0_win_ia32_20240425_general.zip")
set(OPENCV_ICV_HASH "8b1d2a23957d57624d0de8f2a5cae5f1")
endif()
else()
return()
+6 -2
View File
@@ -24,7 +24,6 @@ set(ITT_PUBLIC_HDRS
include/ittnotify.h
include/jitprofiling.h
include/libittnotify.h
include/llvm_jit_event_listener.hpp
)
set(ITT_PRIVATE_HDRS
src/ittnotify/disable_warnings.h
@@ -39,6 +38,11 @@ set(ITT_SRCS
add_library(${ITT_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${ITT_SRCS} ${ITT_PUBLIC_HDRS} ${ITT_PRIVATE_HDRS})
file(STRINGS "src/ittnotify/ittnotify_config.h" API_VERSION_NUM REGEX "#define\[ \t]+API_VERSION_NUM[ \t]+([0-9\.]+)")
if(API_VERSION_NUM MATCHES "#define\[ \t]+API_VERSION_NUM[ \t]+([0-9\.]*)")
set(ITTNOTIFY_VERSION "${CMAKE_MATCH_1}" CACHE INTERNAL "" FORCE)
endif()
if(NOT WIN32)
if(HAVE_DL_LIBRARY)
target_link_libraries(${ITT_LIBRARY} dl)
@@ -64,4 +68,4 @@ if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${ITT_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
endif()
ocv_install_3rdparty_licenses(ittnotify src/ittnotify/LICENSE.BSD src/ittnotify/LICENSE.GPL)
ocv_install_3rdparty_licenses(ittnotify src/ittnotify/BSD-3-Clause.txt src/ittnotify/GPL-2.0-only.txt)
+643 -101
View File
@@ -1,60 +1,8 @@
/* <copyright>
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
/*
Copyright (C) 2005-2019 Intel Corporation
GPL LICENSE SUMMARY
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution
in the file called LICENSE.GPL.
Contact Information:
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
BSD LICENSE
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</copyright> */
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
*/
#ifndef _ITTNOTIFY_H_
#define _ITTNOTIFY_H_
@@ -63,7 +11,8 @@
@brief Public User API functions and types
@mainpage
The ITT API is used to annotate a user's program with additional information
The Instrumentation and Tracing Technology API (ITT API) is used to
annotate a user's program with additional information
that can be used by correctness and performance tools. The user inserts
calls in their program. Those calls generate information that is collected
at runtime, and used by Intel(R) Threading Tools.
@@ -141,6 +90,10 @@ The same ID may not be reused for different instances, unless a previous
# define ITT_OS_FREEBSD 4
#endif /* ITT_OS_FREEBSD */
#ifndef ITT_OS_OPENBSD
# define ITT_OS_OPENBSD 5
#endif /* ITT_OS_OPENBSD */
#ifndef ITT_OS
# if defined WIN32 || defined _WIN32
# define ITT_OS ITT_OS_WIN
@@ -148,6 +101,8 @@ The same ID may not be reused for different instances, unless a previous
# define ITT_OS ITT_OS_MAC
# elif defined( __FreeBSD__ )
# define ITT_OS ITT_OS_FREEBSD
# elif defined( __OpenBSD__)
# define ITT_OS ITT_OS_OPENBSD
# else
# define ITT_OS ITT_OS_LINUX
# endif
@@ -169,6 +124,10 @@ The same ID may not be reused for different instances, unless a previous
# define ITT_PLATFORM_FREEBSD 4
#endif /* ITT_PLATFORM_FREEBSD */
#ifndef ITT_PLATFORM_OPENBSD
# define ITT_PLATFORM_OPENBSD 5
#endif /* ITT_PLATFORM_OPENBSD */
#ifndef ITT_PLATFORM
# if ITT_OS==ITT_OS_WIN
# define ITT_PLATFORM ITT_PLATFORM_WIN
@@ -176,6 +135,8 @@ The same ID may not be reused for different instances, unless a previous
# define ITT_PLATFORM ITT_PLATFORM_MAC
# elif ITT_OS==ITT_OS_FREEBSD
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
# elif ITT_OS==ITT_OS_OPENBSD
# define ITT_PLATFORM ITT_PLATFORM_OPENBSD
# else
# define ITT_PLATFORM ITT_PLATFORM_POSIX
# endif
@@ -228,7 +189,12 @@ The same ID may not be reused for different instances, unless a previous
#if ITT_PLATFORM==ITT_PLATFORM_WIN
/* use __forceinline (VC++ specific) */
#define ITT_INLINE __forceinline
#if defined(__MINGW32__) && !defined(__cplusplus)
#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__))
#else
#define ITT_INLINE static __forceinline
#endif /* __MINGW32__ */
#define ITT_INLINE_ATTRIBUTE /* nothing */
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/*
@@ -289,20 +255,20 @@ The same ID may not be reused for different instances, unless a previous
#define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)
#define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)
#define ITTNOTIFY_VOID_D0(n,d) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
#define ITTNOTIFY_VOID_D1(n,d,x) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
#define ITTNOTIFY_VOID_D2(n,d,x,y) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
#define ITTNOTIFY_DATA_D0(n,d) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
#define ITTNOTIFY_DATA_D1(n,d,x) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
#define ITTNOTIFY_DATA_D2(n,d,x,y) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
#define ITTNOTIFY_VOID_D0(n,d) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
#define ITTNOTIFY_VOID_D1(n,d,x) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
#define ITTNOTIFY_VOID_D2(n,d,x,y) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
#define ITTNOTIFY_DATA_D0(n,d) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
#define ITTNOTIFY_DATA_D1(n,d,x) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
#define ITTNOTIFY_DATA_D2(n,d,x,y) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
#ifdef ITT_STUB
#undef ITT_STUB
@@ -340,7 +306,7 @@ extern "C" {
* only pauses tracing and analyzing memory access.
* It does not pause tracing or analyzing threading APIs.
* .
* - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE:
* - Intel(R) VTune(TM) Profiler:
* - Does continue to record when new threads are started.
* .
* - Other effects:
@@ -355,35 +321,143 @@ void ITTAPI __itt_resume(void);
/** @brief Detach collection */
void ITTAPI __itt_detach(void);
/**
* @enum __itt_collection_scope
* @brief Enumerator for collection scopes
*/
typedef enum {
__itt_collection_scope_host = 1 << 0,
__itt_collection_scope_offload = 1 << 1,
__itt_collection_scope_all = 0x7FFFFFFF
} __itt_collection_scope;
/** @brief Pause scoped collection */
void ITTAPI __itt_pause_scoped(__itt_collection_scope);
/** @brief Resume scoped collection */
void ITTAPI __itt_resume_scoped(__itt_collection_scope);
/** @cond exclude_from_documentation */
#ifndef INTEL_NO_MACRO_BODY
#ifndef INTEL_NO_ITTNOTIFY_API
ITT_STUBV(ITTAPI, void, pause, (void))
ITT_STUBV(ITTAPI, void, resume, (void))
ITT_STUBV(ITTAPI, void, detach, (void))
#define __itt_pause ITTNOTIFY_VOID(pause)
#define __itt_pause_ptr ITTNOTIFY_NAME(pause)
#define __itt_resume ITTNOTIFY_VOID(resume)
#define __itt_resume_ptr ITTNOTIFY_NAME(resume)
#define __itt_detach ITTNOTIFY_VOID(detach)
#define __itt_detach_ptr ITTNOTIFY_NAME(detach)
ITT_STUBV(ITTAPI, void, pause, (void))
ITT_STUBV(ITTAPI, void, pause_scoped, (__itt_collection_scope))
ITT_STUBV(ITTAPI, void, resume, (void))
ITT_STUBV(ITTAPI, void, resume_scoped, (__itt_collection_scope))
ITT_STUBV(ITTAPI, void, detach, (void))
#define __itt_pause ITTNOTIFY_VOID(pause)
#define __itt_pause_ptr ITTNOTIFY_NAME(pause)
#define __itt_pause_scoped ITTNOTIFY_VOID(pause_scoped)
#define __itt_pause_scoped_ptr ITTNOTIFY_NAME(pause_scoped)
#define __itt_resume ITTNOTIFY_VOID(resume)
#define __itt_resume_ptr ITTNOTIFY_NAME(resume)
#define __itt_resume_scoped ITTNOTIFY_VOID(resume_scoped)
#define __itt_resume_scoped_ptr ITTNOTIFY_NAME(resume_scoped)
#define __itt_detach ITTNOTIFY_VOID(detach)
#define __itt_detach_ptr ITTNOTIFY_NAME(detach)
#else /* INTEL_NO_ITTNOTIFY_API */
#define __itt_pause()
#define __itt_pause_ptr 0
#define __itt_pause_ptr 0
#define __itt_pause_scoped(scope)
#define __itt_pause_scoped_ptr 0
#define __itt_resume()
#define __itt_resume_ptr 0
#define __itt_resume_ptr 0
#define __itt_resume_scoped(scope)
#define __itt_resume_scoped_ptr 0
#define __itt_detach()
#define __itt_detach_ptr 0
#define __itt_detach_ptr 0
#endif /* INTEL_NO_ITTNOTIFY_API */
#else /* INTEL_NO_MACRO_BODY */
#define __itt_pause_ptr 0
#define __itt_resume_ptr 0
#define __itt_detach_ptr 0
#define __itt_pause_ptr 0
#define __itt_pause_scoped_ptr 0
#define __itt_resume_ptr 0
#define __itt_resume_scoped_ptr 0
#define __itt_detach_ptr 0
#endif /* INTEL_NO_MACRO_BODY */
/** @endcond */
/** @} control group */
/** @endcond */
/**
* @defgroup Intel Processor Trace control
* API from this group provides control over collection and analysis of Intel Processor Trace (Intel PT) data
* Information about Intel Processor Trace technology can be found here (Volume 3 chapter 35):
* https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf
* Use this API to mark particular code regions for loading detailed performance statistics.
* This mode makes your analysis faster and more accurate.
* @{
*/
typedef unsigned char __itt_pt_region;
/**
* @brief function saves a region name marked with Intel PT API and returns a region id.
* Only 7 names can be registered. Attempts to register more names will be ignored and a region id with auto names will be returned.
* For automatic naming of regions pass NULL as function parameter
*/
#if ITT_PLATFORM==ITT_PLATFORM_WIN
__itt_pt_region ITTAPI __itt_pt_region_createA(const char *name);
__itt_pt_region ITTAPI __itt_pt_region_createW(const wchar_t *name);
#if defined(UNICODE) || defined(_UNICODE)
# define __itt_pt_region_create __itt_pt_region_createW
#else /* UNICODE */
# define __itt_pt_region_create __itt_pt_region_createA
#endif /* UNICODE */
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
__itt_pt_region ITTAPI __itt_pt_region_create(const char *name);
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/** @cond exclude_from_documentation */
#ifndef INTEL_NO_MACRO_BODY
#ifndef INTEL_NO_ITTNOTIFY_API
#if ITT_PLATFORM==ITT_PLATFORM_WIN
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createA, (const char *name))
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createW, (const wchar_t *name))
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_create, (const char *name))
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#define __itt_pt_region_createA ITTNOTIFY_DATA(pt_region_createA)
#define __itt_pt_region_createA_ptr ITTNOTIFY_NAME(pt_region_createA)
#define __itt_pt_region_createW ITTNOTIFY_DATA(pt_region_createW)
#define __itt_pt_region_createW_ptr ITTNOTIFY_NAME(pt_region_createW)
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#define __itt_pt_region_create ITTNOTIFY_DATA(pt_region_create)
#define __itt_pt_region_create_ptr ITTNOTIFY_NAME(pt_region_create)
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#else /* INTEL_NO_ITTNOTIFY_API */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#define __itt_pt_region_createA(name) (__itt_pt_region)0
#define __itt_pt_region_createA_ptr 0
#define __itt_pt_region_createW(name) (__itt_pt_region)0
#define __itt_pt_region_createW_ptr 0
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#define __itt_pt_region_create(name) (__itt_pt_region)0
#define __itt_pt_region_create_ptr 0
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#endif /* INTEL_NO_ITTNOTIFY_API */
#else /* INTEL_NO_MACRO_BODY */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#define __itt_pt_region_createA_ptr 0
#define __itt_pt_region_createW_ptr 0
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#define __itt_pt_region_create_ptr 0
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#endif /* INTEL_NO_MACRO_BODY */
/** @endcond */
/**
* @brief function contains a special code pattern identified on the post-processing stage and
* marks the beginning of a code region targeted for Intel PT analysis
* @param[in] region - region id, 0 <= region < 8
*/
void __itt_mark_pt_region_begin(__itt_pt_region region);
/**
* @brief function contains a special code pattern identified on the post-processing stage and
* marks the end of a code region targeted for Intel PT analysis
* @param[in] region - region id, 0 <= region < 8
*/
void __itt_mark_pt_region_end(__itt_pt_region region);
/** @} Intel PT control group*/
/**
* @defgroup threads Threads
* @ingroup public
@@ -541,14 +615,26 @@ ITT_STUBV(ITTAPI, void, suppress_pop, (void))
/** @endcond */
/**
* @enum __itt_model_disable
* @brief Enumerator for the disable methods
* @enum __itt_suppress_mode
* @brief Enumerator for the suppressing modes
*/
typedef enum __itt_suppress_mode {
__itt_unsuppress_range,
__itt_suppress_range
} __itt_suppress_mode_t;
/**
* @enum __itt_collection_state
* @brief Enumerator for collection state.
*/
typedef enum {
__itt_collection_uninitialized = 0, /* uninitialized */
__itt_collection_init_fail = 1, /* failed to init */
__itt_collection_collector_absent = 2, /* non work state collector is absent */
__itt_collection_collector_exists = 3, /* work state collector exists */
__itt_collection_init_successful = 4 /* success to init */
} __itt_collection_state;
/**
* @brief Mark a range of memory for error suppression or unsuppression for error types included in mask
*/
@@ -1496,7 +1582,7 @@ ITT_STUBV(ITTAPI, void, heap_allocate_end, (__itt_heap_function h, void** addr,
/** @endcond */
/**
* @brief Record an free begin occurrence.
* @brief Record a free begin occurrence.
*/
void ITTAPI __itt_heap_free_begin(__itt_heap_function h, void* addr);
@@ -1516,7 +1602,7 @@ ITT_STUBV(ITTAPI, void, heap_free_begin, (__itt_heap_function h, void* addr))
/** @endcond */
/**
* @brief Record an free end occurrence.
* @brief Record a free end occurrence.
*/
void ITTAPI __itt_heap_free_end(__itt_heap_function h, void* addr);
@@ -1536,7 +1622,7 @@ ITT_STUBV(ITTAPI, void, heap_free_end, (__itt_heap_function h, void* addr))
/** @endcond */
/**
* @brief Record an reallocation begin occurrence.
* @brief Record a reallocation begin occurrence.
*/
void ITTAPI __itt_heap_reallocate_begin(__itt_heap_function h, void* addr, size_t new_size, int initialized);
@@ -1556,7 +1642,7 @@ ITT_STUBV(ITTAPI, void, heap_reallocate_begin, (__itt_heap_function h, void* add
/** @endcond */
/**
* @brief Record an reallocation end occurrence.
* @brief Record a reallocation end occurrence.
*/
void ITTAPI __itt_heap_reallocate_end(__itt_heap_function h, void* addr, void** new_addr, size_t new_size, int initialized);
@@ -2692,7 +2778,7 @@ ITT_STUB(ITTAPI, __itt_clock_domain*, clock_domain_create, (__itt_get_clock_info
/**
* @ingroup clockdomains
* @brief Recalculate clock domains frequences and clock base timestamps.
* @brief Recalculate clock domains frequencies and clock base timestamps.
*/
void ITTAPI __itt_clock_domain_reset(void);
@@ -3597,11 +3683,12 @@ ITT_STUBV(ITTAPI, void, enable_attach, (void))
/** @endcond */
/**
* @brief Module load info
* This API is used to report necessary information in case of module relocation
* @param[in] start_addr - relocated module start address
* @param[in] end_addr - relocated module end address
* @param[in] path - file system path to the module
* @brief Module load notification
* This API is used to report necessary information in case of bypassing default system loader.
* Notification should be done immidiatelly after this module is loaded to process memory.
* @param[in] start_addr - module start address
* @param[in] end_addr - module end address
* @param[in] path - file system full path to the module
*/
#if ITT_PLATFORM==ITT_PLATFORM_WIN
void ITTAPI __itt_module_loadA(void *start_addr, void *end_addr, const char *path);
@@ -3656,7 +3743,462 @@ ITT_STUB(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const ch
#endif /* INTEL_NO_MACRO_BODY */
/** @endcond */
/**
* @brief Report module unload
* This API is used to report necessary information in case of bypassing default system loader.
* Notification should be done just before the module is unloaded from process memory.
* @param[in] addr - base address of loaded module
*/
void ITTAPI __itt_module_unload(void *addr);
/** @cond exclude_from_documentation */
#ifndef INTEL_NO_MACRO_BODY
#ifndef INTEL_NO_ITTNOTIFY_API
ITT_STUBV(ITTAPI, void, module_unload, (void *addr))
#define __itt_module_unload ITTNOTIFY_VOID(module_unload)
#define __itt_module_unload_ptr ITTNOTIFY_NAME(module_unload)
#else /* INTEL_NO_ITTNOTIFY_API */
#define __itt_module_unload(addr)
#define __itt_module_unload_ptr 0
#endif /* INTEL_NO_ITTNOTIFY_API */
#else /* INTEL_NO_MACRO_BODY */
#define __itt_module_unload_ptr 0
#endif /* INTEL_NO_MACRO_BODY */
/** @endcond */
/** @cond exclude_from_documentation */
typedef enum
{
__itt_module_type_unknown = 0,
__itt_module_type_elf,
__itt_module_type_coff
} __itt_module_type;
/** @endcond */
/** @cond exclude_from_documentation */
typedef enum
{
itt_section_type_unknown,
itt_section_type_bss, /* notifies that the section contains uninitialized data. These are the relevant section types and the modules that contain them:
* ELF module: SHT_NOBITS section type
* COFF module: IMAGE_SCN_CNT_UNINITIALIZED_DATA section type
*/
itt_section_type_data, /* notifies that section contains initialized data. These are the relevant section types and the modules that contain them:
* ELF module: SHT_PROGBITS section type
* COFF module: IMAGE_SCN_CNT_INITIALIZED_DATA section type
*/
itt_section_type_text /* notifies that the section contains executable code. These are the relevant section types and the modules that contain them:
* ELF module: SHT_PROGBITS section type
* COFF module: IMAGE_SCN_CNT_CODE section type
*/
} __itt_section_type;
/** @endcond */
/**
* @hideinitializer
* @brief bit-mask, detects a section attribute that indicates whether a section can be executed as code:
* These are the relevant section attributes and the modules that contain them:
* ELF module: PF_X section attribute
* COFF module: IMAGE_SCN_MEM_EXECUTE attribute
*/
#define __itt_section_exec 0x20000000
/**
* @hideinitializer
* @brief bit-mask, detects a section attribute that indicates whether a section can be read.
* These are the relevant section attributes and the modules that contain them:
* ELF module: PF_R attribute
* COFF module: IMAGE_SCN_MEM_READ attribute
*/
#define __itt_section_read 0x40000000
/**
* @hideinitializer
* @brief bit-mask, detects a section attribute that indicates whether a section can be written to.
* These are the relevant section attributes and the modules that contain them:
* ELF module: PF_W attribute
* COFF module: IMAGE_SCN_MEM_WRITE attribute
*/
#define __itt_section_write 0x80000000
/** @cond exclude_from_documentation */
#pragma pack(push, 8)
typedef struct ___itt_section_info
{
const char* name; /*!< Section name in UTF8 */
__itt_section_type type; /*!< Section content and semantics description */
size_t flags; /*!< Section bit flags that describe attributes using bit mask
* Zero if disabled, non-zero if enabled
*/
void* start_addr; /*!< Section load(relocated) start address */
size_t size; /*!< Section file offset */
size_t file_offset; /*!< Section size */
} __itt_section_info;
#pragma pack(pop)
/** @endcond */
/** @cond exclude_from_documentation */
#pragma pack(push, 8)
typedef struct ___itt_module_object
{
unsigned int version; /*!< API version*/
__itt_id module_id; /*!< Unique identifier. This is unchanged for sections that belong to the same module */
__itt_module_type module_type; /*!< Binary module format */
const char* module_name; /*!< Unique module name or path to module in UTF8
* Contains module name when module_bufer and module_size exist
* Contains module path when module_bufer and module_size absent
* module_name remains the same for the certain module_id
*/
void* module_buffer; /*!< Module buffer content */
size_t module_size; /*!< Module buffer size */
/*!< If module_buffer and module_size exist, the binary module is dumped onto the system.
* If module_buffer and module_size do not exist,
* the binary module exists on the system already.
* The module_name parameter contains the path to the module.
*/
__itt_section_info* section_array; /*!< Reference to section information */
size_t section_number;
} __itt_module_object;
#pragma pack(pop)
/** @endcond */
/**
* @brief Load module content and its loaded(relocated) sections.
* This API is useful to save a module, or specify its location on the system and report information about loaded sections.
* The target module is saved on the system if module buffer content and size are available.
* If module buffer content and size are unavailable, the module name contains the path to the existing binary module.
* @param[in] module_obj - provides module and section information, along with unique module identifiers (name,module ID)
* which bind the binary module to particular sections.
*/
void ITTAPI __itt_module_load_with_sections(__itt_module_object* module_obj);
/** @cond exclude_from_documentation */
#ifndef INTEL_NO_MACRO_BODY
#ifndef INTEL_NO_ITTNOTIFY_API
ITT_STUBV(ITTAPI, void, module_load_with_sections, (__itt_module_object* module_obj))
#define __itt_module_load_with_sections ITTNOTIFY_VOID(module_load_with_sections)
#define __itt_module_load_with_sections_ptr ITTNOTIFY_NAME(module_load_with_sections)
#else /* INTEL_NO_ITTNOTIFY_API */
#define __itt_module_load_with_sections(module_obj)
#define __itt_module_load_with_sections_ptr 0
#endif /* INTEL_NO_ITTNOTIFY_API */
#else /* INTEL_NO_MACRO_BODY */
#define __itt_module_load_with_sections_ptr 0
#endif /* INTEL_NO_MACRO_BODY */
/** @endcond */
/**
* @brief Unload a module and its loaded(relocated) sections.
* This API notifies that the module and its sections were unloaded.
* @param[in] module_obj - provides module and sections information, along with unique module identifiers (name,module ID)
* which bind the binary module to particular sections.
*/
void ITTAPI __itt_module_unload_with_sections(__itt_module_object* module_obj);
/** @cond exclude_from_documentation */
#ifndef INTEL_NO_MACRO_BODY
#ifndef INTEL_NO_ITTNOTIFY_API
ITT_STUBV(ITTAPI, void, module_unload_with_sections, (__itt_module_object* module_obj))
#define __itt_module_unload_with_sections ITTNOTIFY_VOID(module_unload_with_sections)
#define __itt_module_unload_with_sections_ptr ITTNOTIFY_NAME(module_unload_with_sections)
#else /* INTEL_NO_ITTNOTIFY_API */
#define __itt_module_unload_with_sections(module_obj)
#define __itt_module_unload_with_sections_ptr 0
#endif /* INTEL_NO_ITTNOTIFY_API */
#else /* INTEL_NO_MACRO_BODY */
#define __itt_module_unload_with_sections_ptr 0
#endif /* INTEL_NO_MACRO_BODY */
/** @endcond */
/** @cond exclude_from_documentation */
#pragma pack(push, 8)
typedef struct ___itt_histogram
{
const __itt_domain* domain; /*!< Domain of the histogram*/
const char* nameA; /*!< Name of the histogram */
#if defined(UNICODE) || defined(_UNICODE)
const wchar_t* nameW;
#else /* UNICODE || _UNICODE */
void* nameW;
#endif /* UNICODE || _UNICODE */
__itt_metadata_type x_type; /*!< Type of the histogram X axis */
__itt_metadata_type y_type; /*!< Type of the histogram Y axis */
int extra1; /*!< Reserved to the runtime */
void* extra2; /*!< Reserved to the runtime */
struct ___itt_histogram* next;
} __itt_histogram;
#pragma pack(pop)
/** @endcond */
/**
* @brief Create a typed histogram instance with given name/domain.
* @param[in] domain The domain controlling the call.
* @param[in] name The name of the histogram.
* @param[in] x_type The type of the X axis in histogram (may be 0 to calculate batch statistics).
* @param[in] y_type The type of the Y axis in histogram.
*/
#if ITT_PLATFORM==ITT_PLATFORM_WIN
__itt_histogram* ITTAPI __itt_histogram_createA(const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
__itt_histogram* ITTAPI __itt_histogram_createW(const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
#if defined(UNICODE) || defined(_UNICODE)
# define __itt_histogram_create __itt_histogram_createW
# define __itt_histogram_create_ptr __itt_histogram_createW_ptr
#else /* UNICODE */
# define __itt_histogram_create __itt_histogram_createA
# define __itt_histogram_create_ptr __itt_histogram_createA_ptr
#endif /* UNICODE */
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
__itt_histogram* ITTAPI __itt_histogram_create(const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/** @cond exclude_from_documentation */
#ifndef INTEL_NO_MACRO_BODY
#ifndef INTEL_NO_ITTNOTIFY_API
#if ITT_PLATFORM==ITT_PLATFORM_WIN
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createA, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createW, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
ITT_STUB(ITTAPI, __itt_histogram*, histogram_create, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#define __itt_histogram_createA ITTNOTIFY_DATA(histogram_createA)
#define __itt_histogram_createA_ptr ITTNOTIFY_NAME(histogram_createA)
#define __itt_histogram_createW ITTNOTIFY_DATA(histogram_createW)
#define __itt_histogram_createW_ptr ITTNOTIFY_NAME(histogram_createW)
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#define __itt_histogram_create ITTNOTIFY_DATA(histogram_create)
#define __itt_histogram_create_ptr ITTNOTIFY_NAME(histogram_create)
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#else /* INTEL_NO_ITTNOTIFY_API */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#define __itt_histogram_createA(domain, name, x_type, y_type) (__itt_histogram*)0
#define __itt_histogram_createA_ptr 0
#define __itt_histogram_createW(domain, name, x_type, y_type) (__itt_histogram*)0
#define __itt_histogram_createW_ptr 0
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#define __itt_histogram_create(domain, name, x_type, y_type) (__itt_histogram*)0
#define __itt_histogram_create_ptr 0
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#endif /* INTEL_NO_ITTNOTIFY_API */
#else /* INTEL_NO_MACRO_BODY */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#define __itt_histogram_createA_ptr 0
#define __itt_histogram_createW_ptr 0
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#define __itt_histogram_create_ptr 0
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#endif /* INTEL_NO_MACRO_BODY */
/** @endcond */
/**
* @brief Submit statistics for a histogram instance.
* @param[in] hist Pointer to the histogram instance to which the histogram statistic is to be dumped.
* @param[in] length The number of elements in dumped axis data array.
* @param[in] x_data The X axis dumped data itself (may be NULL to calculate batch statistics).
* @param[in] y_data The Y axis dumped data itself.
*/
void ITTAPI __itt_histogram_submit(__itt_histogram* hist, size_t length, void* x_data, void* y_data);
/** @cond exclude_from_documentation */
#ifndef INTEL_NO_MACRO_BODY
#ifndef INTEL_NO_ITTNOTIFY_API
ITT_STUBV(ITTAPI, void, histogram_submit, (__itt_histogram* hist, size_t length, void* x_data, void* y_data))
#define __itt_histogram_submit ITTNOTIFY_VOID(histogram_submit)
#define __itt_histogram_submit_ptr ITTNOTIFY_NAME(histogram_submit)
#else /* INTEL_NO_ITTNOTIFY_API */
#define __itt_histogram_submit(hist, length, x_data, y_data)
#define __itt_histogram_submit_ptr 0
#endif /* INTEL_NO_ITTNOTIFY_API */
#else /* INTEL_NO_MACRO_BODY */
#define __itt_histogram_submit_ptr 0
#endif /* INTEL_NO_MACRO_BODY */
/**
* @brief function allows to obtain the current collection state at the moment
* @return collection state as a enum __itt_collection_state
*/
__itt_collection_state __itt_get_collection_state(void);
/**
* @brief function releases resources allocated by ITT API static part
* this API should be called from the library destructor
* @return void
*/
void __itt_release_resources(void);
/** @endcond */
/**
* @brief Create a typed counter with given domain pointer, string name and counter type
*/
#if ITT_PLATFORM==ITT_PLATFORM_WIN
__itt_counter ITTAPI __itt_counter_createA_v3(const __itt_domain* domain, const char* name, __itt_metadata_type type);
__itt_counter ITTAPI __itt_counter_createW_v3(const __itt_domain* domain, const wchar_t* name, __itt_metadata_type type);
#if defined(UNICODE) || defined(_UNICODE)
# define __itt_counter_create_v3 __itt_counter_createW_v3
# define __itt_counter_create_v3_ptr __itt_counter_createW_v3_ptr
#else /* UNICODE */
# define __itt_counter_create_v3 __itt_counter_createA_v3
# define __itt_counter_create_v3_ptr __itt_counter_createA_v3_ptr
#endif /* UNICODE */
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
__itt_counter ITTAPI __itt_counter_create_v3(const __itt_domain* domain, const char* name, __itt_metadata_type type);
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#ifndef INTEL_NO_MACRO_BODY
#ifndef INTEL_NO_ITTNOTIFY_API
#if ITT_PLATFORM==ITT_PLATFORM_WIN
ITT_STUB(ITTAPI, __itt_counter, counter_createA_v3, (const __itt_domain* domain, const char* name, __itt_metadata_type type))
ITT_STUB(ITTAPI, __itt_counter, counter_createW_v3, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type type))
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
ITT_STUB(ITTAPI, __itt_counter, counter_create_v3, (const __itt_domain* domain, const char* name, __itt_metadata_type type))
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#define __itt_counter_createA_v3 ITTNOTIFY_DATA(counter_createA_v3)
#define __itt_counter_createA_v3_ptr ITTNOTIFY_NAME(counter_createA_v3)
#define __itt_counter_createW_v3 ITTNOTIFY_DATA(counter_createW_v3)
#define __itt_counter_createW_v3_ptr ITTNOTIFY_NAME(counter_createW_v3)
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#define __itt_counter_create_v3 ITTNOTIFY_DATA(counter_create_v3)
#define __itt_counter_create_v3_ptr ITTNOTIFY_NAME(counter_create_v3)
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#else /* INTEL_NO_ITTNOTIFY_API */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#define __itt_counter_createA_v3(domain, name, type) (__itt_counter)0
#define __itt_counter_createA_v3_ptr 0
#define __itt_counter_createW_v3(domain, name, type) (__itt_counter)0
#define __itt_counter_create_typedW_ptr 0
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#define __itt_counter_create_v3(domain, name, type) (__itt_counter)0
#define __itt_counter_create_v3_ptr 0
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#endif /* INTEL_NO_ITTNOTIFY_API */
#else /* INTEL_NO_MACRO_BODY */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#define __itt_counter_createA_v3_ptr 0
#define __itt_counter_createW_v3_ptr 0
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#define __itt_counter_create_v3_ptr 0
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#endif /* INTEL_NO_MACRO_BODY */
/** @endcond */
/**
* @brief Set the counter value api
*/
void ITTAPI __itt_counter_set_value_v3(__itt_counter counter, void *value_ptr);
#ifndef INTEL_NO_MACRO_BODY
#ifndef INTEL_NO_ITTNOTIFY_API
ITT_STUBV(ITTAPI, void, counter_set_value_v3, (__itt_counter counter, void *value_ptr))
#define __itt_counter_set_value_v3 ITTNOTIFY_VOID(counter_set_value_v3)
#define __itt_counter_set_value_v3_ptr ITTNOTIFY_NAME(counter_set_value_v3)
#else /* INTEL_NO_ITTNOTIFY_API */
#define __itt_counter_set_value_v3(counter, value_ptr)
#define __itt_counter_set_value_v3_ptr 0
#endif /* INTEL_NO_ITTNOTIFY_API */
#else /* INTEL_NO_MACRO_BODY */
#define __itt_counter_set_value_v3_ptr 0
#endif /* INTEL_NO_MACRO_BODY */
/** @endcond */
/**
* @brief describes the type of context metadata
*/
typedef enum {
__itt_context_unknown = 0, /*!< Undefined type */
__itt_context_nameA, /*!< ASCII string char* type */
__itt_context_nameW, /*!< Unicode string wchar_t* type */
__itt_context_deviceA, /*!< ASCII string char* type */
__itt_context_deviceW, /*!< Unicode string wchar_t* type */
__itt_context_unitsA, /*!< ASCII string char* type */
__itt_context_unitsW, /*!< Unicode string wchar_t* type */
__itt_context_pci_addrA, /*!< ASCII string char* type */
__itt_context_pci_addrW, /*!< Unicode string wchar_t* type */
__itt_context_tid, /*!< Unsigned 64-bit integer type */
__itt_context_max_val, /*!< Unsigned 64-bit integer type */
__itt_context_bandwidth_flag, /*!< Unsigned 64-bit integer type */
__itt_context_latency_flag, /*!< Unsigned 64-bit integer type */
__itt_context_occupancy_flag, /*!< Unsigned 64-bit integer type */
__itt_context_on_thread_flag, /*!< Unsigned 64-bit integer type */
__itt_context_is_abs_val_flag, /*!< Unsigned 64-bit integer type */
__itt_context_cpu_instructions_flag, /*!< Unsigned 64-bit integer type */
__itt_context_cpu_cycles_flag /*!< Unsigned 64-bit integer type */
} __itt_context_type;
#if defined(UNICODE) || defined(_UNICODE)
# define __itt_context_name __itt_context_nameW
# define __itt_context_device __itt_context_deviceW
# define __itt_context_units __itt_context_unitsW
# define __itt_context_pci_addr __itt_context_pci_addrW
#else /* UNICODE || _UNICODE */
# define __itt_context_name __itt_context_nameA
# define __itt_context_device __itt_context_deviceA
# define __itt_context_units __itt_context_unitsA
# define __itt_context_pci_addr __itt_context_pci_addrA
#endif /* UNICODE || _UNICODE */
/** @cond exclude_from_documentation */
#pragma pack(push, 8)
typedef struct ___itt_context_metadata
{
__itt_context_type type; /*!< Type of the context metadata value */
void* value; /*!< Pointer to context metadata value itself */
} __itt_context_metadata;
#pragma pack(pop)
/** @endcond */
/** @cond exclude_from_documentation */
#pragma pack(push, 8)
typedef struct ___itt_counter_metadata
{
__itt_counter counter; /*!< Associated context metadata counter */
__itt_context_type type; /*!< Type of the context metadata value */
const char* str_valueA; /*!< String context metadata value */
#if defined(UNICODE) || defined(_UNICODE)
const wchar_t* str_valueW;
#else /* UNICODE || _UNICODE */
void* str_valueW;
#endif /* UNICODE || _UNICODE */
unsigned long long value; /*!< Numeric context metadata value */
int extra1; /*!< Reserved to the runtime */
void* extra2; /*!< Reserved to the runtime */
struct ___itt_counter_metadata* next;
} __itt_counter_metadata;
#pragma pack(pop)
/** @endcond */
/**
* @brief Bind context metadata to counter instance
* @param[in] counter Pointer to the counter instance to which the context metadata is to be associated.
* @param[in] length The number of elements in context metadata array.
* @param[in] metadata The context metadata itself.
*/
void ITTAPI __itt_bind_context_metadata_to_counter(__itt_counter counter, size_t length, __itt_context_metadata* metadata);
/** @cond exclude_from_documentation */
#ifndef INTEL_NO_MACRO_BODY
#ifndef INTEL_NO_ITTNOTIFY_API
ITT_STUBV(ITTAPI, void, bind_context_metadata_to_counter, (__itt_counter counter, size_t length, __itt_context_metadata* metadata))
#define __itt_bind_context_metadata_to_counter ITTNOTIFY_VOID(bind_context_metadata_to_counter)
#define __itt_bind_context_metadata_to_counter_ptr ITTNOTIFY_NAME(bind_context_metadata_to_counter)
#else /* INTEL_NO_ITTNOTIFY_API */
#define __itt_bind_context_metadata_to_counter(counter, length, metadata)
#define __itt_bind_context_metadata_to_counter_ptr 0
#endif /* INTEL_NO_ITTNOTIFY_API */
#else /* INTEL_NO_MACRO_BODY */
#define __itt_bind_context_metadata_to_counter_ptr 0
#endif /* INTEL_NO_MACRO_BODY */
/** @endcond */
#ifdef __cplusplus
}
@@ -4005,7 +4547,7 @@ ITT_STUB(ITTAPI, __itt_caller, stack_caller_create, (void))
/** @endcond */
/**
* @brief Destroy the inforamtion about stitch point identified by the pointer previously returned by __itt_stack_caller_create()
* @brief Destroy the information about stitch point identified by the pointer previously returned by __itt_stack_caller_create()
*/
void ITTAPI __itt_stack_caller_destroy(__itt_caller id);
+23 -75
View File
@@ -1,60 +1,8 @@
/* <copyright>
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
/*
Copyright (C) 2005-2019 Intel Corporation
GPL LICENSE SUMMARY
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution
in the file called LICENSE.GPL.
Contact Information:
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
BSD LICENSE
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</copyright> */
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
*/
#ifndef __JITPROFILING_H__
#define __JITPROFILING_H__
@@ -66,7 +14,7 @@
* generated code that can be used by performance tools. The user inserts
* calls in the code generator to report information before JIT-compiled
* code goes to execution. This information is collected at runtime and used
* by tools like Intel(R) VTune(TM) Amplifier to display performance metrics
* by tools like Intel(R) VTune(TM) Profiler to display performance metrics
* associated with JIT-compiled code.
*
* These APIs can be used to\n
@@ -97,16 +45,16 @@
* * Expected behavior:
* * If any iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED event overwrites an
* already reported method, then such a method becomes invalid and its
* memory region is treated as unloaded. VTune Amplifier displays the metrics
* memory region is treated as unloaded. VTune Profiler displays the metrics
* collected by the method until it is overwritten.
* * If supplied line number information contains multiple source lines for
* the same assembly instruction (code location), then VTune Amplifier picks up
* the same assembly instruction (code location), then VTune Profiler picks up
* the first line number.
* * Dynamically generated code can be associated with a module name.
* Use the iJIT_Method_Load_V2 structure.\n
* Clarification of some cases:
* * If you register a function with the same method ID multiple times,
* specifying different module names, then the VTune Amplifier picks up
* specifying different module names, then the VTune Profiler picks up
* the module name registered first. If you want to distinguish the same
* function between different JIT engines, supply different method IDs for
* each function. Other symbolic information (for example, source file)
@@ -143,18 +91,18 @@
* belonging to the same method. Symbolic information (method name,
* source file name) will be taken from the first notification, and all
* subsequent notifications with the same method ID will be processed
* only for line number table information. So, the VTune Amplifier will map
* only for line number table information. So, the VTune Profiler will map
* samples to a source line using the line number table from the current
* notification while taking the source file name from the very first one.\n
* Clarification of some cases:\n
* * If you register a second code region with a different source file
* name and the same method ID, then this information will be saved and
* will not be considered as an extension of the first code region, but
* VTune Amplifier will use the source file of the first code region and map
* VTune Profiler will use the source file of the first code region and map
* performance metrics incorrectly.
* * If you register a second code region with the same source file as
* for the first region and the same method ID, then the source file will be
* discarded but VTune Amplifier will map metrics to the source file correctly.
* discarded but VTune Profiler will map metrics to the source file correctly.
* * If you register a second code region with a null source file and
* the same method ID, then provided line number info will be associated
* with the source file of the first code region.
@@ -293,7 +241,7 @@ typedef enum _iJIT_IsProfilingActiveFlags
* @brief Description of a single entry in the line number information of a code region.
* @details A table of line number entries gives information about how the reported code region
* is mapped to source file.
* Intel(R) VTune(TM) Amplifier uses line number information to attribute
* Intel(R) VTune(TM) Profiler uses line number information to attribute
* the samples (virtual address) to a line number. \n
* It is acceptable to report different code addresses for the same source line:
* @code
@@ -304,7 +252,7 @@ typedef enum _iJIT_IsProfilingActiveFlags
* 18 1
* 21 30
*
* VTune Amplifier constructs the following table using the client data
* VTune Profiler constructs the following table using the client data
*
* Code subrange Line number
* 0-1 2
@@ -428,7 +376,7 @@ typedef struct _iJIT_Method_Load_V2
char* module_name; /**<\brief Module name. Can be NULL.
The module name can be useful for distinguishing among
different JIT engines. VTune Amplifier will display
different JIT engines. VTune Profiler will display
reported methods grouped by specific module. */
} *piJIT_Method_Load_V2, iJIT_Method_Load_V2;
@@ -480,7 +428,7 @@ typedef struct _iJIT_Method_Load_V3
char* module_name; /**<\brief Module name. Can be NULL.
* The module name can be useful for distinguishing among
* different JIT engines. VTune Amplifier will display
* different JIT engines. VTune Profiler will display
* reported methods grouped by specific module. */
iJIT_CodeArchitecture module_arch; /**<\brief Architecture of the method's code region.
@@ -490,9 +438,9 @@ typedef struct _iJIT_Method_Load_V3
* engine generates 64-bit code.
*
* If JIT engine reports both 32-bit and 64-bit types
* of methods then VTune Amplifier splits the methods
* of methods then VTune Profiler splits the methods
* with the same module name but with different
* architectures in two different modules. VTune Amplifier
* architectures in two different modules. VTune Profiler
* modifies the original name provided with a 64-bit method
* version by ending it with '(64)' */
@@ -561,9 +509,9 @@ typedef enum _iJIT_SegmentType
iJIT_CT_CODE, /**<\brief Executable code. */
iJIT_CT_DATA, /**<\brief Data (not executable code).
* VTune Amplifier uses the format string
* VTune Profiler uses the format string
* (see iJIT_Method_Update) to represent
* this data in the VTune Amplifier GUI */
* this data in the VTune Profiler GUI */
iJIT_CT_KEEP, /**<\brief Use the previous markup for the trace.
* Can be used for the following
@@ -580,11 +528,11 @@ typedef enum _iJIT_SegmentType
* structure to describe the update of the content within a JIT-compiled method,
* use iJVM_EVENT_TYPE_METHOD_UPDATE_V2 as an event type to report it.
*
* On the first Update event, VTune Amplifier copies the original code range reported by
* On the first Update event, VTune Profiler copies the original code range reported by
* the iJVM_EVENT_TYPE_METHOD_LOAD event, then modifies it with the supplied bytes and
* adds the modified range to the original method. For next update events, VTune Amplifier
* adds the modified range to the original method. For next update events, VTune Profiler
* does the same but it uses the latest modified version of a code region for update.
* Eventually, VTune Amplifier GUI displays multiple code ranges for the method reported by
* Eventually, VTune Profiler GUI displays multiple code ranges for the method reported by
* the iJVM_EVENT_TYPE_METHOD_LOAD event.
* Notes:
* - Multiple update events with different types for the same trace are allowed
@@ -673,7 +621,7 @@ iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive(void);
* @brief Reports infomation about JIT-compiled code to the agent.
*
* The reported information is used to attribute samples obtained from any
* Intel(R) VTune(TM) Amplifier collector. This API needs to be called
* Intel(R) VTune(TM) Profiler collector. This API needs to be called
* after JIT compilation and before the first entry into the JIT-compiled
* code.
*
+39 -74
View File
@@ -1,60 +1,8 @@
/* <copyright>
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
/*
Copyright (C) 2005-2019 Intel Corporation
GPL LICENSE SUMMARY
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution
in the file called LICENSE.GPL.
Contact Information:
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
BSD LICENSE
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</copyright> */
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
*/
#ifndef _LEGACY_ITTNOTIFY_H_
#define _LEGACY_ITTNOTIFY_H_
@@ -80,6 +28,10 @@
# define ITT_OS_FREEBSD 4
#endif /* ITT_OS_FREEBSD */
#ifndef ITT_OS_OPENBSD
# define ITT_OS_OPENBSD 5
#endif /* ITT_OS_OPENBSD */
#ifndef ITT_OS
# if defined WIN32 || defined _WIN32
# define ITT_OS ITT_OS_WIN
@@ -87,6 +39,8 @@
# define ITT_OS ITT_OS_MAC
# elif defined( __FreeBSD__ )
# define ITT_OS ITT_OS_FREEBSD
# elif defined( __OpenBSD__ )
# define ITT_OS ITT_OS_OPENBSD
# else
# define ITT_OS ITT_OS_LINUX
# endif
@@ -108,6 +62,10 @@
# define ITT_PLATFORM_FREEBSD 4
#endif /* ITT_PLATFORM_FREEBSD */
#ifndef ITT_PLATFORM_OPENBSD
# define ITT_PLATFORM_OPENBSD 5
#endif /* ITT_PLATFORM_OPENBSD */
#ifndef ITT_PLATFORM
# if ITT_OS==ITT_OS_WIN
# define ITT_PLATFORM ITT_PLATFORM_WIN
@@ -115,6 +73,8 @@
# define ITT_PLATFORM ITT_PLATFORM_MAC
# elif ITT_OS==ITT_OS_FREEBSD
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
# elif ITT_OS==ITT_OS_OPENBSD
# define ITT_PLATFORM ITT_PLATFORM_OPENBSD
# else
# define ITT_PLATFORM ITT_PLATFORM_POSIX
# endif
@@ -167,7 +127,12 @@
#if ITT_PLATFORM==ITT_PLATFORM_WIN
/* use __forceinline (VC++ specific) */
#define ITT_INLINE __forceinline
#if defined(__MINGW32__) && !defined(__cplusplus)
#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__))
#else
#define ITT_INLINE static __forceinline
#endif /* __MINGW32__ */
#define ITT_INLINE_ATTRIBUTE /* nothing */
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/*
@@ -219,20 +184,20 @@
#define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)
#define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)
#define ITTNOTIFY_VOID_D0(n,d) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
#define ITTNOTIFY_VOID_D1(n,d,x) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
#define ITTNOTIFY_VOID_D2(n,d,x,y) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
#define ITTNOTIFY_DATA_D0(n,d) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
#define ITTNOTIFY_DATA_D1(n,d,x) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
#define ITTNOTIFY_DATA_D2(n,d,x,y) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
#define ITTNOTIFY_VOID_D0(n,d) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
#define ITTNOTIFY_VOID_D1(n,d,x) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
#define ITTNOTIFY_VOID_D2(n,d,x,y) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
#define ITTNOTIFY_DATA_D0(n,d) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
#define ITTNOTIFY_DATA_D1(n,d,x) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
#define ITTNOTIFY_DATA_D2(n,d,x,y) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
#ifdef ITT_STUB
#undef ITT_STUB
@@ -269,7 +234,7 @@ extern "C" {
* only pauses tracing and analyzing memory access.
* It does not pause tracing or analyzing threading APIs.
* .
* - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE:
* - Intel(R) VTune(TM) Profiler:
* - Does continue to record when new threads are started.
* .
* - Other effects:
@@ -1005,9 +970,9 @@ ITT_STUB(ITTAPI, __itt_frame, frame_create, (const char *domain))
#endif /* INTEL_NO_MACRO_BODY */
/** @endcond */
/** @brief Record an frame begin occurrence. */
/** @brief Record a frame begin occurrence. */
void ITTAPI __itt_frame_begin(__itt_frame frame);
/** @brief Record an frame end occurrence. */
/** @brief Record a frame end occurrence. */
void ITTAPI __itt_frame_end (__itt_frame frame);
/** @cond exclude_from_documentation */
+4 -56
View File
@@ -1,60 +1,8 @@
/* <copyright>
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
/*
Copyright (C) 2005-2019 Intel Corporation
GPL LICENSE SUMMARY
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution
in the file called LICENSE.GPL.
Contact Information:
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
BSD LICENSE
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</copyright> */
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
*/
#ifndef _LIBITTNOTIFY_H_
#define _LIBITTNOTIFY_H_
-241
View File
@@ -1,241 +0,0 @@
/* <copyright>
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
GPL LICENSE SUMMARY
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution
in the file called LICENSE.GPL.
Contact Information:
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
BSD LICENSE
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</copyright> */
/*
* This file implements an interface bridge from Low-Level Virtual Machine
* llvm::JITEventListener to Intel JIT Profiling API. It passes the function
* and line information to the appropriate functions in the JIT profiling
* interface so that any LLVM-based JIT engine can emit the JIT code
* notifications that the profiler will receive.
*
* Usage model:
*
* 1. Register the listener implementation instance with the execution engine:
*
* #include <llvm_jit_event_listener.hpp>
* ...
* ExecutionEngine *TheExecutionEngine;
* ...
* TheExecutionEngine = EngineBuilder(TheModule).create();
* ...
* __itt_llvm_jit_event_listener jitListener;
* TheExecutionEngine->RegisterJITEventListener(&jitListener);
* ...
*
* 2. When compiling make sure to add the ITT API include directory to the
* compiler include directories, ITT API library directory to the linker
* library directories and link with jitprofling static library.
*/
#ifndef __ITT_LLVM_JIT_EVENT_LISTENER_HPP__
#define __ITT_LLVM_JIT_EVENT_LISTENER_HPP__
#include "jitprofiling.h"
#include <llvm/Function.h>
#include <llvm/ExecutionEngine/JITEventListener.h>
#include <llvm/ADT/StringRef.h>
#include <llvm/Analysis/DebugInfo.h>
#include <map>
#include <cassert>
// Uncomment the line below to turn on logging to stderr
#define JITPROFILING_DEBUG_ENABLE
// Some elementary logging support
#ifdef JITPROFILING_DEBUG_ENABLE
#include <cstdio>
#include <cstdarg>
static void _jit_debug(const char* format, ...)
{
va_list args;
va_start(args, format);
vfprintf(stderr, format, args);
va_end(args);
}
// Use the macro as JITDEBUG(("foo: %d", foo_val));
#define JITDEBUG(x) \
do { \
_jit_debug("jit-listener: "); \
_jit_debug x; \
} \
while (0)
#else
#define JITDEBUG(x)
#endif
// LLVM JIT event listener, translates the notifications to the JIT profiling
// API information.
class __itt_llvm_jit_event_listener : public llvm::JITEventListener
{
public:
__itt_llvm_jit_event_listener() {}
public:
virtual void NotifyFunctionEmitted(const llvm::Function &F,
void *Code, size_t Size, const EmittedFunctionDetails &Details)
{
std::string name = F.getName().str();
JITDEBUG(("function jitted:\n"));
JITDEBUG((" addr=0x%08x\n", (int)Code));
JITDEBUG((" name=`%s'\n", name.c_str()));
JITDEBUG((" code-size=%d\n", (int)Size));
JITDEBUG((" line-infos-count=%d\n", Details.LineStarts.size()));
// The method must not be in the map - the entry must have been cleared
// from the map in NotifyFreeingMachineCode in case of rejitting.
assert(m_addr2MethodId.find(Code) == m_addr2MethodId.end());
int mid = iJIT_GetNewMethodID();
m_addr2MethodId[Code] = mid;
iJIT_Method_Load mload;
memset(&mload, 0, sizeof mload);
mload.method_id = mid;
// Populate the method size and name information
// TODO: The JIT profiling API should have members as const char pointers.
mload.method_name = (char*)name.c_str();
mload.method_load_address = Code;
mload.method_size = (unsigned int)Size;
// Populate line information now.
// From the JIT API documentation it is not quite clear whether the
// line information can be given in ranges, so we'll populate it for
// every byte of the function, hmm.
std::string srcFilePath;
std::vector<LineNumberInfo> lineInfos;
char *addr = (char*)Code;
char *lineAddr = addr; // Exclusive end point at which current
// line info changes.
const llvm::DebugLoc* loc = 0; // Current line info
int lineIndex = -1; // Current index into the line info table
for (int i = 0; i < Size; ++i, ++addr) {
while (addr >= lineAddr) {
if (lineIndex >= 0 && lineIndex < Details.LineStarts.size()) {
loc = &Details.LineStarts[lineIndex].Loc;
std::string p = getSrcFilePath(F.getContext(), *loc);
assert(srcFilePath.empty() || p == srcFilePath);
srcFilePath = p;
} else {
loc = NULL;
}
lineIndex++;
if (lineIndex >= 0 && lineIndex < Details.LineStarts.size()) {
lineAddr = (char*)Details.LineStarts[lineIndex].Address;
} else {
lineAddr = addr + Size;
}
}
if (loc) {
int line = loc->getLine();
LineNumberInfo info = { i, line };
lineInfos.push_back(info);
JITDEBUG((" addr 0x%08x -> line %d\n", addr, line));
}
}
if (!lineInfos.empty()) {
mload.line_number_size = lineInfos.size();
JITDEBUG((" translated to %d line infos to JIT", (int)lineInfos.size()));
mload.line_number_table = &lineInfos[0];
mload.source_file_name = (char*)srcFilePath.c_str();
}
iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, &mload);
}
virtual void NotifyFreeingMachineCode(void *OldPtr)
{
JITDEBUG(("function unjitted\n"));
JITDEBUG((" addr=0x%08x\n", (int)OldPtr));
Addr2MethodId::iterator it = m_addr2MethodId.find(OldPtr);
assert(it != m_addr2MethodId.end());
iJIT_Method_Id mid = { it->second };
iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_UNLOAD_START, &mid);
m_addr2MethodId.erase(it);
}
private:
std::string getSrcFilePath(const llvm::LLVMContext& ctx, const llvm::DebugLoc& loc)
{
llvm::MDNode* node = loc.getAsMDNode(ctx);
llvm::DILocation srcLoc(node);
return srcLoc.getDirectory().str() + "/" + srcLoc.getFilename().str();
}
private:
/// Don't copy
__itt_llvm_jit_event_listener(const __itt_llvm_jit_event_listener&);
__itt_llvm_jit_event_listener& operator=(const __itt_llvm_jit_event_listener&);
private:
typedef std::vector<LineNumberInfo> LineInfoList;
// The method unload notification in VTune JIT profiling API takes the
// method ID, not method address so have to maintain the mapping. Is
// there a more efficient and simple way to do this like attaching the
// method ID information somehow to the LLVM function instance?
//
// TODO: It would be more convenient for the JIT API to take the method
// address, not method ID.
typedef std::map<const void*, int> Addr2MethodId;
Addr2MethodId m_addr2MethodId;
};
#endif // Header guard
@@ -1,7 +1,8 @@
Copyright (c) 2011, Intel Corporation
All rights reserved.
Copyright (c) 2019 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
• Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
• Neither the name of the Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,65 +1,103 @@
The GNU General Public License (GPL)
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
One line to give the program's name and a brief idea of what it does.
Copyright (C) <year> <name of author>
<one line to give the program's name and an idea of what it does.>
Copyright (C) < yyyy> <name of author>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
signature of Ty Coon, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
<signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
+8 -56
View File
@@ -1,71 +1,23 @@
/* <copyright>
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
/*
Copyright (C) 2005-2019 Intel Corporation
GPL LICENSE SUMMARY
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution
in the file called LICENSE.GPL.
Contact Information:
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
BSD LICENSE
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</copyright> */
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
*/
#include "ittnotify_config.h"
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#if defined _MSC_VER
#pragma warning (disable: 593) /* parameter "XXXX" was set but never used */
#pragma warning (disable: 344) /* typedef name has already been declared (with same type) */
#pragma warning (disable: 174) /* expression has no effect */
#pragma warning (disable: 4127) /* conditional expression is constant */
#pragma warning (disable: 4306) /* conversion from '?' to '?' of greater size */
#endif
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#if defined __INTEL_COMPILER
+197 -80
View File
@@ -1,60 +1,8 @@
/* <copyright>
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
/*
Copyright (C) 2005-2019 Intel Corporation
GPL LICENSE SUMMARY
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution
in the file called LICENSE.GPL.
Contact Information:
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
BSD LICENSE
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</copyright> */
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
*/
#ifndef _ITTNOTIFY_CONFIG_H_
#define _ITTNOTIFY_CONFIG_H_
@@ -75,6 +23,10 @@
# define ITT_OS_FREEBSD 4
#endif /* ITT_OS_FREEBSD */
#ifndef ITT_OS_OPENBSD
# define ITT_OS_OPENBSD 5
#endif /* ITT_OS_OPENBSD */
#ifndef ITT_OS
# if defined WIN32 || defined _WIN32
# define ITT_OS ITT_OS_WIN
@@ -82,6 +34,8 @@
# define ITT_OS ITT_OS_MAC
# elif defined( __FreeBSD__ )
# define ITT_OS ITT_OS_FREEBSD
# elif defined( __OpenBSD__ )
# define ITT_OS ITT_OS_OPENBSD
# else
# define ITT_OS ITT_OS_LINUX
# endif
@@ -103,6 +57,10 @@
# define ITT_PLATFORM_FREEBSD 4
#endif /* ITT_PLATFORM_FREEBSD */
#ifndef ITT_PLATFORM_OPENBSD
# define ITT_PLATFORM_OPENBSD 5
#endif /* ITT_PLATFORM_OPENBSD */
#ifndef ITT_PLATFORM
# if ITT_OS==ITT_OS_WIN
# define ITT_PLATFORM ITT_PLATFORM_WIN
@@ -110,6 +68,8 @@
# define ITT_PLATFORM ITT_PLATFORM_MAC
# elif ITT_OS==ITT_OS_FREEBSD
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
# elif ITT_OS==ITT_OS_OPENBSD
# define ITT_PLATFORM ITT_PLATFORM_OPENBSD
# else
# define ITT_PLATFORM ITT_PLATFORM_POSIX
# endif
@@ -162,7 +122,12 @@
#if ITT_PLATFORM==ITT_PLATFORM_WIN
/* use __forceinline (VC++ specific) */
#define ITT_INLINE __forceinline
#if defined(__MINGW32__) && !defined(__cplusplus)
#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__))
#else
#define ITT_INLINE static __forceinline
#endif /* __MINGW32__ */
#define ITT_INLINE_ATTRIBUTE /* nothing */
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/*
@@ -188,6 +153,10 @@
# define ITT_ARCH_IA32E 2
#endif /* ITT_ARCH_IA32E */
#ifndef ITT_ARCH_IA64
# define ITT_ARCH_IA64 3
#endif /* ITT_ARCH_IA64 */
#ifndef ITT_ARCH_ARM
# define ITT_ARCH_ARM 4
#endif /* ITT_ARCH_ARM */
@@ -196,9 +165,9 @@
# define ITT_ARCH_PPC64 5
#endif /* ITT_ARCH_PPC64 */
#ifndef ITT_ARCH_AARCH64 /* 64-bit ARM */
# define ITT_ARCH_AARCH64 6
#endif /* ITT_ARCH_AARCH64 */
#ifndef ITT_ARCH_ARM64
# define ITT_ARCH_ARM64 6
#endif /* ITT_ARCH_ARM64 */
#ifndef ITT_ARCH
# if defined _M_IX86 || defined __i386__
@@ -210,7 +179,7 @@
# elif defined _M_ARM || defined __arm__
# define ITT_ARCH ITT_ARCH_ARM
# elif defined __aarch64__
# define ITT_ARCH ITT_ARCH_AARCH64
# define ITT_ARCH ITT_ARCH_ARM64
# elif defined __powerpc64__
# define ITT_ARCH ITT_ARCH_PPC64
# endif
@@ -239,10 +208,10 @@
#define ITT_MAGIC { 0xED, 0xAB, 0xAB, 0xEC, 0x0D, 0xEE, 0xDA, 0x30 }
/* Replace with snapshot date YYYYMMDD for promotion build. */
#define API_VERSION_BUILD 20151119
#define API_VERSION_BUILD 20250113
#ifndef API_VERSION_NUM
#define API_VERSION_NUM 0.0.0
#define API_VERSION_NUM 3.25.4
#endif /* API_VERSION_NUM */
#define API_VERSION "ITT-API-Version " ITT_TO_STR(API_VERSION_NUM) \
@@ -254,7 +223,11 @@
typedef HMODULE lib_t;
typedef DWORD TIDT;
typedef CRITICAL_SECTION mutex_t;
#ifdef __cplusplus
#define MUTEX_INITIALIZER {}
#else
#define MUTEX_INITIALIZER { 0 }
#endif
#define strong_alias(name, aliasname) /* empty for Windows */
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#include <dlfcn.h>
@@ -282,13 +255,13 @@ typedef pthread_mutex_t mutex_t;
#define __itt_mutex_init(mutex) InitializeCriticalSection(mutex)
#define __itt_mutex_lock(mutex) EnterCriticalSection(mutex)
#define __itt_mutex_unlock(mutex) LeaveCriticalSection(mutex)
#define __itt_mutex_destroy(mutex) DeleteCriticalSection(mutex)
#define __itt_load_lib(name) LoadLibraryA(name)
#define __itt_unload_lib(handle) FreeLibrary(handle)
#define __itt_system_error() (int)GetLastError()
#define __itt_fstrcmp(s1, s2) lstrcmpA(s1, s2)
#define __itt_fstrnlen(s, l) strnlen_s(s, l)
#define __itt_fstrcpyn(s1, b, s2, l) strncpy_s(s1, b, s2, l)
#define __itt_fstrdup(s) _strdup(s)
#define __itt_thread_id() GetCurrentThreadId()
#define __itt_thread_yield() SwitchToThread()
#ifndef ITT_SIMPLE_INIT
@@ -298,6 +271,13 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
{
return InterlockedIncrement(ptr);
}
ITT_INLINE long
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand) ITT_INLINE_ATTRIBUTE;
ITT_INLINE long
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand)
{
return InterlockedCompareExchange(ptr, exchange, comperand);
}
#endif /* ITT_SIMPLE_INIT */
#define DL_SYMBOLS (1)
@@ -327,6 +307,7 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
}
#define __itt_mutex_lock(mutex) pthread_mutex_lock(mutex)
#define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
#define __itt_mutex_destroy(mutex) pthread_mutex_destroy(mutex)
#define __itt_load_lib(name) dlopen(name, RTLD_LAZY)
#define __itt_unload_lib(handle) dlclose(handle)
#define __itt_system_error() errno
@@ -341,10 +322,18 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
#ifdef SDL_STRNCPY_S
#define __itt_fstrcpyn(s1, b, s2, l) SDL_STRNCPY_S(s1, b, s2, l)
#else
#define __itt_fstrcpyn(s1, b, s2, l) strncpy(s1, s2, b)
#define __itt_fstrcpyn(s1, b, s2, l) { \
if (b > 0) { \
/* 'volatile' is used to suppress the warning that a destination */ \
/* bound depends on the length of the source. */ \
volatile size_t num_to_copy = (size_t)(b - 1) < (size_t)(l) ? \
(size_t)(b - 1) : (size_t)(l); \
strncpy(s1, s2, num_to_copy); \
s1[num_to_copy] = 0; \
} \
}
#endif /* SDL_STRNCPY_S */
#define __itt_fstrdup(s) strdup(s)
#define __itt_thread_id() pthread_self()
#define __itt_thread_yield() sched_yield()
#if ITT_ARCH==ITT_ARCH_IA64
@@ -360,12 +349,12 @@ ITT_INLINE long __TBB_machine_fetchadd4(volatile void* ptr, long addend)
{
long result;
__asm__ __volatile__("lock\nxadd %0,%1"
: "=r"(result),"=m"(*(int*)ptr)
: "0"(addend), "m"(*(int*)ptr)
: "=r"(result),"=m"(*(volatile int*)ptr)
: "0"(addend), "m"(*(volatile int*)ptr)
: "memory");
return result;
}
#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_AARCH64 || ITT_ARCH==ITT_ARCH_PPC64
#else
#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
#endif /* ITT_ARCH==ITT_ARCH_IA64 */
#ifndef ITT_SIMPLE_INIT
@@ -375,6 +364,13 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
{
return __TBB_machine_fetchadd4(ptr, 1) + 1L;
}
ITT_INLINE long
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand) ITT_INLINE_ATTRIBUTE;
ITT_INLINE long
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand)
{
return __sync_val_compare_and_swap(ptr, exchange, comperand);
}
#endif /* ITT_SIMPLE_INIT */
void* dlopen(const char*, int) __attribute__((weak));
@@ -394,10 +390,20 @@ pthread_t pthread_self(void) __attribute__((weak));
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
typedef enum {
__itt_collection_normal = 0,
__itt_collection_paused = 1
} __itt_collection_state;
/* strdup() is not included into C99 which results in a compiler warning about
* implicitly declared symbol. To avoid the issue strdup is implemented
* manually.
*/
#define ITT_STRDUP_MAX_STRING_SIZE 4096
#define __itt_fstrdup(s, new_s) do { \
if (s != NULL) { \
size_t s_len = __itt_fstrnlen(s, ITT_STRDUP_MAX_STRING_SIZE); \
new_s = (char *)malloc(s_len + 1); \
if (new_s != NULL) { \
__itt_fstrcpyn(new_s, s_len + 1, s, s_len); \
} \
} \
} while(0)
typedef enum {
__itt_thread_normal = 0,
@@ -463,6 +469,10 @@ typedef struct __itt_counter_info
struct ___itt_domain;
struct ___itt_string_handle;
struct ___itt_histogram;
struct ___itt_counter_metadata;
#include "ittnotify.h"
typedef struct ___itt_global
{
@@ -484,7 +494,10 @@ typedef struct ___itt_global
struct ___itt_domain* domain_list;
struct ___itt_string_handle* string_list;
__itt_collection_state state;
__itt_counter_info_t* counter_list;
__itt_counter_info_t* counter_list;
unsigned int ipt_collect_events;
struct ___itt_histogram* histogram_list;
struct ___itt_counter_metadata* counter_metadata_list;
} __itt_global;
#pragma pack(pop)
@@ -510,7 +523,9 @@ typedef struct ___itt_global
h = (__itt_thread_info*)malloc(sizeof(__itt_thread_info)); \
if (h != NULL) { \
h->tid = t; \
h->nameA = n ? __itt_fstrdup(n) : NULL; \
char *n_copy = NULL; \
__itt_fstrdup(n, n_copy); \
h->nameA = n_copy; \
h->nameW = NULL; \
h->state = s; \
h->extra1 = 0; /* reserved */ \
@@ -543,7 +558,9 @@ typedef struct ___itt_global
h = (__itt_domain*)malloc(sizeof(__itt_domain)); \
if (h != NULL) { \
h->flags = 1; /* domain is enabled by default */ \
h->nameA = name ? __itt_fstrdup(name) : NULL; \
char *name_copy = NULL; \
__itt_fstrdup(name, name_copy); \
h->nameA = name_copy; \
h->nameW = NULL; \
h->extra1 = 0; /* reserved */ \
h->extra2 = NULL; /* reserved */ \
@@ -573,7 +590,9 @@ typedef struct ___itt_global
#define NEW_STRING_HANDLE_A(gptr,h,h_tail,name) { \
h = (__itt_string_handle*)malloc(sizeof(__itt_string_handle)); \
if (h != NULL) { \
h->strA = name ? __itt_fstrdup(name) : NULL; \
char *name_copy = NULL; \
__itt_fstrdup(name, name_copy); \
h->strA = name_copy; \
h->strW = NULL; \
h->extra1 = 0; /* reserved */ \
h->extra2 = NULL; /* reserved */ \
@@ -591,7 +610,7 @@ typedef struct ___itt_global
h->nameA = NULL; \
h->nameW = name ? _wcsdup(name) : NULL; \
h->domainA = NULL; \
h->domainW = name ? _wcsdup(domain) : NULL; \
h->domainW = domain ? _wcsdup(domain) : NULL; \
h->type = type; \
h->index = 0; \
h->next = NULL; \
@@ -605,9 +624,13 @@ typedef struct ___itt_global
#define NEW_COUNTER_A(gptr,h,h_tail,name,domain,type) { \
h = (__itt_counter_info_t*)malloc(sizeof(__itt_counter_info_t)); \
if (h != NULL) { \
h->nameA = name ? __itt_fstrdup(name) : NULL; \
char *name_copy = NULL; \
__itt_fstrdup(name, name_copy); \
h->nameA = name_copy; \
h->nameW = NULL; \
h->domainA = domain ? __itt_fstrdup(domain) : NULL; \
char *domain_copy = NULL; \
__itt_fstrdup(domain, domain_copy); \
h->domainA = domain_copy; \
h->domainW = NULL; \
h->type = type; \
h->index = 0; \
@@ -619,4 +642,98 @@ typedef struct ___itt_global
} \
}
#define NEW_HISTOGRAM_W(gptr,h,h_tail,domain,name,x_type,y_type) { \
h = (__itt_histogram*)malloc(sizeof(__itt_histogram)); \
if (h != NULL) { \
h->domain = domain; \
h->nameA = NULL; \
h->nameW = name ? _wcsdup(name) : NULL; \
h->x_type = x_type; \
h->y_type = y_type; \
h->extra1 = 0; \
h->extra2 = NULL; \
h->next = NULL; \
if (h_tail == NULL) \
(gptr)->histogram_list = h; \
else \
h_tail->next = h; \
} \
}
#define NEW_HISTOGRAM_A(gptr,h,h_tail,domain,name,x_type,y_type) { \
h = (__itt_histogram*)malloc(sizeof(__itt_histogram)); \
if (h != NULL) { \
h->domain = domain; \
char *name_copy = NULL; \
__itt_fstrdup(name, name_copy); \
h->nameA = name_copy; \
h->nameW = NULL; \
h->x_type = x_type; \
h->y_type = y_type; \
h->extra1 = 0; \
h->extra2 = NULL; \
h->next = NULL; \
if (h_tail == NULL) \
(gptr)->histogram_list = h; \
else \
h_tail->next = h; \
} \
}
#define NEW_COUNTER_METADATA_NUM(gptr,h,h_tail,counter,type,value) { \
h = (__itt_counter_metadata*)malloc(sizeof(__itt_counter_metadata)); \
if (h != NULL) { \
h->counter = counter; \
h->type = type; \
h->str_valueA = NULL; \
h->str_valueW = NULL; \
h->value = value; \
h->extra1 = 0; \
h->extra2 = NULL; \
h->next = NULL; \
if (h_tail == NULL) \
(gptr)->counter_metadata_list = h; \
else \
h_tail->next = h; \
} \
}
#define NEW_COUNTER_METADATA_STR_A(gptr,h,h_tail,counter,type,str_valueA) { \
h = (__itt_counter_metadata*)malloc(sizeof(__itt_counter_metadata)); \
if (h != NULL) { \
h->counter = counter; \
h->type = type; \
char *str_value_copy = NULL; \
__itt_fstrdup(str_valueA, str_value_copy); \
h->str_valueA = str_value_copy; \
h->str_valueW = NULL; \
h->value = 0; \
h->extra1 = 0; \
h->extra2 = NULL; \
h->next = NULL; \
if (h_tail == NULL) \
(gptr)->counter_metadata_list = h; \
else \
h_tail->next = h; \
} \
}
#define NEW_COUNTER_METADATA_STR_W(gptr,h,h_tail,counter,type,str_valueW) { \
h = (__itt_counter_metadata*)malloc(sizeof(__itt_counter_metadata)); \
if (h != NULL) { \
h->counter = counter; \
h->type = type; \
h->str_valueA = NULL; \
h->str_valueW = str_valueW ? _wcsdup(str_valueW) : NULL; \
h->value = 0; \
h->extra1 = 0; \
h->extra2 = NULL; \
h->next = NULL; \
if (h_tail == NULL) \
(gptr)->counter_metadata_list = h; \
else \
h_tail->next = h; \
} \
}
#endif /* _ITTNOTIFY_CONFIG_H_ */
File diff suppressed because it is too large Load Diff
+40 -61
View File
@@ -1,60 +1,8 @@
/* <copyright>
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
/*
Copyright (C) 2005-2019 Intel Corporation
GPL LICENSE SUMMARY
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution
in the file called LICENSE.GPL.
Contact Information:
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
BSD LICENSE
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</copyright> */
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
*/
#include "ittnotify_config.h"
@@ -81,6 +29,9 @@ ITT_STUB(ITTAPI, __itt_domain*, domain_createW, (const wchar_t *name), (ITT_FORM
ITT_STUB(ITTAPI, __itt_domain*, domain_create, (const char *name), (ITT_FORMAT name), domain_create, __itt_group_structure, "\"%s\"")
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
ITT_STUBV(ITTAPI, void, module_load_with_sections, (__itt_module_object* module_obj), (ITT_FORMAT module_obj), module_load_with_sections, __itt_group_module, "%p")
ITT_STUBV(ITTAPI, void, module_unload_with_sections, (__itt_module_object* module_obj), (ITT_FORMAT module_obj), module_unload_with_sections, __itt_group_module, "%p")
#if ITT_PLATFORM==ITT_PLATFORM_WIN
ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createA, (const char *name), (ITT_FORMAT name), string_handle_createA, __itt_group_structure, "\"%s\"")
ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createW, (const wchar_t *name), (ITT_FORMAT name), string_handle_createW, __itt_group_structure, "\"%S\"")
@@ -105,6 +56,8 @@ ITT_STUB(ITTAPI, __itt_counter, counter_create_typed, (const char *name, con
ITT_STUBV(ITTAPI, void, pause, (void), (ITT_NO_PARAMS), pause, __itt_group_control | __itt_group_legacy, "no args")
ITT_STUBV(ITTAPI, void, resume, (void), (ITT_NO_PARAMS), resume, __itt_group_control | __itt_group_legacy, "no args")
ITT_STUBV(ITTAPI, void, pause_scoped, (__itt_collection_scope scope), (ITT_FORMAT scope), pause_scoped, __itt_group_control, "%d")
ITT_STUBV(ITTAPI, void, resume_scoped, (__itt_collection_scope scope), (ITT_FORMAT scope), resume_scoped, __itt_group_control, "%d")
#if ITT_PLATFORM==ITT_PLATFORM_WIN
ITT_STUBV(ITTAPI, void, thread_set_nameA, (const char *name), (ITT_FORMAT name), thread_set_nameA, __itt_group_thread, "\"%s\"")
@@ -121,6 +74,23 @@ ITT_STUB(LIBITTAPI, int, thr_name_setW, (const wchar_t *name, int namelen), (IT
ITT_STUB(LIBITTAPI, int, thr_name_set, (const char *name, int namelen), (ITT_FORMAT name, namelen), thr_name_set, __itt_group_thread | __itt_group_legacy, "\"%s\", %d")
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
ITT_STUBV(LIBITTAPI, void, thr_ignore, (void), (ITT_NO_PARAMS), thr_ignore, __itt_group_thread | __itt_group_legacy, "no args")
#if ITT_PLATFORM==ITT_PLATFORM_WIN
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createA, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_createA, __itt_group_structure, "%p, \"%s\", %d, %d")
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createW, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_createW, __itt_group_structure, "%p, \"%s\", %d, %d")
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
ITT_STUB(ITTAPI, __itt_histogram*, histogram_create, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_create, __itt_group_structure, "%p, \"%s\", %d, %d")
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
ITT_STUB(ITTAPI, __itt_counter, counter_createA_v3, (const __itt_domain* domain, const char *name, __itt_metadata_type type), (ITT_FORMAT domain, name, type), counter_createA_v3, __itt_group_counter, "%p, \"%s\", %d")
ITT_STUB(ITTAPI, __itt_counter, counter_createW_v3, (const __itt_domain* domain, const wchar_t *name, __itt_metadata_type type), (ITT_FORMAT domain, name, type), counter_createW_v3, __itt_group_counter, "%p, \"%s\", %d")
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
ITT_STUB(ITTAPI, __itt_counter, counter_create_v3, (const __itt_domain* domain, const char *name, __itt_metadata_type type), (ITT_FORMAT domain, name, type), counter_create_v3, __itt_group_counter, "%p, \"%s\", %d")
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
ITT_STUBV(ITTAPI, void, bind_context_metadata_to_counter, (__itt_counter counter, size_t length, __itt_context_metadata* metadata), (ITT_FORMAT counter, length, metadata), bind_context_metadata_to_counter, __itt_group_structure, "%p, %lu, %p")
#endif /* __ITT_INTERNAL_BODY */
ITT_STUBV(ITTAPI, void, enable_attach, (void), (ITT_NO_PARAMS), enable_attach, __itt_group_all, "no args")
@@ -296,6 +266,13 @@ ITT_STUB(ITTAPI, __itt_frame, frame_createW, (const wchar_t *domain), (ITT_FORMA
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
ITT_STUB(ITTAPI, __itt_frame, frame_create, (const char *domain), (ITT_FORMAT domain), frame_create, __itt_group_frame, "\"%s\"")
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createA, (const char *name), (ITT_FORMAT name), pt_region_createA, __itt_group_structure, "\"%s\"")
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createW, (const wchar_t *name), (ITT_FORMAT name), pt_region_createW, __itt_group_structure, "\"%S\"")
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_create, (const char *name), (ITT_FORMAT name), pt_region_create, __itt_group_structure, "\"%s\"")
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#endif /* __ITT_INTERNAL_BODY */
ITT_STUBV(ITTAPI, void, frame_begin, (__itt_frame frame), (ITT_FORMAT frame), frame_begin, __itt_group_frame, "%p")
ITT_STUBV(ITTAPI, void, frame_end, (__itt_frame frame), (ITT_FORMAT frame), frame_end, __itt_group_frame, "%p")
@@ -376,14 +353,16 @@ ITT_STUB(ITTAPI, int, av_save, (void *data, int rank, const int *dimensions, in
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#endif /* __ITT_INTERNAL_BODY */
#ifndef __ITT_INTERNAL_BODY
#if ITT_PLATFORM==ITT_PLATFORM_WIN
ITT_STUBV(ITTAPI, void, module_loadA, (void *start_addr, void* end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_loadA, __itt_group_none, "%p, %p, %p")
ITT_STUBV(ITTAPI, void, module_loadW, (void *start_addr, void* end_addr, const wchar_t *path), (ITT_FORMAT start_addr, end_addr, path), module_loadW, __itt_group_none, "%p, %p, %p")
ITT_STUBV(ITTAPI, void, module_loadA, (void *start_addr, void* end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_loadA, __itt_group_module, "%p, %p, %p")
ITT_STUBV(ITTAPI, void, module_loadW, (void *start_addr, void* end_addr, const wchar_t *path), (ITT_FORMAT start_addr, end_addr, path), module_loadW, __itt_group_module, "%p, %p, %p")
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
ITT_STUBV(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_load, __itt_group_none, "%p, %p, %p")
ITT_STUBV(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_load, __itt_group_module, "%p, %p, %p")
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#endif /* __ITT_INTERNAL_BODY */
ITT_STUBV(ITTAPI, void, module_unload, (void *start_addr), (ITT_FORMAT start_addr), module_unload, __itt_group_module, "%p")
ITT_STUBV(ITTAPI, void, histogram_submit, (__itt_histogram* hist, size_t length, void* x_data, void* y_data), (ITT_FORMAT hist, length, x_data, y_data), histogram_submit, __itt_group_structure, "%p, %lu, %p, %p")
ITT_STUBV(ITTAPI, void, counter_set_value_v3, (__itt_counter counter, void *value_ptr), (ITT_FORMAT counter, value_ptr), counter_set_value_v3, __itt_group_counter, "%p, %p")
#endif /* __ITT_INTERNAL_INIT */
+25 -75
View File
@@ -1,85 +1,34 @@
/* <copyright>
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
/*
Copyright (C) 2005-2019 Intel Corporation
GPL LICENSE SUMMARY
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution
in the file called LICENSE.GPL.
Contact Information:
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
BSD LICENSE
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</copyright> */
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
*/
#ifndef _ITTNOTIFY_TYPES_H_
#define _ITTNOTIFY_TYPES_H_
typedef enum ___itt_group_id
{
__itt_group_none = 0,
__itt_group_legacy = 1<<0,
__itt_group_control = 1<<1,
__itt_group_thread = 1<<2,
__itt_group_mark = 1<<3,
__itt_group_sync = 1<<4,
__itt_group_fsync = 1<<5,
__itt_group_jit = 1<<6,
__itt_group_model = 1<<7,
__itt_group_splitter_min = 1<<7,
__itt_group_counter = 1<<8,
__itt_group_frame = 1<<9,
__itt_group_stitch = 1<<10,
__itt_group_heap = 1<<11,
__itt_group_splitter_max = 1<<12,
__itt_group_structure = 1<<12,
__itt_group_suppress = 1<<13,
__itt_group_arrays = 1<<14,
__itt_group_all = -1
__itt_group_none = 0,
__itt_group_legacy = 1<<0,
__itt_group_control = 1<<1,
__itt_group_thread = 1<<2,
__itt_group_mark = 1<<3,
__itt_group_sync = 1<<4,
__itt_group_fsync = 1<<5,
__itt_group_jit = 1<<6,
__itt_group_model = 1<<7,
__itt_group_splitter_min = 1<<7,
__itt_group_counter = 1<<8,
__itt_group_frame = 1<<9,
__itt_group_stitch = 1<<10,
__itt_group_heap = 1<<11,
__itt_group_splitter_max = 1<<12,
__itt_group_structure = 1<<12,
__itt_group_suppress = 1<<13,
__itt_group_arrays = 1<<14,
__itt_group_module = 1<<15,
__itt_group_all = -1
} __itt_group_id;
#pragma pack(push, 8)
@@ -109,6 +58,7 @@ typedef struct ___itt_group_list
{ __itt_group_structure, "structure" }, \
{ __itt_group_suppress, "suppress" }, \
{ __itt_group_arrays, "arrays" }, \
{ __itt_group_module, "module" }, \
{ __itt_group_none, NULL } \
}
+45 -95
View File
@@ -1,76 +1,24 @@
/* <copyright>
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
/*
Copyright (C) 2005-2019 Intel Corporation
GPL LICENSE SUMMARY
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution
in the file called LICENSE.GPL.
Contact Information:
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
BSD LICENSE
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</copyright> */
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
*/
#include "ittnotify_config.h"
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#include <windows.h>
#include <string.h>
#include <ctype.h>
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#if ITT_PLATFORM != ITT_PLATFORM_MAC && ITT_PLATFORM != ITT_PLATFORM_FREEBSD
#if ITT_PLATFORM != ITT_PLATFORM_MAC && ITT_PLATFORM != ITT_PLATFORM_FREEBSD && ITT_PLATFORM != ITT_PLATFORM_OPENBSD
#include <malloc.h>
#endif
#include <stdlib.h>
#include "jitprofiling.h"
static const char rcsid[] = "\n@(#) $Revision: 471937 $\n";
#define DLL_ENVIRONMENT_VAR "VS_PROFILER"
static const char rcsid[] = "\n@(#) $Revision$\n";
#ifndef NEW_DLL_ENVIRONMENT_VAR
#if ITT_ARCH==ITT_ARCH_IA32
@@ -81,13 +29,10 @@ static const char rcsid[] = "\n@(#) $Revision: 471937 $\n";
#endif /* NEW_DLL_ENVIRONMENT_VAR */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#define DEFAULT_DLLNAME "JitPI.dll"
HINSTANCE m_libHandle = NULL;
#elif ITT_PLATFORM==ITT_PLATFORM_MAC
#define DEFAULT_DLLNAME "libJitPI.dylib"
void* m_libHandle = NULL;
#else
#define DEFAULT_DLLNAME "libJitPI.so"
void* m_libHandle = NULL;
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
@@ -169,6 +114,38 @@ ITT_EXTERN_C iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive()
return executionMode;
}
#if ITT_PLATFORM == ITT_PLATFORM_WIN
static int isValidAbsolutePath(char *path, size_t maxPathLength)
{
if (path == NULL)
{
return 0;
}
size_t pathLength = strnlen(path, maxPathLength);
if (pathLength == maxPathLength)
{
/* The strnlen() function returns maxPathLength if there is no null terminating
* among the first maxPathLength characters in the string pointed to by path.
*/
return 0;
}
if (pathLength > 2)
{
if (isalpha(path[0]) && path[1] == ':' && path[2] == '\\')
{
return 1;
}
else if (path[0] == '\\' && path[1] == '\\')
{
return 1;
}
}
return 0;
}
#endif
/* This function loads the collector dll and the relevant functions.
* on success: all functions load, iJIT_DLL_is_missing = 0, return value = 1
* on failure: all functions are NULL, iJIT_DLL_is_missing = 1, return value = 0
@@ -212,7 +189,7 @@ static int loadiJIT_Funcs()
{
envret = GetEnvironmentVariableA(NEW_DLL_ENVIRONMENT_VAR,
dllName, dNameLength);
if (envret)
if (envret && isValidAbsolutePath(dllName, dNameLength))
{
/* Try to load the dll from the PATH... */
m_libHandle = LoadLibraryExA(dllName,
@@ -220,30 +197,9 @@ static int loadiJIT_Funcs()
}
free(dllName);
}
} else {
/* Try to use old VS_PROFILER variable */
dNameLength = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR, NULL, 0);
if (dNameLength)
{
DWORD envret = 0;
dllName = (char*)malloc(sizeof(char) * (dNameLength + 1));
if(dllName != NULL)
{
envret = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR,
dllName, dNameLength);
if (envret)
{
/* Try to load the dll from the PATH... */
m_libHandle = LoadLibraryA(dllName);
}
free(dllName);
}
}
}
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
dllName = getenv(NEW_DLL_ENVIRONMENT_VAR);
if (!dllName)
dllName = getenv(DLL_ENVIRONMENT_VAR);
#if defined(__ANDROID__) || defined(ANDROID)
if (!dllName)
dllName = ANDROID_JIT_AGENT_PATH;
@@ -251,19 +207,13 @@ static int loadiJIT_Funcs()
if (dllName)
{
/* Try to load the dll from the PATH... */
m_libHandle = dlopen(dllName, RTLD_LAZY);
if (DL_SYMBOLS)
{
m_libHandle = dlopen(dllName, RTLD_LAZY);
}
}
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
if (!m_libHandle)
{
#if ITT_PLATFORM==ITT_PLATFORM_WIN
m_libHandle = LoadLibraryA(DEFAULT_DLLNAME);
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
m_libHandle = dlopen(DEFAULT_DLLNAME, RTLD_LAZY);
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
}
/* if the dll wasn't loaded - exit. */
if (!m_libHandle)
{
-23
View File
@@ -1,23 +0,0 @@
project(kleidicv_hal)
set(KLEIDICV_SOURCE_PATH "" CACHE PATH "Directory containing KleidiCV sources")
ocv_update(KLEIDICV_SRC_COMMIT "0.1.0")
ocv_update(KLEIDICV_SRC_HASH "9388f28cf2fbe3338197b2b57d491468")
if(KLEIDICV_SOURCE_PATH)
set(THE_ROOT "${KLEIDICV_SOURCE_PATH}")
else()
ocv_download(FILENAME "kleidicv-${KLEIDICV_SRC_COMMIT}.tar.gz"
HASH ${KLEIDICV_SRC_HASH}
URL
"${OPENCV_KLEIDICV_URL}"
"$ENV{OPENCV_KLEIDICV_URL}"
"https://gitlab.arm.com/kleidi/kleidicv/-/archive/${KLEIDICV_SRC_COMMIT}/"
DESTINATION_DIR "${OpenCV_BINARY_DIR}/3rdparty/kleidicv/"
ID KLEIDICV
STATUS res
UNPACK RELATIVE_URL)
set(THE_ROOT "${OpenCV_BINARY_DIR}/3rdparty/kleidicv/kleidicv-${KLEIDICV_SRC_COMMIT}")
endif()
include("${THE_ROOT}/adapters/opencv/CMakeLists.txt")
+3 -3
View File
@@ -18,8 +18,8 @@ if(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)
ocv_warnings_disable(CMAKE_C_FLAGS -Wstringop-overflow)
endif()
set(VERSION 3.0.3)
set(COPYRIGHT_YEAR "1991-2024")
set(VERSION 3.1.2)
set(COPYRIGHT_YEAR "1991-2025")
string(REPLACE "." ";" VERSION_TRIPLET ${VERSION})
list(GET VERSION_TRIPLET 0 VERSION_MAJOR)
list(GET VERSION_TRIPLET 1 VERSION_MINOR)
@@ -203,7 +203,7 @@ check_type_size("size_t" SIZE_T)
check_type_size("unsigned long" UNSIGNED_LONG)
if(ENABLE_LIBJPEG_TURBO_SIMD)
add_subdirectory(src/simd)
add_subdirectory(simd)
if(NEON_INTRINSICS)
add_definitions(-DNEON_INTRINSICS)
endif()
+1 -1
View File
@@ -94,7 +94,7 @@ intended solely for clarification.
The Modified (3-clause) BSD License
===================================
Copyright (C)2009-2023 D. R. Commander. All Rights Reserved.<br>
Copyright (C)2009-2024 D. R. Commander. All Rights Reserved.<br>
Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
+14 -12
View File
@@ -36,16 +36,18 @@ TO DO Plans for future IJG releases.
Other documentation files in the distribution are:
User documentation:
usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
rdjpgcom, and wrjpgcom.
*.1 Unix-style man pages for programs (same info as usage.txt).
wizard.txt Advanced usage instructions for JPEG wizards only.
change.log Version-to-version change highlights.
doc/usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
rdjpgcom, and wrjpgcom.
doc/*.1 Unix-style man pages for programs (same info as
usage.txt).
doc/wizard.txt Advanced usage instructions for JPEG wizards only.
doc/change.log Version-to-version change highlights.
Programmer and internal documentation:
libjpeg.txt How to use the JPEG library in your own programs.
example.c Sample code for calling the JPEG library.
structure.txt Overview of the JPEG library's internal structure.
coderules.txt Coding style rules --- please read if you contribute code.
doc/libjpeg.txt How to use the JPEG library in your own programs.
src/example.c Sample code for calling the JPEG library.
doc/structure.txt Overview of the JPEG library's internal structure.
doc/coderules.txt Coding style rules --- please read if you contribute
code.
Please read at least usage.txt. Some information can also be found in the JPEG
FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find
@@ -89,9 +91,9 @@ The library is intended to be reused in other applications.
In order to support file conversion and viewing software, we have included
considerable functionality beyond the bare JPEG coding/decoding capability;
for example, the color quantization modules are not strictly part of JPEG
decoding, but they are essential for output to colormapped file formats or
colormapped displays. These extra functions can be compiled out of the
library if not required for a particular application.
decoding, but they are essential for output to colormapped file formats. These
extra functions can be compiled out of the library if not required for a
particular application.
We have also included "jpegtran", a utility for lossless transcoding between
different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
+13 -9
View File
@@ -69,9 +69,12 @@ JPEG images:
generating planar YUV images and performing multiple simultaneous lossless
transforms on an image. The Java interface for libjpeg-turbo is written on
top of the TurboJPEG API. The TurboJPEG API is recommended for first-time
users of libjpeg-turbo. Refer to [tjexample.c](tjexample.c) and
[TJExample.java](java/TJExample.java) for examples of its usage and to
<http://libjpeg-turbo.org/Documentation/Documentation> for API documentation.
users of libjpeg-turbo. Refer to [tjcomp.c](src/tjcomp.c),
[tjdecomp.c](src/tjdecomp.c), [tjtran.c](src/tjtran.c),
[TJComp.java](java/TJComp.java), [TJDecomp.java](java/TJDecomp.java), and
[TJTran.java](java/TJTran.java) for examples of its usage and to
<https://libjpeg-turbo.org/Documentation/Documentation> for API
documentation.
- **libjpeg API**<br>
This is the de facto industry-standard API for compressing and decompressing
@@ -79,8 +82,9 @@ JPEG images:
more powerful. The libjpeg API implementation in libjpeg-turbo is both
API/ABI-compatible and mathematically compatible with libjpeg v6b. It can
also optionally be configured to be API/ABI-compatible with libjpeg v7 and v8
(see below.) Refer to [cjpeg.c](cjpeg.c) and [djpeg.c](djpeg.c) for examples
of its usage and to [libjpeg.txt](libjpeg.txt) for API documentation.
(see below.) Refer to [cjpeg.c](src/cjpeg.c) and [djpeg.c](src/djpeg.c) for
examples of its usage and to [libjpeg.txt](doc/libjpeg.txt) for API
documentation.
There is no significant performance advantage to either API when both are used
to perform similar operations.
@@ -132,9 +136,9 @@ extensions at compile time with:
#ifdef JCS_ALPHA_EXTENSIONS
[jcstest.c](jcstest.c), located in the libjpeg-turbo source tree, demonstrates
how to check for the existence of the colorspace extensions at compile time and
run time.
[jcstest.c](src/jcstest.c), located in the libjpeg-turbo source tree,
demonstrates how to check for the existence of the colorspace extensions at
compile time and run time.
libjpeg v7 and v8 API/ABI Emulation
-----------------------------------
@@ -199,7 +203,7 @@ supported and which aren't.
NOTE: As of this writing, extensive research has been conducted into the
usefulness of DCT scaling as a means of data reduction and SmartScale as a
means of quality improvement. Readers are invited to peruse the research at
<http://www.libjpeg-turbo.org/About/SmartScale> and draw their own conclusions,
<https://libjpeg-turbo.org/About/SmartScale> and draw their own conclusions,
but it is the general belief of our project that these features have not
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
@@ -273,48 +273,33 @@ endif()
check_c_source_compiles("
#include <arm_neon.h>
int main(int argc, char **argv) {
int16_t input[] = {
(int16_t)argc, (int16_t)argc, (int16_t)argc, (int16_t)argc,
(int16_t)argc, (int16_t)argc, (int16_t)argc, (int16_t)argc,
(int16_t)argc, (int16_t)argc, (int16_t)argc, (int16_t)argc
};
int16x4x3_t output = vld1_s16_x3(input);
int16_t input[12];
int16x4x3_t output;
int i;
for (i = 0; i < 12; i++) input[i] = (int16_t)argc;
output = vld1_s16_x3(input);
vst3_s16(input, output);
return (int)input[0];
}" HAVE_VLD1_S16_X3)
check_c_source_compiles("
#include <arm_neon.h>
int main(int argc, char **argv) {
uint16_t input[] = {
(uint16_t)argc, (uint16_t)argc, (uint16_t)argc, (uint16_t)argc,
(uint16_t)argc, (uint16_t)argc, (uint16_t)argc, (uint16_t)argc
};
uint16x4x2_t output = vld1_u16_x2(input);
uint16_t input[8];
uint16x4x2_t output;
int i;
for (i = 0; i < 8; i++) input[i] = (uint16_t)argc;
output = vld1_u16_x2(input);
vst2_u16(input, output);
return (int)input[0];
}" HAVE_VLD1_U16_X2)
check_c_source_compiles("
#include <arm_neon.h>
int main(int argc, char **argv) {
uint8_t input[] = {
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc,
(uint8_t)argc, (uint8_t)argc, (uint8_t)argc, (uint8_t)argc
};
uint8x16x4_t output = vld1q_u8_x4(input);
uint8_t input[64];
uint8x16x4_t output;
int i;
for (i = 0; i < 64; i++) input[i] = (uint8_t)argc;
output = vld1q_u8_x4(input);
vst4q_u8(input, output);
return (int)input[0];
}" HAVE_VLD1Q_U8_X4)
@@ -369,7 +354,8 @@ if(NOT NEON_INTRINSICS)
separate_arguments(CMAKE_ASM_FLAGS_SEP UNIX_COMMAND "${CMAKE_ASM_FLAGS}")
execute_process(COMMAND ${CMAKE_ASM_COMPILER} ${CMAKE_ASM_FLAGS_SEP}
-x assembler-with-cpp -c ${CMAKE_CURRENT_BINARY_DIR}/gastest.S
RESULT_VARIABLE RESULT OUTPUT_VARIABLE OUTPUT ERROR_VARIABLE ERROR)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} RESULT_VARIABLE RESULT
OUTPUT_VARIABLE OUTPUT ERROR_VARIABLE ERROR)
if(NOT RESULT EQUAL 0)
message(WARNING "GAS appears to be broken. Using the full Neon SIMD intrinsics implementation.")
set(NEON_INTRINSICS 1 CACHE INTERNAL "" FORCE)
@@ -1,5 +1,5 @@
/*
* jccolext-neon.c - colorspace conversion (32-bit Arm Neon)
* Colorspace conversion (32-bit Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2020, D. R. Commander. All Rights Reserved.
@@ -1,7 +1,8 @@
/*
* jchuff-neon.c - Huffman entropy encoding (32-bit Arm Neon)
* Huffman entropy encoding (32-bit Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2024, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -24,11 +25,11 @@
*/
#define JPEG_INTERNALS
#include "../../../jinclude.h"
#include "../../../jpeglib.h"
#include "../../../jsimd.h"
#include "../../../jdct.h"
#include "../../../jsimddct.h"
#include "../../../src/jinclude.h"
#include "../../../src/jpeglib.h"
#include "../../../src/jsimd.h"
#include "../../../src/jdct.h"
#include "../../../src/jsimddct.h"
#include "../../jsimd.h"
#include "../jchuff.h"
#include "neon-compat.h"
@@ -1,9 +1,7 @@
/*
* jsimd_arm.c
*
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2011, Nokia Corporation and/or its subsidiary(-ies).
* Copyright (C) 2009-2011, 2013-2014, 2016, 2018, 2022, D. R. Commander.
* Copyright (C) 2009-2011, 2013-2014, 2016, 2018, 2022, 2024, D. R. Commander.
* Copyright (C) 2015-2016, 2018, 2022, Matthieu Darbois.
* Copyright (C) 2019, Google LLC.
* Copyright (C) 2020, Arm Limited.
@@ -18,11 +16,11 @@
*/
#define JPEG_INTERNALS
#include "../../../jinclude.h"
#include "../../../jpeglib.h"
#include "../../../jsimd.h"
#include "../../../jdct.h"
#include "../../../jsimddct.h"
#include "../../../src/jinclude.h"
#include "../../../src/jpeglib.h"
#include "../../../src/jsimd.h"
#include "../../../src/jdct.h"
#include "../../../src/jsimddct.h"
#include "../../jsimd.h"
#include <ctype.h>
@@ -1,5 +1,5 @@
/*
* jccolext-neon.c - colorspace conversion (64-bit Arm Neon)
* Colorspace conversion (64-bit Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
*
@@ -1,8 +1,8 @@
/*
* jchuff-neon.c - Huffman entropy encoding (64-bit Arm Neon)
* Huffman entropy encoding (64-bit Arm Neon)
*
* Copyright (C) 2020-2021, Arm Limited. All Rights Reserved.
* Copyright (C) 2020, 2022, D. R. Commander. All Rights Reserved.
* Copyright (C) 2020, 2022, 2024, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -25,11 +25,11 @@
*/
#define JPEG_INTERNALS
#include "../../../jinclude.h"
#include "../../../jpeglib.h"
#include "../../../jsimd.h"
#include "../../../jdct.h"
#include "../../../jsimddct.h"
#include "../../../src/jinclude.h"
#include "../../../src/jpeglib.h"
#include "../../../src/jsimd.h"
#include "../../../src/jdct.h"
#include "../../../src/jsimddct.h"
#include "../../jsimd.h"
#include "../align.h"
#include "../jchuff.h"
@@ -1,9 +1,8 @@
/*
* jsimd_arm64.c
*
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2011, Nokia Corporation and/or its subsidiary(-ies).
* Copyright (C) 2009-2011, 2013-2014, 2016, 2018, 2020, 2022, D. R. Commander.
* Copyright (C) 2009-2011, 2013-2014, 2016, 2018, 2020, 2022, 2024,
* D. R. Commander.
* Copyright (C) 2015-2016, 2018, 2022, Matthieu Darbois.
* Copyright (C) 2020, Arm Limited.
*
@@ -17,11 +16,11 @@
*/
#define JPEG_INTERNALS
#include "../../../jinclude.h"
#include "../../../jpeglib.h"
#include "../../../jsimd.h"
#include "../../../jdct.h"
#include "../../../jsimddct.h"
#include "../../../src/jinclude.h"
#include "../../../src/jpeglib.h"
#include "../../../src/jsimd.h"
#include "../../../src/jdct.h"
#include "../../../src/jsimddct.h"
#include "../../jsimd.h"
#include <ctype.h>
@@ -1,8 +1,8 @@
/*
* jccolor-neon.c - colorspace conversion (Arm Neon)
* Colorspace conversion (Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2020, D. R. Commander. All Rights Reserved.
* Copyright (C) 2020, 2024-2025, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -22,11 +22,11 @@
*/
#define JPEG_INTERNALS
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../../src/jinclude.h"
#include "../../src/jpeglib.h"
#include "../../src/jsimd.h"
#include "../../src/jdct.h"
#include "../../src/jsimddct.h"
#include "../jsimd.h"
#include "align.h"
#include "neon-compat.h"
@@ -53,7 +53,7 @@ ALIGN(16) static const uint16_t jsimd_rgb_ycc_neon_consts[] = {
/* Include inline routines for colorspace extensions. */
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#include "aarch64/jccolext-neon.c"
#else
#include "aarch32/jccolext-neon.c"
@@ -68,7 +68,7 @@ ALIGN(16) static const uint16_t jsimd_rgb_ycc_neon_consts[] = {
#define RGB_BLUE EXT_RGB_BLUE
#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE
#define jsimd_rgb_ycc_convert_neon jsimd_extrgb_ycc_convert_neon
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#include "aarch64/jccolext-neon.c"
#else
#include "aarch32/jccolext-neon.c"
@@ -84,7 +84,7 @@ ALIGN(16) static const uint16_t jsimd_rgb_ycc_neon_consts[] = {
#define RGB_BLUE EXT_RGBX_BLUE
#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
#define jsimd_rgb_ycc_convert_neon jsimd_extrgbx_ycc_convert_neon
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#include "aarch64/jccolext-neon.c"
#else
#include "aarch32/jccolext-neon.c"
@@ -100,7 +100,7 @@ ALIGN(16) static const uint16_t jsimd_rgb_ycc_neon_consts[] = {
#define RGB_BLUE EXT_BGR_BLUE
#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE
#define jsimd_rgb_ycc_convert_neon jsimd_extbgr_ycc_convert_neon
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#include "aarch64/jccolext-neon.c"
#else
#include "aarch32/jccolext-neon.c"
@@ -116,7 +116,7 @@ ALIGN(16) static const uint16_t jsimd_rgb_ycc_neon_consts[] = {
#define RGB_BLUE EXT_BGRX_BLUE
#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
#define jsimd_rgb_ycc_convert_neon jsimd_extbgrx_ycc_convert_neon
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#include "aarch64/jccolext-neon.c"
#else
#include "aarch32/jccolext-neon.c"
@@ -132,7 +132,7 @@ ALIGN(16) static const uint16_t jsimd_rgb_ycc_neon_consts[] = {
#define RGB_BLUE EXT_XBGR_BLUE
#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
#define jsimd_rgb_ycc_convert_neon jsimd_extxbgr_ycc_convert_neon
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#include "aarch64/jccolext-neon.c"
#else
#include "aarch32/jccolext-neon.c"
@@ -148,7 +148,7 @@ ALIGN(16) static const uint16_t jsimd_rgb_ycc_neon_consts[] = {
#define RGB_BLUE EXT_XRGB_BLUE
#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
#define jsimd_rgb_ycc_convert_neon jsimd_extxrgb_ycc_convert_neon
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#include "aarch64/jccolext-neon.c"
#else
#include "aarch32/jccolext-neon.c"
@@ -1,7 +1,8 @@
/*
* jcgray-neon.c - grayscale colorspace conversion (Arm Neon)
* Grayscale colorspace conversion (Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2024, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -21,13 +22,14 @@
*/
#define JPEG_INTERNALS
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../../src/jinclude.h"
#include "../../src/jpeglib.h"
#include "../../src/jsimd.h"
#include "../../src/jdct.h"
#include "../../src/jsimddct.h"
#include "../jsimd.h"
#include "align.h"
#include "neon-compat.h"
#include <arm_neon.h>
@@ -1,5 +1,5 @@
/*
* jcgryext-neon.c - grayscale colorspace conversion (Arm Neon)
* Grayscale colorspace conversion (Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
*
@@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
* Copyright (C) 2009, 2018, 2021, D. R. Commander.
* Copyright (C) 2009, 2018, 2021, 2025, D. R. Commander.
* Copyright (C) 2018, Matthias Räncker.
* Copyright (C) 2020-2021, Arm Limited.
* For conditions of distribution and use, see the accompanying README.ijg
@@ -17,7 +17,7 @@
* but must not be updated permanently until we complete the MCU.
*/
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#define BIT_BUF_SIZE 64
#else
#define BIT_BUF_SIZE 32
@@ -54,7 +54,7 @@ typedef struct {
* directly to the output buffer. Otherwise, use the EMIT_BYTE() macro to
* encode 0xFF as 0xFF 0x00.
*/
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#define FLUSH() { \
if (put_buffer & 0x8080808080808080 & ~(put_buffer + 0x0101010101010101)) { \
@@ -1,9 +1,9 @@
/*
* jcphuff-neon.c - prepare data for progressive Huffman encoding (Arm Neon)
* Prepare data for progressive Huffman encoding (Arm Neon)
*
* Copyright (C) 2020-2021, Arm Limited. All Rights Reserved.
* Copyright (C) 2022, Matthieu Darbois. All Rights Reserved.
* Copyright (C) 2022, D. R. Commander. All Rights Reserved.
* Copyright (C) 2022, 2024-2025, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -23,11 +23,11 @@
*/
#define JPEG_INTERNALS
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../../src/jinclude.h"
#include "../../src/jpeglib.h"
#include "../../src/jsimd.h"
#include "../../src/jdct.h"
#include "../../src/jsimddct.h"
#include "../jsimd.h"
#include "neon-compat.h"
@@ -251,7 +251,7 @@ void jsimd_encode_mcu_AC_first_prepare_neon
uint8x8_t bitmap_rows_4567 = vpadd_u8(bitmap_rows_45, bitmap_rows_67);
uint8x8_t bitmap_all = vpadd_u8(bitmap_rows_0123, bitmap_rows_4567);
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
/* Move bitmap to a 64-bit scalar register. */
uint64_t bitmap = vget_lane_u64(vreinterpret_u64_u8(bitmap_all), 0);
/* Store zerobits bitmap. */
@@ -511,7 +511,7 @@ int jsimd_encode_mcu_AC_refine_prepare_neon
uint8x8_t bitmap_rows_4567 = vpadd_u8(bitmap_rows_45, bitmap_rows_67);
uint8x8_t bitmap_all = vpadd_u8(bitmap_rows_0123, bitmap_rows_4567);
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
/* Move bitmap to a 64-bit scalar register. */
uint64_t bitmap = vget_lane_u64(vreinterpret_u64_u8(bitmap_all), 0);
/* Store zerobits bitmap. */
@@ -552,7 +552,7 @@ int jsimd_encode_mcu_AC_refine_prepare_neon
bitmap_rows_4567 = vpadd_u8(bitmap_rows_45, bitmap_rows_67);
bitmap_all = vpadd_u8(bitmap_rows_0123, bitmap_rows_4567);
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
/* Move bitmap to a 64-bit scalar register. */
bitmap = vget_lane_u64(vreinterpret_u64_u8(bitmap_all), 0);
/* Store signbits bitmap. */
@@ -595,7 +595,7 @@ int jsimd_encode_mcu_AC_refine_prepare_neon
bitmap_rows_4567 = vpadd_u8(bitmap_rows_45, bitmap_rows_67);
bitmap_all = vpadd_u8(bitmap_rows_0123, bitmap_rows_4567);
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
/* Move bitmap to a 64-bit scalar register. */
bitmap = vget_lane_u64(vreinterpret_u64_u8(bitmap_all), 0);
@@ -1,7 +1,8 @@
/*
* jcsample-neon.c - downsampling (Arm Neon)
* Downsampling (Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2024-2025, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -21,13 +22,14 @@
*/
#define JPEG_INTERNALS
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../../src/jinclude.h"
#include "../../src/jpeglib.h"
#include "../../src/jsimd.h"
#include "../../src/jdct.h"
#include "../../src/jsimddct.h"
#include "../jsimd.h"
#include "align.h"
#include "neon-compat.h"
#include <arm_neon.h>
@@ -105,7 +107,7 @@ void jsimd_h2v1_downsample_neon(JDIMENSION image_width, int max_v_samp_factor,
/* Load pixels in last DCT block into a table. */
uint8x16_t pixels = vld1q_u8(inptr + (width_in_blocks - 1) * 2 * DCTSIZE);
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
/* Pad the empty elements with the value of the last pixel. */
pixels = vqtbl1q_u8(pixels, expand_mask);
#else
@@ -167,7 +169,7 @@ void jsimd_h2v2_downsample_neon(JDIMENSION image_width, int max_v_samp_factor,
vld1q_u8(inptr0 + (width_in_blocks - 1) * 2 * DCTSIZE);
uint8x16_t pixels_r1 =
vld1q_u8(inptr1 + (width_in_blocks - 1) * 2 * DCTSIZE);
#if defined(__aarch64__) || defined(_M_ARM64)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
/* Pad the empty elements with the value of the last pixel. */
pixels_r0 = vqtbl1q_u8(pixels_r0, expand_mask);
pixels_r1 = vqtbl1q_u8(pixels_r1, expand_mask);
@@ -1,5 +1,5 @@
/*
* jdcolext-neon.c - colorspace conversion (Arm Neon)
* Colorspace conversion (Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2020, D. R. Commander. All Rights Reserved.
@@ -1,7 +1,8 @@
/*
* jdcolor-neon.c - colorspace conversion (Arm Neon)
* Colorspace conversion (Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2024, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -21,13 +22,14 @@
*/
#define JPEG_INTERNALS
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../../src/jinclude.h"
#include "../../src/jpeglib.h"
#include "../../src/jsimd.h"
#include "../../src/jdct.h"
#include "../../src/jsimddct.h"
#include "../jsimd.h"
#include "align.h"
#include "neon-compat.h"
#include <arm_neon.h>
@@ -1,7 +1,8 @@
/*
* jdmerge-neon.c - merged upsampling/color conversion (Arm Neon)
* Merged upsampling/color conversion (Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2024, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -21,13 +22,14 @@
*/
#define JPEG_INTERNALS
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../../src/jinclude.h"
#include "../../src/jpeglib.h"
#include "../../src/jsimd.h"
#include "../../src/jdct.h"
#include "../../src/jsimddct.h"
#include "../jsimd.h"
#include "align.h"
#include "neon-compat.h"
#include <arm_neon.h>
@@ -1,5 +1,5 @@
/*
* jdmrgext-neon.c - merged upsampling/color conversion (Arm Neon)
* Merged upsampling/color conversion (Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2020, D. R. Commander. All Rights Reserved.
@@ -1,8 +1,8 @@
/*
* jdsample-neon.c - upsampling (Arm Neon)
* Upsampling (Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2020, D. R. Commander. All Rights Reserved.
* Copyright (C) 2020, 2024, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -22,12 +22,13 @@
*/
#define JPEG_INTERNALS
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../../src/jinclude.h"
#include "../../src/jpeglib.h"
#include "../../src/jsimd.h"
#include "../../src/jdct.h"
#include "../../src/jsimddct.h"
#include "../jsimd.h"
#include "neon-compat.h"
#include <arm_neon.h>
@@ -1,7 +1,8 @@
/*
* jfdctfst-neon.c - fast integer FDCT (Arm Neon)
* Fast integer FDCT (Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2024, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -21,13 +22,14 @@
*/
#define JPEG_INTERNALS
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../../src/jinclude.h"
#include "../../src/jpeglib.h"
#include "../../src/jsimd.h"
#include "../../src/jdct.h"
#include "../../src/jsimddct.h"
#include "../jsimd.h"
#include "align.h"
#include "neon-compat.h"
#include <arm_neon.h>
@@ -1,8 +1,8 @@
/*
* jfdctint-neon.c - accurate integer FDCT (Arm Neon)
* Accurate integer FDCT (Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2020, D. R. Commander. All Rights Reserved.
* Copyright (C) 2020, 2024, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -22,11 +22,11 @@
*/
#define JPEG_INTERNALS
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../../src/jinclude.h"
#include "../../src/jpeglib.h"
#include "../../src/jsimd.h"
#include "../../src/jdct.h"
#include "../../src/jsimddct.h"
#include "../jsimd.h"
#include "align.h"
#include "neon-compat.h"
@@ -1,7 +1,8 @@
/*
* jidctfst-neon.c - fast integer IDCT (Arm Neon)
* Fast integer IDCT (Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2024, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -21,13 +22,14 @@
*/
#define JPEG_INTERNALS
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../../src/jinclude.h"
#include "../../src/jpeglib.h"
#include "../../src/jsimd.h"
#include "../../src/jdct.h"
#include "../../src/jsimddct.h"
#include "../jsimd.h"
#include "align.h"
#include "neon-compat.h"
#include <arm_neon.h>
@@ -1,8 +1,8 @@
/*
* jidctint-neon.c - accurate integer IDCT (Arm Neon)
* Accurate integer IDCT (Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2020, D. R. Commander. All Rights Reserved.
* Copyright (C) 2020, 2024, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -22,11 +22,11 @@
*/
#define JPEG_INTERNALS
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../../src/jinclude.h"
#include "../../src/jpeglib.h"
#include "../../src/jsimd.h"
#include "../../src/jdct.h"
#include "../../src/jsimddct.h"
#include "../jsimd.h"
#include "align.h"
#include "neon-compat.h"
@@ -1,8 +1,8 @@
/*
* jidctred-neon.c - reduced-size IDCT (Arm Neon)
* Reduced-size IDCT (Arm Neon)
*
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
* Copyright (C) 2020, D. R. Commander. All Rights Reserved.
* Copyright (C) 2020, 2024, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -22,11 +22,11 @@
*/
#define JPEG_INTERNALS
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../../src/jinclude.h"
#include "../../src/jpeglib.h"
#include "../../src/jsimd.h"
#include "../../src/jdct.h"
#include "../../src/jsimddct.h"
#include "../jsimd.h"
#include "align.h"
#include "neon-compat.h"
@@ -1,7 +1,8 @@
/*
* jquanti-neon.c - sample data conversion and quantization (Arm Neon)
* Sample data conversion and quantization (Arm Neon)
*
* Copyright (C) 2020-2021, Arm Limited. All Rights Reserved.
* Copyright (C) 2024-2025, D. R. Commander. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -21,12 +22,13 @@
*/
#define JPEG_INTERNALS
#include "../../jinclude.h"
#include "../../jpeglib.h"
#include "../../jsimd.h"
#include "../../jdct.h"
#include "../../jsimddct.h"
#include "../../src/jinclude.h"
#include "../../src/jpeglib.h"
#include "../../src/jsimd.h"
#include "../../src/jdct.h"
#include "../../src/jsimddct.h"
#include "../jsimd.h"
#include "neon-compat.h"
#include <arm_neon.h>
@@ -100,7 +102,8 @@ void jsimd_quantize_neon(JCOEFPTR coef_block, DCTELEM *divisors,
DCTELEM *shift_ptr = divisors + 3 * DCTSIZE2;
int i;
#if defined(__clang__) && (defined(__aarch64__) || defined(_M_ARM64))
#if defined(__clang__) && (defined(__aarch64__) || defined(_M_ARM64) || \
defined(_M_ARM64EC))
#pragma unroll
#endif
for (i = 0; i < DCTSIZE; i += DCTSIZE / 2) {
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020, D. R. Commander. All Rights Reserved.
* Copyright (C) 2020, 2024, D. R. Commander. All Rights Reserved.
* Copyright (C) 2020-2021, Arm Limited. All Rights Reserved.
*
* This software is provided 'as-is', without any express or implied
@@ -35,3 +35,11 @@
#else
#error "Unknown compiler"
#endif
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wdeclaration-after-statement"
#pragma clang diagnostic ignored "-Wc99-extensions"
#elif defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wdeclaration-after-statement"
#pragma GCC diagnostic ignored "-Wpedantic"
#endif
@@ -1,5 +1,5 @@
;
; jccolext.asm - colorspace conversion (AVX2)
; Colorspace conversion (AVX2)
;
; Copyright (C) 2015, Intel Corporation.
; Copyright (C) 2016, 2024, D. R. Commander.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jcolsamp.inc"
@@ -1,5 +1,5 @@
;
; jccolext.asm - colorspace conversion (MMX)
; Colorspace conversion (MMX)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2016, 2024, D. R. Commander.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jcolsamp.inc"
@@ -1,5 +1,5 @@
;
; jccolext.asm - colorspace conversion (SSE2)
; Colorspace conversion (SSE2)
;
; Copyright (C) 2016, 2024, D. R. Commander.
;
@@ -7,11 +7,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jcolsamp.inc"
@@ -1,5 +1,5 @@
;
; jccolor.asm - colorspace conversion (AVX2)
; Colorspace conversion (AVX2)
;
; Copyright (C) 2009, 2016, 2024, D. R. Commander.
; Copyright (C) 2015, Intel Corporation.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jccolor.asm - colorspace conversion (MMX)
; Colorspace conversion (MMX)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2009, 2016, 2024, D. R. Commander.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jccolor.asm - colorspace conversion (SSE2)
; Colorspace conversion (SSE2)
;
; Copyright (C) 2009, 2016, 2024, D. R. Commander.
;
@@ -7,11 +7,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jcgray.asm - grayscale colorspace conversion (AVX2)
; Grayscale colorspace conversion (AVX2)
;
; Copyright (C) 2011, 2016, 2024, D. R. Commander.
; Copyright (C) 2015, Intel Corporation.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jcgray.asm - grayscale colorspace conversion (MMX)
; Grayscale colorspace conversion (MMX)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2011, 2016, 2024, D. R. Commander.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jcgray.asm - grayscale colorspace conversion (SSE2)
; Grayscale colorspace conversion (SSE2)
;
; Copyright (C) 2011, 2016, 2024, D. R. Commander.
;
@@ -7,11 +7,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jcgryext.asm - grayscale colorspace conversion (AVX2)
; Grayscale colorspace conversion (AVX2)
;
; Copyright (C) 2011, 2016, 2024, D. R. Commander.
; Copyright (C) 2015, Intel Corporation.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jcolsamp.inc"
@@ -1,5 +1,5 @@
;
; jcgryext.asm - grayscale colorspace conversion (MMX)
; Grayscale colorspace conversion (MMX)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2011, 2016, 2024, D. R. Commander.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jcolsamp.inc"
@@ -1,5 +1,5 @@
;
; jcgryext.asm - grayscale colorspace conversion (SSE2)
; Grayscale colorspace conversion (SSE2)
;
; Copyright (C) 2011, 2016, 2024, D. R. Commander.
;
@@ -7,11 +7,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jcolsamp.inc"
@@ -1,5 +1,5 @@
;
; jchuff-sse2.asm - Huffman entropy encoding (SSE2)
; Huffman entropy encoding (SSE2)
;
; Copyright (C) 2009-2011, 2014-2017, 2019, 2024, D. R. Commander.
; Copyright (C) 2015, Matthieu Darbois.
@@ -9,11 +9,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
;
; This file contains an SSE2 implementation for Huffman coding of one block.
; The following code is based on jchuff.c; see jchuff.c for more details.
@@ -1,5 +1,5 @@
;
; jcphuff-sse2.asm - prepare data for progressive Huffman encoding (SSE2)
; Prepare data for progressive Huffman encoding (SSE2)
;
; Copyright (C) 2016, 2018, Matthieu Darbois
;
@@ -7,11 +7,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
;
; This file contains an SSE2 implementation of data preparation for progressive
; Huffman encoding. See jcphuff.c for more details.
@@ -1,5 +1,5 @@
;
; jcsample.asm - downsampling (AVX2)
; Downsampling (AVX2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2015, Intel Corporation.
@@ -9,11 +9,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jcsample.asm - downsampling (MMX)
; Downsampling (MMX)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2016, 2024, D. R. Commander.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jcsample.asm - downsampling (SSE2)
; Downsampling (SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2016, 2024, D. R. Commander.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jdcolext.asm - colorspace conversion (AVX2)
; Colorspace conversion (AVX2)
;
; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2012, 2016, 2024, D. R. Commander.
@@ -9,11 +9,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jcolsamp.inc"
@@ -1,5 +1,5 @@
;
; jdcolext.asm - colorspace conversion (MMX)
; Colorspace conversion (MMX)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2016, 2024, D. R. Commander.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jcolsamp.inc"
@@ -1,5 +1,5 @@
;
; jdcolext.asm - colorspace conversion (SSE2)
; Colorspace conversion (SSE2)
;
; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2012, 2016, 2024, D. R. Commander.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jcolsamp.inc"
@@ -1,5 +1,5 @@
;
; jdcolor.asm - colorspace conversion (AVX2)
; Colorspace conversion (AVX2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2015, Intel Corporation.
@@ -9,11 +9,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jdcolor.asm - colorspace conversion (MMX)
; Colorspace conversion (MMX)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2009, 2016, 2024, D. R. Commander.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jdcolor.asm - colorspace conversion (SSE2)
; Colorspace conversion (SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2009, 2016, 2024, D. R. Commander.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jdmerge.asm - merged upsampling/color conversion (AVX2)
; Merged upsampling/color conversion (AVX2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2009, 2016, 2024, D. R. Commander.
@@ -9,11 +9,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jdmerge.asm - merged upsampling/color conversion (MMX)
; Merged upsampling/color conversion (MMX)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2009, 2016, 2024, D. R. Commander.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jdmerge.asm - merged upsampling/color conversion (SSE2)
; Merged upsampling/color conversion (SSE2)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2009, 2016, 2024, D. R. Commander.
@@ -8,11 +8,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jsimdext.inc"
@@ -1,5 +1,5 @@
;
; jdmrgext.asm - merged upsampling/color conversion (AVX2)
; Merged upsampling/color conversion (AVX2)
;
; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB
; Copyright (C) 2012, 2016, 2024, D. R. Commander.
@@ -9,11 +9,7 @@
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
; This file should be assembled with NASM (Netwide Assembler) or Yasm.
%include "jcolsamp.inc"

Some files were not shown because too many files have changed in this diff Show More