Commit Graph

24137 Commits

Author SHA1 Message Date
Vincent Rabaud
14e0d43550 Fix aruco detector thread safety.
Concurrently writing to a vector<bool> is not thread-safe.
2024-01-02 22:18:35 +01:00
Alexander Smorkalov
9120121dc7
Merge pull request #24793 from Kumataro:fix24792
imgcodecs: suppress warning at test_avif.cpp
2023-12-29 16:27:41 +03:00
Yuriy Chernyshov
21b6f06f9d
Use normal slash in #include 2023-12-29 09:55:25 +01:00
Kumataro
46b3a504cf imgcodecs: suppress warning at test_avif.cpp 2023-12-29 12:58:24 +09:00
Alexander Alekhin
2e3ccb4e8e Merge tag '4.9.0' 2023-12-28 09:29:33 +00:00
Alexander Smorkalov
dad8af6b17 Release 4.9.0. 2023-12-27 19:46:55 +03:00
Alexander Smorkalov
e5b5984f3c Reworked camera stream check to exclude non-video formats. 2023-12-27 17:52:42 +03:00
Alexander Alekhin
49a0877b8c docs: exclude test entites from bindings utils 2023-12-27 06:46:20 +00:00
Alexander Smorkalov
e80b7940ef
Merge pull request #23021 from cudawarped:add_cuda_first_class_support
`cuda`: CMake add CUDA first class language support
2023-12-26 18:24:22 +03:00
Alexander Smorkalov
221b5c086c
Merge pull request #24769 from asmorkalov:as/calib_doc_update
Added exception warning to calibrateCamera description.
2023-12-26 13:27:57 +03:00
cudawarped
7d681cf80d build: first class cuda support 2023-12-26 09:39:18 +03:00
Alexander Smorkalov
03d1760dd5 Added exception warning to calibrateCamera description. 2023-12-26 09:23:11 +03:00
Alexander Smorkalov
8c22b4b54b
Merge pull request #24767 from opencv-pushbot:gitee/alalek/update_ffmpeg_4.x
ffmpeg/4.x: update FFmpeg wrapper 2023.12
2023-12-25 20:55:41 +03:00
Alexander Smorkalov
46792849d4
Merge pull request #24752 from asmorkalov:as/android_aar_with_gradle
Enable Android AAR package build with SDK project itself without Python
2023-12-25 20:38:47 +03:00
Alexander Alekhin
43007af42e ffmpeg/4.x: update FFmpeg wrapper 2023.12 2023-12-25 16:49:17 +00:00
Alexander Smorkalov
b59eca22ae Enable Android AAR package build with SDK project itself without Python
- Added JavaDoc package build and publishing
- Added Source package build and publishing
- More metadata for publishing
- Disable native samples build with aar, because prefab is not complete yet
2023-12-25 18:39:49 +03:00
Alexander Smorkalov
62f1a7410d
Merge pull request #24766 from asmorkalov:update_version_4.9.0-pre
pre: OpenCV 4.9.0 (version++)
2023-12-25 16:04:53 +03:00
Alexander Smorkalov
b407c58b96 pre: OpenCV 4.9.0 (version++). 2023-12-25 15:20:10 +03:00
Yuantao Feng
f978c99523
Merge pull request #24753 from fengyuentau:einsum_importer
dnn onnx: support constaint inputs in einsum importer #24753 

Merge with https://github.com/opencv/opencv_extra/pull/1132.

Resolves https://github.com/opencv/opencv/issues/24697

Credits to @LaurentBerger.

---

This is a workaround. I suggest to get input shapes and calculate the output shapes in `getMemoryShapes` so as to keep the best compatibility. It is not always robust getting shapes during the importer stage and we should avoid that as much as possible.

### 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
2023-12-25 14:42:05 +03:00
Alexander Smorkalov
bb5b5bb24d
Merge pull request #24759 from jubinchheda:4.x
Replace deprecated symbol with AVVideoCodecTypeH264 deprecated since ios11
2023-12-25 13:31:12 +03:00
Alexander Alekhin
c38eff62b4 Merge pull request #24763 from opencv-pushbot:gitee/alalek/test_dnn_skip_update_debug 2023-12-25 09:31:33 +00:00
Kumataro
dba7186378
Merge pull request #24271 from Kumataro:fix24163
Fix to convert float32 to int32/uint32 with rounding to nearest (ties to even). #24271

Fix https://github.com/opencv/opencv/issues/24163

### 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

