Commit Graph
37614 Commits
Author SHA1 Message Date
Alexander Smorkalov 7fdaf488e8 Merge pull request #29571 from antonio-rojas:patch-1
Fix Rect dimensions in getChannelFromBlob
2026-08-11 14:25:52 +03:00
Neal Daftary 042034ee74 Merge pull request #29677 from Neal006:imgproc/matchtemplate-bool-mask
imgproc: accept CV_Bool masks in matchTemplate (#25895) - #29677

### Problem

`cv::Mat_<bool>::depth()` returns `CV_Bool` in 5.0, where it returned `CV_8U` in 4.x. `matchTemplateMask` gates the mask at `templmatch.cpp:737`, so passing a boolean mask now fails with:

```
(-215:Assertion failed) _mask.depth() == CV_8U || _mask.depth() == CV_32F in function 'cv::matchTemplateMask'
```

A binary mask is a normal input for masked template matching, so this is a regression against 4.x.

### Fix

Allow `CV_Bool` in the assertion and widen the mask to `CV_8U` before the existing binarization step.

The widening is required rather than passing `CV_Bool` straight through, because `cv::threshold()` does not accept `CV_Bool`. Once widened, the existing `THRESH_BINARY` path treats any non-zero entry as selected, which is exactly the documented `CV_8U` mask semantics. `CV_8U` and `CV_32F` masks take an unchanged path.

The masked path is the only one affected: `cv::matchTemplate` routes every non-empty mask through `matchTemplateMask`, and there is no OpenCL mask variant.

### Test

`Imgproc_MatchTemplateBoolMask.matches_uchar_mask` compares a `Mat_<bool>` mask against the equivalent `CV_8UC1` mask and requires the results to agree, across all six match methods (`TM_SQDIFF`, `TM_SQDIFF_NORMED`, `TM_CCORR`, `TM_CCORR_NORMED`, `TM_CCOEFF`, `TM_CCOEFF_NORMED`) for `CV_8UC1`, `CV_8UC3` and `CV_32FC1` images. 18 parameter combinations.

Verified locally on 5.x: all 18 fail without the source change (with the assertion above) and pass with it. The full `*MatchTemplate*` set, 165 tests, passes. No test data needed, the test is synthetic.

Part of #25895, and follows the same approach as #29580, #29597 and #29622.

### 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
2026-08-11 11:10:46 +03:00
Neal Daftary 8104037c60 Merge pull request #29681 from Neal006:video/ecc-bool-mask
video: accept CV_Bool masks in findTransformECC (#25895) #29681

### Problem

`cv::Mat_<bool>::depth()` returns `CV_Bool` in 5.0, where it returned `CV_8U` in 4.x.

`findTransformECCWithMask` does not type check `inputMask` at all. It passes it straight to `cv::threshold()` at `ecc.cpp:483`, and `cv::threshold()` dispatches only on `CV_8U`, `CV_16S`, `CV_16U`, `CV_32F` and `CV_64F`, erroring otherwise. So a boolean mask fails with an error pointing at imgproc rather than at the mask:

```
modules/imgproc/src/thresh.cpp:1607: error: (-210:Unsupported format or combination of formats)
in function 'cv::threshold'
```

### Fix

Widen a `CV_Bool` mask to `CV_8U` before the `threshold` call. The existing `THRESH_BINARY` step then treats any non-zero entry as selected, which matches the `CV_8U` mask semantics.

`inputMask` is used nowhere else in the function (only at `ecc.cpp:476` for the `empty()` check and at `:483`), so this is the single point that needed handling. `CV_8U` masks take an unchanged path.

Note that `cv::computeECC` already accepts a boolean mask, because it only forwards the mask to `countNonZero`, `meanStdDev` and `subtract`, which all handle `CV_Bool`. This change makes `findTransformECC` consistent with it.

### Test

`Video_ECC_BoolMask.matches_uchar_mask` builds a blurred checkerboard, warps it by a known translation, then runs `findTransformECC` with `MOTION_TRANSLATION` using a `Mat_<bool>` mask and the equivalent `CV_8UC1` mask, and requires the same warp matrix from both.

Verified locally on 5.x: the test fails without the change (with the error above) and passes with it. The full `*ECC*` set, 15 tests, passes with `OPENCV_TEST_DATA_PATH` set. No test data needed for the new test itself, it is synthetic.

Part of #25895, and follows the same approach as #29580, #29597 and #29622.

### 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
2026-08-11 10:28:27 +03:00
Alexander Smorkalov d9d551ed09 Merge pull request #29676 from Neal006:photo/inpaint-bool-mask
photo: accept CV_Bool masks in inpaint (#25895)
2026-08-11 09:30:42 +03:00
Neal006 a23985fbdb photo: accept CV_Bool masks in inpaint (#25895)
cv::Mat_<bool>::depth() returns CV_Bool in 5.0, where it was CV_8U in 4.x, so
code that passed a boolean mask to inpaint() stopped working on the 5.x branch.
icvInpaint() rejected anything that was not CV_8UC1, even though CV_Bool is a
single byte like CV_8U and the uchar reads in the fast marching code are already
correct for it. Relaxing the type gate is therefore sufficient, no conversion of
the mask is needed.

The regression test checks a boolean mask against the equivalent CV_8U mask and
requires both the output type and every pixel to match, for both inpainting
algorithms and for 1 and 3 channel input.

Verified locally: the test fails against unmodified 5.x with "The mask must be
8-bit 1-channel image" and passes with the change. The rest of opencv_test_photo
is unaffected.
2026-08-10 23:06:33 +05:30
Alexander Smorkalov 7e9fc68d21 Merge pull request #29673 from abhishek-gola:lstm_optimization
Optimize LSTM (batched input projection, weight pre-packing, parallel directions)
2026-08-10 15:32:26 +03:00
Abhishek Gola 841e8a7984 Merge pull request #29628 from velonica0/dnn-rvv-hal-depthwise
dnn(rvv): HAL kernel for depthwise convolution (blocked NCHWc)
2026-08-09 21:31:43 +05:30
Abhishek Gola b13dff7b2c Merge pull request #29608 from dheerajsingh544/fix-22259-ueye-gain-5x
videoio: fix CAP_PROP_GAIN not working with ueye backend
2026-08-07 00:08:34 +05:30
dheeraj singh da9fec9c47 videoio: clamp ueye CAP_PROP_GAIN to SDK's documented [0,100] range
is_SetHardwareGain's master-gain parameter is documented as 0-100;
out-of-range values are not guaranteed to be handled predictably by
the SDK, so clamp before passing through.
2026-08-06 17:23:05 +05:30
Abhishek Gola 34600510e4 lstm optimizations 2026-08-06 16:55:09 +05:30
Abhishek Gola dcf26f8ede Merge pull request #29657 from varun-jaiswal17/fix/python-64bit-and-bfloat16-dtype
Add dnn conformance python tests
2026-08-05 18:06:47 +05:30
velonica0 515ad7725a activation is nullptr 2026-08-04 20:27:23 -07:00
velonica0 484dc43c22 ci: re-trigger against fixed opencv_contrib 2026-08-04 19:41:43 -07:00
velonica0 253642c1ef dnn:rvv: add register-fill fast path to depthwise convolution for wide VLEN 2026-08-04 19:41:43 -07:00
velonica0 baf21fa180 dnn:rvv: implement RVV HAL kernel for depthwise convolution 2026-08-04 19:41:43 -07:00
velonica0 7253ddaa9b dnn: add HAL replacement hook for depthwise convolution 2026-08-04 19:40:58 -07:00
Abhishek Gola 6998403472 Merge pull request #29609 from Teddy-Yangjiale/rvv-fisheye-undistortpoints
geometry: Vectorize fisheye::undistortPoints
2026-08-04 23:31:25 +05:30
vrooomy c964008158 remove equal_nan for older npy compatibility U20 2026-08-04 21:21:14 +05:30
Abhishek Gola 2c00686ec7 Merge pull request #29625 from velonica0/dnn-rvv-hal-pooling
RVV HAL kernels for DNN max/average pooling
2026-08-04 20:09:01 +05:30
vrooomy 851ee7046c adding the deny list to python similarly 2026-08-04 14:32:03 +05:30
vrooomy 6e338fb03b extract test list into a separate .py file 2026-08-04 13:46:33 +05:30
Abhishek Gola 0635bffb3d Merge pull request #29653 from lazerg/fix-29652-mser-mindiversity
features: fix MSER discarding stable regions via minDiversity (#29652)
2026-08-04 09:57:04 +05:30
Abhishek Gola 68a918b900 Merge pull request #29621 from YangGuanyuhan/christylinux/fix-onnx-gather-cast
dnn: (bug fix )preserve Cast semantics after ONNX Gather
2026-08-04 01:01:18 +05:30
vrooomy 5fcdb9b01e code cleanup 2026-08-03 14:41:43 +05:30
Lazizbek Ergashev 02466fac6b features: fix MSER discarding stable regions via minDiversity (#29652) 2026-08-03 13:13:36 +05:00
vrooomy 25ed5d4c0d map 64bit int anf bfloat16 2026-08-03 12:26:19 +05:30
velonica0 f04ff17028 dnn: fix pooling HAL doc-build warnings (unresolvable ConvState @ref and partial avgpool param docs) 2026-08-02 19:12:51 -07:00
Abhishek Gola d6eb13adb9 Merge pull request #29616 from kirtijindal14/ptcloud-viz3d
ptcloud: OpenGL-based 3D visualization (cv::viz3d)
2026-08-01 13:34:56 +05:30
Yang Guanyuhan 143b084be2 dnn: remove redundant ORT test skips 2026-07-31 23:42:48 +08:00
Abhishek Gola a48e427e78 Merge pull request #29629 from biconcavelens/fix/stylization-oob-single-column
photo: fix OOB read in Domain_Filter::compute_NCfilter for degenerate masks 🤖🤖🤖
2026-07-31 18:53:08 +05:30
Abhishek Gola 32dcb2ea6c Merge pull request #29535 from vrabaud/persistence
Fix benign TSAN warning in TRUCO
2026-07-31 16:43:12 +05:30
Yang Guanyuhan 7669897910 dnn: preserve Cast semantics after ONNX Mul 2026-07-31 00:21:42 +08:00
vrooomy 4ed880f045 Added dnn conformance test python scripts 2026-07-30 20:07:29 +05:30
Yang Guanyuhan 0e36cafcf4 dnn: preserve Cast semantics after ONNX Gather 2026-07-30 22:22:31 +08:00
Abhishek Gola 9548c7ea4e Merge pull request #29632 from ArneshBanerjee/fix-29568-extractchannel-inplace
core: restore in-place support for extractChannel (#29568)
2026-07-30 16:01:32 +05:30
Abhishek Gola 0f83d516bf Merge pull request #29630 from varun-jaiswal17/heavy_test_skip
skip test DNNTestNetwork.AlexNet/0 on 32-bit target
2026-07-30 15:02:28 +05:30
kirtijindal14 f3bdb6cf01 highgui: enable depth buffer for GTK3 GtkGLArea so GL_DEPTH_TEST works 2026-07-30 14:14:31 +05:30
velonica0 b907960e0b dnn:rvv: rename pooling HAL hooks to *pool3d and correct the NCDHWc layout comment 2026-07-29 23:17:19 -07:00
velonica0 55fdef8581 dnn:rvv: implement RVV HAL kernels for max and average pooling 2026-07-29 23:17:19 -07:00
velonica0 4d976ffb19 dnn: add HAL replacement hooks for max and average pooling 2026-07-29 23:17:19 -07:00
Abhishek Gola ccfa3a733b Merge pull request #29286 from abhishek-gola/cuda_layer_dispatch
CUDA support and Layer Split + per-op executors
2026-07-30 10:45:17 +05:30
Arnesh BanerjeeandClaude Opus 4.8 ba5b40b1a2 core: restore in-place support for extractChannel (#29568)
extractChannel() stopped supporting in-place operation (dst aliasing
src) after commit 416bf3253 (PR #23473), which replaced

    Mat src = _src.getMat();
    _dst.create(src.dims, &src.size[0], depth);

with a single up-front

    _dst.createSameSize(_src, depth);
    ...
    Mat src = _src.getMat();

When _src and _dst reference the same array, the up-front reallocation
reshapes the shared buffer to a single channel before the multi-channel
source header is fetched. mixChannels() then sees a 1-channel source and
throws for any coi >= 1.

Move createSameSize() back to after the source Mat/UMat is obtained, so
the source header keeps the original multi-channel data alive across the
destination reallocation. This preserves the 0D/1D handling introduced
by createSameSize while restoring the pre-existing in-place contract.

Adds regression test Core_Mat.extractChannel_inplace_29568.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-30 03:09:43 +05:30
Abhishek Gola 3ef693c48a warning fix 2026-07-29 21:18:11 +05:30
Varun Jaiswal e0e52c14b1 restrict skip to windows 32 only 2026-07-29 20:38:18 +05:30
Abhishek Gola 34c478016d Adapt merged 5.x Scan helpers to the LayerInfo split
# Ptr<LayerInfo> over body->prog().
 # (matches sibling parseLoop/parseIf).
 # sliceScanAxis/stackScanAxis helpers (definition order only).
2026-07-29 20:32:42 +05:30
Abhishek Gola 58c28e1e82 wrapper-free GpuMatND forward path 2026-07-29 20:23:02 +05:30
Abhishek Gola 059a93339c code refactoring 2026-07-29 20:23:02 +05:30
Abhishek Gola 12fb9a6c24 using gpuMat instead of backend wrappers 2026-07-29 20:23:02 +05:30
Abhishek Gola 7f63fede4c added unsupported tests to denylist 2026-07-29 20:23:02 +05:30
Abhishek Gola e7dc3a9a9b added support check 2026-07-29 20:23:02 +05:30