Commit Graph

35644 Commits

Author SHA1 Message Date
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
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: 6d889ee74c/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: 7e6da007cd/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`:

6d889ee74c/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