(carotene is BSD)
2023-12-25 12:17:17 +03:00
Alexander Smorkalov
d9d402916a
Merge pull request #24754 from FantasqueX:refine-png-version-parsing
Refine logic of parsing PNG version
2023-12-25 11:59:05 +03:00
Alexander Alekhin
f49b26182b dnn(test): skip very long debug tests, reduce test time 2023-12-25 08:44:06 +00:00
Alexander Alekhin
96b894e0e1 Merge pull request #24761 from opencv-pushbot:gitee/alalek/test_skip_update_win32 2023-12-25 08:27:30 +00:00
Alexander Alekhin
f8502d45f9 dnn(test): skip tests on 32-bit Windows 2023-12-25 07:23:45 +00:00
JUBIN CHHEDA
049cd86ddd
Replace deprecated symbol with AVVideoCodecTypeH264 2023-12-24 13:43:10 -05:00
Maxim Smolskiy
4884083019
Merge pull request #24667 from MaximSmolskiy:fix-mismatch-and-simplify-code-in-ChessBoardDetector-findQuadNeighbors
Fix mismatch and simplify code in ChessBoardDetector::findQuadNeighbors #24667

### Pull Request Readiness Checklist

Сode doesn't match comment. 
If we want check `1:4` edges ratio and `edge_len` is squared edge length, then we should check
```
ediff > 15*edge_len
```
with constant `15`, not `32`, because
```
ediff > 15*edge_len2 <=> edge_len1 - edge_len2 > 15*edge_len2 <=> edge_len1 > 16*edge_len2 <=> 1:4 edges ratio
```

But for me it's better and simpler to directly check `edge_len1 > 16*edge_len2`

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
2023-12-24 11:45:20 +03:00
Letu Ren
4546f40d8b Refine logic of parsing PNG version
Currently, if `PNG_FOUND`, cmake scripts will check include and parse
header while we can use `PNG_VERSION_STRING` conveniently. If
`BUILD_PNG`, parse version from `PNG_LIBPNG_VER_STRING` directly is more
convenient than parsing major, minor and patch and concatenate them.

The comment of png.h also supports this.
```
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
```
https://github.com/glennrp/libpng/blob/libpng16/png.h#L287

This patch also modifies `ocv_parse_header_version` macro to receive
another parameter to make it more general.

The reason why changing `PNG_VERSION` to `PNG_VERSION_STRING` is to be
consistent with cmake's FindPNG.

This patch removes `HAVE_LIBPNG_PNG_H` variable because `PNG_INCLUDE_DIR`
is where to find png.h, etc according to
https://cmake.org/cmake/help/latest/module/FindPNG.html.

This patch also removes `PNG_PNG_INCLUDE_DIR` variable which is an
advanced variable used in cmake's FindPNG and is not used in opencv.
2023-12-23 16:01:42 +08:00
MaximSmolskiy
315d0f581e Fix typos in imgproc/src/contours.cpp 2023-12-22 22:03:16 +03:00
Alexander Smorkalov
953dddd26b
Merge pull request #24747 from asmorkalov:as/tune_vitb_cuda
Increate Vit_b test threshold a bit for CUDA FP16.
2023-12-22 17:04:46 +03:00
Dmitry Kurtaev
938bc4d503 [CUDA] Hotfix Scale with 1 parameter 2023-12-22 15:49:27 +03:00
Dhanwanth1803
027aee8ad4
Merge pull request #24384 from Dhanwanth1803:feat-crop
Fixes #22747. Support [crop] configuration for DarkNet #24384

Request for comments. This is my first PR. 

**Merge with extra**: https://github.com/opencv/opencv_extra/pull/1112

resolves https://github.com/opencv/opencv/issues/22747

