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

35402 Commits

Author SHA1 Message Date
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
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 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