Commit Graph

38551 Commits

Author SHA1 Message Date
abhishek-gola
0cfdeb800f tests: reduce iterations, input sizes and perf grids of slow tests
Signed-off-by: abhishek-gola <abhishek@opencv.org>
2026-11-24 16:43:10 +05:30
Abhishek Gola
8a1083b85a Merge pull request #30938 from abhishek-gola/tests/faster-test-infra-5x
tests: speed up reference implementations and avoid repeated work in slow tests
2026-11-24 15:47:17 +05:30
abhishek-gola
28d85a1fb0 tests: speed up reference implementations and avoid repeated work in slow tests
Signed-off-by: abhishek-gola <abhishek@opencv.org>
2026-11-24 15:46:07 +05:30
Alexander Smorkalov
e472ab201e Merge pull request #31115 from emreyoleridev:doc-fix-sample-links-5x
doc: fix tutorial sample links broken by snippets move 🤖🤖🤖
2026-11-24 13:13:35 +03:00
Shiven Solanki
e8bc3f0c9c doc(imgproc): fix supported depths for integral and thresholdWithMask (#30978)
* doc(imgproc): fix supported depths for integral and thresholdWithMask

* doc(imgproc): note extra integral depth combinations on the OpenCL path
2026-11-24 15:33:37 +05:30
Andrei Fedorov
7146ce2e6e Reenable filter2d to get more performance using IPP HAL backend (#30659)
* changes for hal

* redirect to opencv in some cases

* correct perf restrictions

* simplify conditions in hal

* parallelization

* correct constraints

* generalize some checks
2026-11-24 15:23:19 +05:30
Laiba Irfan
3351889ecd dnn: support allowzero attribute in ONNX Reshape (#30854)
* dnn: support allowzero attribute in ONNX Reshape

* dnn: skip reshape allowzero test for OpenVINO, specify opset range

* dnn: add Reshape2 allowzero tests for 2D legacy and block-layout paths
2026-11-24 13:41:12 +05:30
Rahul Kumar
7a3dd65ae1 dnn: fix com.microsoft Attention with a mask_index or without a bias, and Add(mask, scores) fusion 🤖🤖🤖 (#30930)
* dnn: fix masked Attention ONNX import and commutative mask-Add fusion

ONNXImporter2::parseAttention required every input after X to be constant before populating params.blobs, leaving blobs empty for dynamic masks, pushing constant masks into blobs[2], and failing on omitted or trailing empty optional inputs. AttentionLayerImpl also read bias from blobs.back() instead of blobs[1], and ModelFusionAttention::isMaskAdd hardcoded inputs[1] so Add(mask, scores) bound Attention's mask to the removed score node. Fold constant weight and bias into blobs[0..1], keep any 4th mask input on layer->inputs[1], and match score_arg in isMaskAdd.

* dnn(onnx): lower the Attention int32 mask_index with addKeyPaddingMaskBias

mask_index is an int32 0/1 padding mask, not an additive bias. Turn it
into the additive mask the layer applies, the same way
parseMultiHeadAttention does, saving and restoring node_inputs and
node_outputs around the helper.

The test loads its models from opencv_extra (same branch name) with
testONNXModels() instead of building them and the reference in code;
the first three cases now use the spec's int32 [B, S] mask.

* dnn: keep AttentionLayerImpl's blob access as on 5.x

parseAttention now always gives the layer exactly two blobs, the weight
and the bias, and the fusion passes do the same, so blobs.front() and
blobs.back() already pick them. The blobs[0]/blobs[1] change is not
needed.
2026-11-24 13:38:53 +05:30
Shiven Solanki
9c6d1ababb dnn: return an empty shape in Shape when start > end (#31011)
* dnn: return an empty shape in Shape when start > end

* dnn: apply the Shape start > end rule to the CUDA backend

* dnn: skip test_shape_start_greater_than_end in the OpenVINO filter

Problem
ShapeLayerImpl::getShapeRange asserts start_ <= end_, so Shape with start > end throws. The ONNX spec says the result should be an empty shape.

Fix
After clamping, set end_ = std::max(end_, start_) so the range has length 0. This
2026-11-24 13:36:58 +05:30
Vladimir Iglovikov
ebf8a55d6c core: support CV_16F in the legacy reduce overload 🤖🤖🤖 (#31032)
* core: support CV_16F in the legacy reduce overload

Delegate half-precision CPU input to the existing N-D reduction kernels.
Preserve the 2-D result for a one-dimensional legacy input.

* core: use CV_CheckEQ for the 1D dim check in CV_16F reduce

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 13:30:49 +05:30
emreyoleridev
07af569818 doc: fix sample links broken by samples/*/snippets move 2026-11-24 08:52:35 +01:00
Shiven Solanki
5014b24db5 dnn: keep CV_64S precision in Resize2 nearest mode (#31036)
* dnn: keep CV_64S precision in Resize2 nearest mode

Fixes #31035

* dnn: use ptr<>() in Resize2 int64 test to fix Debug assert on 4D Mat
2026-11-24 13:04:50 +05:30
Alexander Smorkalov
0354e66b7d Merge pull request #31104 from pratham-mcw:solve-opt-5x
hal/armpl: add QR decomposition and least-squares solve using ARMPL LAPACK
2026-11-24 10:11:26 +03:00
Alexander Smorkalov
ed4ee4d5b2 Merge pull request #31097 from sshivensolanki:dnn-cumsum-empty-axis
dnn: fix CumSum crash when the scan axis has length 0
2026-11-24 10:02:45 +03:00
Abhishek Gola
dd40316640 Merge pull request #31113 from abhishek-gola/fix/ios-docc-index-compat
ios: build DocC docs only with Xcode 15+
2026-11-24 11:19:15 +05:30
Abhishek Gola
1056624e1c dnn: fix CumProd crash when the scan axis has length 0 (#31063)
* dnn: fix CumProd crash when the scan axis has length 0

* dnn: use Mat::empty() for the CumProd empty-input check

Return early from forwardImpl() when the input has no elements. The output already has the right empty shape. The check comes after normalize_axis(), so an out-of-range axis is still reported.
2026-11-24 10:45:03 +05:30
abhishek-gola
be8e6048bc Backport Xcode 15 DocC requirement from 4.x 2026-11-24 10:43:27 +05:30
abhishek-gola
7e3dfb0878 Fix iOS DocC indexing flag compatibility 2026-11-24 10:37:07 +05:30
Madan mohan Manokar
19f86d566c Merge pull request #30974 from amd/port_5.x_opencl_boxfilter
imgproc: Port 4.x enable boxFilter OpenCL fast paths on all aligned GPUs (5.x)

This PR only removes the Intel vendor gate as a port of upstream OpenCV PR #29805.

No changes are made to the underlying OpenCL kernels or dispatch logic.
Regression is observed on Apple M5 when filterSmall is used, including cases up to about 3.5× slower at odd, large sizes.
Earlier benchmark data in imgproc: Enable boxFilter OpenCL fast paths on Non-Intel GPUs. #29805 showed gains on AMD and NVIDIA GPUs for the small-kernel cases.
The filterSmall gate is therefore extended from Intel to AMD and NVIDIA. Apple and other vendors stay on the general kernel.
Any potential kernel correctness, ROI, aliasing, boundary handling, or in-place processing issues are pre-existing implementation concerns and should be evaluated separately in follow-up PRs. Such issues are outside the scope of this change.
2026-11-24 10:14:09 +05:30
Abhishek Gola
eb30136494 Merge pull request #30924 from pctablet505/fix-dnn-cuda-gemm-square-transpose-5x
dnn: avoid transposing square Gemm weights in-place in initCUDA (5.x) 🤖🤖🤖
2026-11-24 09:44:47 +05:30
Abhishek Gola
5eb67caa6b Merge pull request #31093 from vinaykumar11-maker/fix-empty-case-msvc
dnn(test): remove empty CASE() entry that breaks MSVC build with OpenVINO
2026-11-24 09:37:45 +05:30
Abhishek Gola
f15f296e1b Merge pull request #31023 from v-hogood/fix-lightglue-swift-name
features(objc): fix conflicting Swift name for LightGlueMatcher.create
2026-11-24 09:24:07 +05:30
Karnajeet Gosavi
c309fe76d4 Merge pull request #31029 from kg290/codex/ffmpeg-frame-size-warning
videoio: Report expected and actual FFmpeg frame sizes
2026-11-24 09:22:10 +05:30
Alexander Smorkalov
950512e1cf Merge pull request #31002 from asmorkalov:as/android_defaults
Use default config in Android build scripts.
2026-11-23 22:51:21 +03:00
Pratham Kumar
f94cc4e047 hal/armpl: add QR decomposition and least-squares solve using ARMPL LAPACK 2026-11-23 22:45:20 +05:30
Shiven Solanki
150a25256c dnn: fix CumSum crash when the scan axis has length 0 2026-11-23 22:25:12 +08:00
vinay kumar
958be87d74 dnn(test): remove empty CASE() entry that breaks MSVC build with OpenVINO 2026-11-23 18:14:55 +05:30
Shiven Solanki
9637fe1290 Merge pull request #30999 from sshivensolanki:core-mean-bool
core: support CV_Bool input in mean and meanStdDev - #30999

Fixes #30998

### Problem

`cv::mean` and `cv::meanStdDev` fail with `func != 0` on a `CV_Bool` source, because there is no `CV_Bool` sum kernel. `cv::sum` and `cv::norm` already handle `CV_Bool`.

### Fix

For a `CV_Bool` source, compute the result from `countNonZero` and `total()` instead of the sum kernels: mean = nz/n, and stddev = sqrt(p*(1-p)) with p = nz/n. A mask, or more than one channel, reports `StsNotImplemented`.

### Tests

Added `Core_MeanStdDev.bool_input`: a 1-channel `CV_Bool` source (including a raw `255` byte) must give mean 0.5 and stddev 0.5, and both functions must throw when a mask is given. It fails on the current code with the assert and passes with the fix. The full `opencv_test_core` run passes.

### Pull Request Readiness Checklist

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

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is 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
2026-11-23 15:01:58 +03:00
AYUSH JAISWAL
7070df2736 Merge pull request #31083 from jazayush:5.x
doc: fix comment syntax in Python bindings tutorial - #31083

Fix the malformed Doxygen comment syntax in `py_bindings_basics.markdown`.

Change `/!` to `//!` so Doxygen correctly recognizes the comment.

### Pull Request Readiness Checklist

- [x] I agree to contribute under the Apache 2 License.
- [x] The proposed patch is not based on GPL or other incompatible code.
- [x] The PR is proposed to the proper branch (`5.x`).
- [ ] There is a reference to the original bug report and related work (not applicable; no issue linked).
- [ ] Accuracy and performance tests (not applicable; documentation-only change).
- [x] Documentation updated (one-line comment correction).
2026-11-23 14:21:15 +03:00
Shiven Solanki
7f57e38b02 dnn: use Mat::empty() for the CumProd empty-input check 2026-11-23 18:58:12 +08:00
Alexander Smorkalov
49bfe2764c Merge pull request #31080 from pratapvirat2004:patch-1
docs(imgproc): fix math rendering in color formula 🤖🤖🤖
2026-11-23 12:56:54 +03:00
Virat Pratap
79ae232914 docs(imgproc): fix math rendering in color formula
Clarify the max operator and group ChannelRange as one identifier. Addresses #31077.
2026-11-23 08:55:17 +00:00
Abhishek Gola
fb6166e54b Merge pull request #31044 from harshil-sri/fix-0d-threshold-lut
core, imgproc: support 0D Mat in LUT and threshold

Give a 0D input a 1x1 header before the row-based code runs, the same way #30704 normalizes 1D inputs in gemm:

threshold / thresholdWithMask: src (and mask) are viewed as 1x1, so the output is 1x1, the same as the other imgproc functions return for 0D input.
LUT: src and dst get 1x1 headers for the HAL and parallel paths. dst is created with createSameSize, so the result itself stays 0D.
2026-11-23 09:27:52 +05:30
Abhishek Gola
d2c6f944cf Merge pull request #31034 from sshivensolanki/dnn-cast-uint32-uint64
dnn: support UINT32 and UINT64 targets in Cast

Map ONNX UINT32 (12) and UINT64 (13) to CV_32U and CV_64U in mapToCvDepth.
Add CV_32U and CV_64U cases to truncateFloatToInt, so float inputs truncate toward zero as ONNX requires, instead of being rounded by convertTo.
Allow CV_32U and CV_64U in the outputType parameter.
2026-11-23 09:27:12 +05:30
Abhishek Gola
e4ec28617f Merge pull request #31039 from ish1416/dnn-reduce-support-unsigned
dnn: support CV_32U and CV_64U in Reduce layers

Fix
In modules/dnn/src/layers/reduce2_layer.cpp: Add CV_32U and CV_64U to getTypes validation.
In modules/dnn/src/layers/reduce_layer.cpp: Add CV_32U and CV_64U to getTypes and typeDispatch (opDispatch<uint32_t> and opDispatch<uint64_t>).
In modules/dnn/test/test_int.cpp: Extend Test_Reduce_Int to include CV_32U and CV_64U.
In modules/dnn/test/test_layers.cpp: Add Layer_Test_Reduce_Unsigned parameterized test checking MAX, MIN, and SUM on CV_32U and CV_64U with values greater than 2^31 to verify unsigned comparison logic.
2026-11-23 09:26:18 +05:30
Shiven Solanki
36596cbeca dnn: fix CumProd crash when the scan axis has length 0 2026-11-23 08:50:36 +08:00
Abhishek Gola
2ce6479ab8 Merge pull request #31047 from sshivensolanki/dnn-range-zero-delta
dnn: reject zero delta in Range layer

Check that delta is not zero in getRangeParams() before rangeSize() is called: CV_CheckNE for the float branch and CV_CheckTrue(idelta != 0, ...) for the integer branch, since CV_CheckNE has no int64_t overload. Both forward() and getMemoryShapes() go through getRangeParams(), so both are covered.
2026-11-22 21:31:16 +05:30
Ishita Singh
4bd226ed15 dnn: support CV_32U and CV_64U in Reduce layers 2026-11-22 20:35:00 +05:30
Shiven Solanki
5bb1be7693 imgproc: support 5.x depths in remap/warp with INTER_NEAREST (#30595)
* imgproc: support 5.x depths in remap/warp with INTER_NEAREST

nn_tab in cv::remap only had entries for CV_8U..CV_64F, so remap,
warpAffine and warpPerspective with INTER_NEAREST failed with
"nnfunc != 0" for CV_16F, CV_16BF, CV_Bool, CV_64U, CV_64S, CV_32U and
both fp8 depths. Nearest neighbor only copies pixels, so add the
remapNearest instances for these types, in both the absolute and the
WARP_RELATIVE_MAP rows. Using the real element types keeps the border
value conversion right (e.g. CV_Bool border 2 becomes 1).

Add an Imgproc_Warp_NearestNewDepths test.

* imgproc: use MatDepth in Imgproc_Warp_NearestNewDepths

A plain int parameter prints a failing case as GetParam() = 13. MatDepth prints the depth name instead.

* imgproc: convert remap nearest border once, dispatch copy by element size
2026-11-22 19:28:31 +05:30
Shiven Solanki
7e2201571d Merge pull request #31025 from sshivensolanki/dnn-onehot-uint32-bool
dnn: support CV_32U, CV_64U and CV_Bool values in OneHot

Add the missing case labels, calling the existing runKernel<uint32_t>, runKernel<uint64_t> and runKernel<bool>.
tensorToScalar could not read CV_64U tensors. It now reads them as uint64_t and writes the result without going through int64_t, so values above INT64_MAX are not cut down. The output conversion moved into a small storeScalar template, called with double, int64_t or uint64_t; the results for the other input types are unchanged.
2026-11-22 18:35:51 +05:30
Abhishek Gola
65c6ccd6e5 Merge pull request #30606 from tushar152006/feat-dnn-onnx-col2im
dnn(onnx): add support for ONNX Col2Im operator
2026-11-22 18:35:15 +05:30
Tushar Burla
f3a7576b57 dnn(onnx): add support for ONNX Col2Im operator
- Implement Col2ImLayer supporting static/dynamic output shape inference and spatial summation
- Enforce CV_32F data input and int32/int64 shape inputs in getTypes() and forward()
- Require 1-D rank and CV_64S value range-checking (rejecting > INT_MAX) for image_shape and block_shape
- Support multi-dimensional spatial blocks, dilations, pads, and strides
- Parse image and block shapes using OpenCV tensorToIntVec()
- Parallelize across batch and channels using a single parallel_for_ with batch*channel <= INT_MAX guard
- Guard wide-coordinate offsets and domain arithmetic against signed overflow
- Add unit and parameterized tests in test_layers for shape inference, type validation, empty inputs, oversized shapes, malformed ranks, coordinate bounds, malformed attributes, and 4-D spatial values
- Add Col2Im performance benchmark baseline in modules/dnn/perf/perf_col2im.cpp
- Skip Col2Im conformance tests in OpenVINO filter
- Un-denylist all 5 official ONNX conformance tests

# Conflicts:
#	modules/dnn/test/test_layers.cpp

# Conflicts:
#	modules/dnn/test/test_layers.cpp
2026-11-22 11:32:10 +05:30
Shiven Solanki
45833cc1aa dnn: reject zero delta in Range layer 2026-11-22 10:58:26 +08:00
Harshil
942aa1aabb core, imgproc: support 0D Mat in LUT and threshold 2026-11-22 02:28:24 +05:30
Abhishek Gola
13778986a8 Merge pull request #31008 from sshivensolanki/dnn-eyelike-uint32-uint64
dnn: support CV_32U and CV_64U outputs in EyeLike
2026-11-21 21:07:11 +05:30
Shiven Solanki
ad55604af8 dnn: support UINT32 and UINT64 targets in Cast 2026-11-21 19:52:12 +08:00
Shiven Solanki
c8ac3039be dnn: support CV_32U and CV_64U outputs in EyeLike 2026-11-21 18:03:13 +08:00
Abhishek Gola
e49cba7856 Merge pull request #31013 from sshivensolanki/dnn-clip-uint32-uint64
dnn: support CV_32U and CV_64U in Clip default bounds
2026-11-21 14:00:48 +05:30
Abhishek Gola
d12ffef79b Merge pull request #30817 from ternaus/codex/fractional-area-resize
imgproc: reuse filtered rows in fractional area resize 🤖🤖🤖
2026-11-21 09:44:33 +05:30
Shiven Solanki
fe06ceaca5 dnn: support CV_32U and CV_64U in Clip default bounds 2026-11-21 12:07:01 +08:00