- [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
2023-12-22 14:55:01 +03:00
Alexander Smorkalov
53cd921ab4 Increate Vit_b test threshold a bit for CUDA FP16. 2023-12-22 13:37:44 +03:00
Vadim Pisarevsky
853e5dfcdf
Merge pull request #24709 from vpisarev:winograd_mode
Try to enable Winograd by default in FP32 mode and disable it by default in FP16 mode #24709

Hopefully, it will resolve regressions since 4.8.1 (see also https://github.com/opencv/opencv/pull/24587)

### Pull Request Readiness Checklist

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

- [ ] I agree to contribute to the project under Apache 2 License.
- [ ] 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
2023-12-22 09:22:31 +03:00
Alexander Smorkalov
35e2ef8019
Merge pull request #24740 from opencv-pushbot:gitee/alalek/ocl_fix_kernel_compilation
ocl: fix kernels compilation
2023-12-22 09:20:47 +03:00
Alexander Smorkalov
f5d8245801
Merge pull request #24736 from opencv-pushbot:gitee/alalek/issue_24734
dnn(ocl): don't try KERNEL_TYPE_GEMM_LIKE with kernel_w > 16
2023-12-21 20:01:01 +03:00
Alexander Alekhin
3340c71a2a ocl: fix kernels compilation 2023-12-21 14:29:23 +00:00
Alexander Alekhin
c9bb92d58b dnn(test): tune FP16 test tolerance 2023-12-21 13:39:05 +00:00
Alexander Alekhin
99c94d3d83 dnn(ocl): don't try KERNEL_TYPE_GEMM_LIKE with kernel_w > 16
- OpenCL kernel code doesn't support that
2023-12-21 13:30:57 +00:00
Alexander Smorkalov
40137b2e9e
Merge pull request #24730 from mshabunin:fix-mali-opencl
OCL: fix incompatibility with Mali ruintime
2023-12-21 11:17:38 +03:00
Maksim Shabunin
adde942e34 OCL: fix incompatibility with Mali ruintime 2023-12-21 00:30:44 +03:00
Yuantao Feng
0521a3a384
Merge pull request #24476 from fengyuentau:attention_layer
dnn: add attention layer #24476

Resolves #24609

Merge with: https://github.com/opencv/opencv_extra/pull/1128.

Attention operator spec from onnxruntime: https://github.com/microsoft/onnxruntime/blob/v1.16.1/docs/ContribOperators.md#com.microsoft.Attention.

TODO:
- [x] benchmark (before this PR vs. with this PR vs. ORT).
- [x] Layer fusion: Take care Slice with end=INT64_MAX.
- [x] Layer fusion: match more potential attention (VIT) patterns.
    - [x] Single-head attention is supported.
- [x] Test AttentionSubgraph fusion.
- [x] Add acc tests for VIT_B_32 and VitTrack
- [x] Add perf tests for VIT_B_32 and VitTrack

## Benchmarks

Platform: Macbook Air M1.

### Attention Subgraph

Input scale: [1, 197, 768].

|                        | mean (ms) | median (ms) | min (ms) |
| ---------------------- | --------- | ----------- | -------- |
| w/ Attention (this PR) | 3.75      | 3.68        | 3.22     |
| w/o Attention          | 9.06      | 9.01        | 8.24     |
| ORT (python)           | 4.32      | 2.63        | 2.50     |

### ViTs

All data in millisecond (ms).

| ViTs     | With Attention | Without Attention | ORT    |
| -------- | -------------- | ----------------- | ------ |
| vit_b_16 | 302.77         | 365.35            | 109.70 |
| vit_b_32 | 89.92          | 116.22            | 30.36  |
| vit_l_16 | 1593.32        | 1730.74           | 419.92 |
| vit_l_32 | 468.11         | 577.41            | 134.12 |
| VitTrack | 3.80           | 3.87              | 2.25   |

### 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
2023-12-20 19:35:07 +03:00
thewoz
e64c5dc4c6
Merge pull request #24546 from thewoz:checkerboard
Check Checkerboard Corners #24546

What I did was get you to pull out of findChessboardCorners cornres the whole part that "checks" and sorts the corners of the checkerboard if present.
The main reason for this is that findChessboardCorners is often very slow to find the corners and this depends in that the size the contrast etc of the checkerboards can be very different from each other and writing a function that works on all kinds of images is complicated. 
So I find it very useful to have the ability to write your own code to process the image and then have a function that controls or orders the corners.


### 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
2023-12-20 18:01:39 +03:00
Giles Payne
3d9cb5329c
Merge pull request #24136 from komakai:visionos_support
Add experimental support for Apple VisionOS platform #24136

### 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

This is dependent on cmake support for VisionOs which is currently in progress.
Creating PR now to test that there are no regressions in iOS and macOS builds
2023-12-20 15:35:10 +03:00
Alexander Smorkalov
abbd878eb5
Merge pull request #24576 from AsyaPronina:ot_to_python
Enable GAPI VASOT in Python
2023-12-20 15:26:01 +03:00
Alexander Smorkalov
a61306f79a
Merge pull request #24716 from asmorkalov:as/spng_warning_fix
SPNG integration warning fixes on Windows
2023-12-20 13:34:59 +03:00
Alexander Smorkalov
70b87804cf SPNG integration warning fixes. 2023-12-20 13:09:21 +03:00
Anastasiya Pronina
d20727a5be Enabled VAS OT in G-API Python interface 2023-12-19 17:51:59 +00:00
Laurent Berger
3e6dcdc0a4
Merge pull request #24539 from LaurentBerger:blobrecttoimage
Add blobrecttoimage #24539

### Pull Request Readiness Checklist

resolves https://github.com/opencv/opencv/issues/14659

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 #14659
- [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
2023-12-19 20:00:04 +03:00