Commit Graph

38404 Commits

Author SHA1 Message Date
Abhishek gola
315ddafc6c Fix Sphinx API targets, navigation and documentation warnings 2026-11-16 20:13:32 +05:30
Abhishek Gola
5d112831b5 Optimize CI runtime, enable ci:fast and ci:full (#30802)
* Add risk-aware fast lane to 5.x CI

* Make fast CI the default for 5.x PRs

* Run full CI as a same-commit delta

* Fix RISC-V full-delta dispatch

* Remove CI mode labels after workflow completion

* Handle startup failures in CI label cleanup

* Reset CI mode labels on new commits
2026-11-16 17:09:04 +05:30
Shiven Solanki
7a8d99e6b2 doc(core): note unspecified NaN handling in minMaxLoc and minMaxIdx (#30809) 2026-11-16 09:35:26 +05:30
Abhishek Gola
b3d14b1caf Merge pull request #30774 from tanveer-arch/fix-applycolormap-1x256
imgproc: accept 1x256 user colormap in applyColorMap
2026-11-15 13:35:12 +05:30
Muhammad Usman Mateen
d87ac83e05 dnn: compute LogSoftmax without taking the log of softmax (5.x) 🤖🤖🤖 (#30816)
* dnn: test LogSoftmax far below the maximum

LogSoftmax must give x - max - log(sum(exp(x - max))) for values about 104 or more below the row maximum, where exp underflows in float32. Covers a short row and one long enough for the SIMD loops, on the CPU and OpenCL targets. Port of the test from #30545.

* dnn: compute LogSoftmax without taking the log of softmax

logSoftmax() took the log of the softmax output, so elements whose exp(x - max) underflows came out as -inf. The dispatched softmax kernel already has the row maximum and the sum of exp((x - max) * scale), so softmax() takes a logSoftmax flag and the log path writes (x - max) * scale - log(sum) directly.

The OpenCL kernels had the same problem with LOG_SOFTMAX: they now keep x - max, add up exp(x - max) and return x - max - log(sum). This covers the generic kernels in softmax.cl and the subgroup kernels in softmax_loss.cl.

Port of #30545 to 5.x.
2026-11-15 12:50:26 +05:30
Shiven Solanki
cc26a67b62 doc(core): fix LUT index formula for CV_8S and CV_16S inputs (#30793)
* doc(core): fix LUT index formula for CV_8S and CV_16S inputs

LUT reads CV_8S and CV_16S values as the unsigned numbers with the same bits, so negative values index the upper half of the table (-1 maps to entry 255 for CV_8S). The docs said the index was src + 128 (CV_8S) or src + 32768 (CV_16S), which is wrong for every value. Also remove a stray 'ref' in the compare docs.

* doc(core): fix LUT index rule in HAL interface docs

cv_hal_lut and cv_hal_lut16 docs still said 128 or 32768 is added to the index for 8s and 16s inputs. Use the same rule as the LUT docs: the input is read as unsigned with the same bits, and no offset is added.
2026-11-15 12:49:38 +05:30
Sultan Khan
be7eede9c5 samples: add error check for invalid frame count in application_trace (#30801)
* samples: add error check for invalid frame count in application_trace

* samples: reject only negative frame counts

* samples: clarify frame count messages in application_trace
2026-11-15 12:48:20 +05:30
Madan mohan Manokar
b6185cb365 Merge pull request #30679 from amd/port_5.x_pyrDown
imgproc: port 4.x Optimized OpticalFlowPyrLK to 5.x
2026-11-15 12:40:45 +05:30
mgeethikasaisri09-eng
205613a297 Fix dead links in Python tutorials (#30775)
* Fix dead links in Python tutorials

* Correct tutorial resource links

---------

Co-authored-by: hemanth0107 <hemanth.madala0107@gmail.com>
2026-11-13 18:15:36 +05:30
Shiven Solanki
efe44093c3 Merge pull request #30706 from sshivensolanki/core-locateroi-1d (#30706)
core: fix locateROI and getUMat for 1D Mat and UMat

Problem
For a 1D Mat, Mat::locateROI divides by step[0] (the element size), so it counts every element as a row and returns a wrong wholeSize and offset. Because of this, adjustROI doesn't grow 1D slices, and getUMat on a 1D slice recurses until the stack overflows. UMat::locateROI has the same bug.

Fix
Mat::locateROI and UMat::locateROI: for dims == 1, compute the offset and whole size from the element size: ofs = (delta1 / esz, 0) and wholeSize = (delta2 / esz, 1). The width is clamped to at least ofs.x + cols, like the 2D code.
Mat::getUMat: for a 1D slice, cut the result out of the whole UMat with a Range instead of a Rect, so the returned UMat stays 1D. Cutting with a Rect always made it 2D.
2D Mats and UMats are unchanged.
2026-11-13 16:16:51 +05:30
Abhishek Gola
f62ce23b91 Merge pull request #30655 from sshivensolanki/core-add-sub-64-saturate ( #30655)
core: saturate cv::add and cv::subtract on CV_64S and CV_64UProblem
cv::add and cv::subtract are documented to saturate, and they do on every depth up to 32 bits. On 64 bits there is no wider type to hold the result, so add wrapped on CV_64S and CV_64U, and subtract wrapped on CV_64S. For example, INT64_MAX + 1 gave INT64_MIN. Signed overflow is also undefined behaviour in C++.

Fix
Added int64_t and uint64_t overloads of EwAdd::scl and an int64_t overload of EwSub::scl. They check for overflow before computing the result, like the existing uint64_t overload in EwSub.
Updated the comment on EwAdd::scl, which described 32-bit and 64-bit results as wrapping.
Other depths still use the generic scl, so their behaviour does not change.
2026-11-13 16:15:41 +05:30
Kaustubh Arora
998f72949d dnn: keep INT4/UINT4 QuantizeLinear off the AVX2 per-tensor fast path (#30616)
* dnn: keep INT4/UINT4 QuantizeLinear off the AVX2 per-tensor fast path

The x86 AVX2 path for per-tensor float to int8/uint8 returns before the
4-bit saturation added in #30596, so INT4/UINT4 outputs were still
clamped to the 8-bit range there. Skip it for 4-bit output and add a
per-tensor INT4/UINT4 test that reaches that path on x86.

* dnn: clamp INT4/UINT4 inside the AVX2 per-tensor QuantizeLinear path

Pass the output range into the AVX2 kernel instead of skipping it, so
per-tensor INT4/UINT4 keeps the vectorized, parallel path; the kernel
already clamps in float before converting. The post-pass from #30596
is only reached by the generic path now. Widen the regression test to
35 elements so it covers the 8-lane loop and the scalar tail on x86.

* dnn: drop the PR reference from the INT4 QuantizeLinear test comment

---------

Co-authored-by: Kaustubh Arora <arorakaustubh681@gmail.com>
2026-11-13 16:06:37 +05:30
velonica0
07b31f1e2e video: dis: vectorize Densification_ParBody with scalable intrinsics (#30546)
* video: dis: vectorize Densification_ParBody with scalable intrinsics

* video: dis: address review comments: braces, parameterized test on all platforms

* video: dis: restore useOptimized with a scope guard in the DIS reference test
2026-11-13 15:38:44 +05:30
Shiven Solanki
76bae0c542 core: support CV_16F and CV_16BF in finiteMask (#30620)
* core: support CV_16F and CV_16BF in finiteMask

finiteMask asserted CV_32F or CV_64F input, so 16-bit float arrays,
which can hold NaN and infinity too, could not be checked.

Add finiteMask16_, which marks a pixel as finite if no channel has an
all-ones exponent (0x7c00 for CV_16F, 0x7f80 for CV_16BF), for 1 to 4
channels. getFiniteMaskFunc now takes the depth. The OpenCL kernel only
handles float and double, so other depths fall back to the CPU path.

* core: use SIMD and typed templates in 16-bit finiteMask

Use hfloat and bfloat as the template parameter of finiteMask16_ instead
of the raw exponent masks, and add a universal-intrinsics path for 1 to
4 channels.

Add Core_FiniteMask_bits, which checks exact bit patterns at the edges
of the exponent: largest finite, subnormal, signalling, quiet and
negative NaN, and both infinities.

* core: use the scalar loop for 1-channel 16-bit finiteMask

With 1 channel, the compiler vectorizes the scalar loop, and it runs
faster than the explicit SIMD path. Use the SIMD path only for 2 to 4
channels.
2026-11-13 15:36:54 +05:30
Shiven Solanki
6519feb194 Merge pull request #30778 from sshivensolanki/fix-flip-1d (#30778)
core: keep 1D Mat 1D in cv::flip
2026-11-13 14:35:35 +05:30
Abhishek Gola
1ea6b2b662 Merge pull request #29904 from rsnk96/farneback-reuse-polyexp
video: reuse the polynomial expansion between Farneback optical flow calls 🤖🤖🤖
2026-11-13 13:32:19 +05:30
Minsoo Kim
f7375101ab Document BORDER_TRANSPARENT for warpPerspective 🤖🤖🤖 (#29765)
* Document transparent border for warpPerspective

* Keep warpPerspective clarification documentation-only

Remove the focused transparent-border test as requested in review. Preserve the documented border behavior and leave the existing image-warp test suite unchanged.
2026-11-13 08:19:44 +05:30
Shiven Solanki
fcfa24dfb7 core: support 1D Mat inputs in gemm (#30704)
* core: support 1D Mat inputs in gemm

A 1D Mat is a single row, but its step[0] is the element size, not the row size, so gemm passed a too-small row step to the HAL kernels and failed with "_step >= minstep". Give 1D A, B and C an ordinary 2D one-row header before calling the kernels.

Fixes #30703

* core: support preallocated 1D output in gemm

When the caller passes a 1D Mat of the right size as the output, _matD.create() keeps it as is, so D still had step[0] == elemSize() and the kernel failed with "_step >= minstep". Give a 1D D a 2D one-row header too. The result is still written into the caller's buffer.

* core: use TEST_P for the 1D gemm test
2026-11-13 08:17:17 +05:30
Lalesh Kumar Raj
1769ffa78e DOC: Update outdated vendor links (#30760)
* DOC: Update outdated vendor links

* DOC: Update MFX library references

* Fix Qt download link in Windows installation guide

Updated the link for Qt downloads to the archive page.
2026-11-13 08:15:15 +05:30
MEG-1453
5033ae460f Merge pull request #30772 from MEG-1453/trackernano-small-targets (#30772)
video(TrackerNano): do not clamp the target size to 10 px
2026-11-13 07:45:40 +05:30
Abhishek Gola
bb1bcfd583 Merge pull request #30789 from Aletimo03/pnp-ransac-planar-27098-5x (#30789)
geometry: fix solvePnPRansac returning the mirrored pose of planar objects
2026-11-13 07:44:57 +05:30
Abhishek Gola
d45a6e48e2 Merge pull request #30779 from sshivensolanki/doc-core-unsupported-depths (#30779)
doc(core): note unsupported input depths in inRange and addWeighted
2026-11-12 23:26:12 +05:30
Abhishek Gola
15df4a8f11 Merge pull request #30780 from sultan-ai-and-ml/fix-dead-eigen-link
docs: fix dead Eigen download link in windows_install
2026-11-12 23:24:51 +05:30
Abhishek Gola
dedf72c0d8 Merge pull request #30768 from abhishek-gola/fix_doc_version_selector
docs: fix shared documentation version selector
2026-11-12 23:09:29 +05:30
Alessio Timofte
d9ab52e4ad geometry: fix solvePnPRansac returning the mirrored pose of planar objects
Port of #30434 to 5.x. Since 4.7.0 the final SOLVEPNP_ITERATIVE
refinement starts from the minimal sample model. For a planar object
this model can be the mirrored pose, and Levenberg-Marquardt stays in
that local minimum. For planar inliers, also refine from the homography
based initialization of SOLVEPNP_ITERATIVE and keep the pose with the
lower reprojection error. Non-planar objects are not affected.

Fixes #27098
2026-11-12 11:42:07 +01:00
Tanveer
38f42fcaa5 imgproc: accept 1x256 user colormap in applyColorMap 2026-11-12 13:36:46 +05:30
RS Nikhil Krishna
75ff081cfb video: reuse the polynomial expansion between Farneback calls
Add OPTFLOW_FARNEBACK_REUSE_EXPANSION, an opt-in flag set through
FarnebackOpticalFlow::setFlags() / create(..., flags). When set, calc() keeps
the polynomial expansion of the previous call's next frame and reuses it as
the expansion of the following call's prev frame, which saves roughly 9-14%
on consecutive-frame sequences. Results are bit-identical with reuse on and
off. The flag adds no virtual methods, is ignored by calcOpticalFlowFarneback()
and by the OpenCL path, and clearing it or calling collectGarbage() frees the
cache.

Tests go into test_OF_accuracy.cpp and test_OF_reproducibility.cpp and seed
their data from theRNG(). Includes a perf test and a tutorial section.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 22:32:58 -05:00
Sultan Khan
0864fff954 docs: fix dead Eigen download link in windows_install 2026-11-12 02:19:12 +00:00
Shiven Solanki
a20d208db5 doc(core): note unsupported input depths in inRange and addWeighted
inRange rejects CV_Bool and CV_8F inputs and addWeighted rejects CV_Bool inputs, but the docs did not say so. Also fix type-name typos in core.hpp (CV8S, CV_8S1) and two other spelling mistakes.
2026-11-12 07:55:35 +08:00
Abhishek Gola
8d6ab34d40 docs: fix shared documentation version selector
Signed-off-by: Abhishek Gola <abhishek.gola@bigvisionllc.com>
2026-11-11 19:11:03 +05:30
Abhishek Gola
247ea5144d doc: add 5.2.0-dev and 4.14.0 to version list, derive sphinx release from version.hpp (#30762)
Signed-off-by: Abhishek Gola <abhishek.gola@bigvisionllc.com>
2026-11-11 17:39:17 +05:30
Shiven Solanki
2404ce75c1 core: add insertChannel and extractChannel test for all depths (#30625)
* core: add insertChannel and extractChannel test for all depths

insertChannel had no CPU test that checks its values, and extractChannel
was only checked on CV_8UC3. Add a test for every depth with 2 to 4
channels: inserting into one channel must leave the others unchanged,
and extractChannel must return the inserted channel.

* core: use CV_DEPTH_CURR_MAX in insertChannel test

Cover every depth with a range instead of listing them by hand, so new
depths are tested automatically.
2026-11-11 14:45:51 +05:30
Christos
8d9f0cb447 Merge pull request #30738 from cstamatopoulos/xfeat-reference-sampling (#30738 )
features: sample cv::XFeat maps like the reference XFeat
2026-11-11 12:57:40 +05:30
Alexander Smorkalov
b40403497a Merge pull request #30755 from vansh917917:docs/ksize-clarifications
docs(imgproc): clarify ksize range and FILTER_SCHARR in corner and Laplacian APIs
2026-11-11 10:30:02 +04:00
Abhishek Gola
d41753188a Merge pull request #30748 from Hisernberg/docs/fix-openexr-download-link
Fix dead OpenEXR downloads link in Windows install guide
2026-11-11 10:25:47 +05:30
Abhishek Gola
b4aed07736 Merge pull request #30749 from Hisernberg/docs/fix-text-spotting-paper-link
Fix malformed arXiv markdown link in text spotting tutorial
2026-11-11 10:25:09 +05:30
Abhishek Gola
754fad5072 Merge pull request #30750 from Hisernberg/docs/fix-earthexplorer-link
Fix duplicated URL scheme in raster I/O GDAL tutorial
2026-11-11 10:24:47 +05:30
Abhishek Gola
f6211c548e Merge pull request #30746 from Prasadayus/optimize/ppl-arm64-rebalance
core: replace ARM64 PPL's static partitioning with adaptive self-scheduling
2026-11-11 10:24:16 +05:30
vansh917917
e7c0a614f9 docs(imgproc): clarify ksize range and FILTER_SCHARR in corner and Laplacian APIs
Signed-off-by: vansh917917 <vanshg917@gmail.com>
2026-11-10 19:20:43 +05:30
Nabid Nur
51a9d4c518 Fix duplicated URL scheme in EarthExplorer link 2026-11-10 19:38:29 +06:00
Nabid Nur
84ee24c8bc Fix malformed arXiv link in DNN text spotting tutorial 2026-11-10 19:38:24 +06:00
Nabid Nur
5c49e76ed0 Fix dead OpenEXR downloads link 2026-11-10 19:38:17 +06:00
Prasadayus
fc776d14a2 core: replace ARM64 PPL's static partitioning with adaptive self-scheduling 2026-11-10 18:25:23 +05:30
Abhishek Gola
370175b3bd Merge pull request #30624 from sshivensolanki/core-lut-test-bool
core: remove CV_Bool conversion from LUT tests
2026-11-10 16:23:21 +05:30
Abhishek Gola
e2eac555df Merge pull request #30724 from pbkx/port-seamless-cloning-mask-preservation-5x
photo: preserve input masks in seamless cloning APIs
2026-11-10 16:22:21 +05:30
Abhishek Gola
25029079fb Merge pull request #30732 from sshivensolanki/core-norm-absdiff-64s
core: fix cv_absdiff overflow for int64 in norm of CV_64S
2026-11-10 16:20:14 +05:30
Alexander Smorkalov
06ed129364 Merge pull request #30736 from abhishek-gola/fix/east-text-detection-30730
samples: use fixed ONNX input size for EAST text detection
2026-11-10 12:26:35 +04:00
Abhishek gola
688c406431 samples: use fixed ONNX input size for EAST text detection 2026-11-10 08:50:59 +05:30
Pratham Kumar
c261e6e4b4 imgproc: vectorize alphaComposite row kernel with universal intrinsics (#30471)
* imgproc: vectorize alphaComposite row kernel with universal intrinsics

* use CV_ALWAYS_INLINE for alphaComposite SIMD helpers
2026-11-10 08:49:56 +05:30
Shiven Solanki
f5f76c0786 core: fix cv_absdiff overflow for int64 in norm of CV_64S
Fixes #30731
2026-11-10 00:32:38 +08:00