Commit Graph

24305 Commits

Author SHA1 Message Date
Aser Atawya
240b245105
Merge pull request #24092 from Aser-Abdelfatah:GSoC_Support_GatherElements_ONNX
GSoC Add ONNX Support for GatherElements #24092

Merge with: https://github.com/opencv/opencv_extra/pull/1082
Adds support to the ONNX operator GatherElements [operator docs](https://github.com/onnx/onnx/blob/main/docs/Operators.md#GatherElements)
Added tests to opencv_extra at pull request https://github.com/opencv/opencv_extra/pull/1082

### 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-10-18 10:41:47 +03:00
Maksim Shabunin
c6fa9931ed Updated libade to 0.1.2d 2023-10-18 09:40:53 +03:00
alexlyulkov
014e8485b5
Merge pull request #24367 from alexlyulkov:al/fixed-cumsum-inplace-flag
Fixed CumSum layer inplace flag #24367

When exclusive is false:
dst[i] = dst[i-1] + src[i]
When exclusive is true:
dst[i] = dst[i-1] + src[i-1]
So CumSum layer can be inplace only when exclusive flag is false.
2023-10-18 09:21:40 +03:00
Alexander Smorkalov
14b21f7271 Ensure interarea algorithm usage in resize perfomance test. 2023-10-17 09:43:15 +03:00
Alexander Smorkalov
3ebcd94535 Added test with V4L CAP_PROP_CONVERT_RGB=false.
Co-authored-by: Maksim Shabunin <maksim.shabunin@gmail.com>
2023-10-16 10:20:18 +03:00
Liutong HAN
a287605c3e Clean up the Universal Intrinsic API. 2023-10-13 19:23:30 +08:00
Yuantao Feng
0507043a55
Merge pull request #24386 from fengyuentau:fix_dtype_nary_eltwise
dnn: fix inconsistent input dtype for nary eltwise layers #24386

Resolves https://github.com/opencv/opencv/issues/24385
Merge with https://github.com/opencv/opencv_extra/pull/1107
Relates https://github.com/opencv/opencv/pull/24092#discussion_r1353964405

### 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-10-13 11:56:18 +03:00
Alexander Smorkalov
58285e5468
Merge pull request #24359 from asmorkalov:as/FastNeuralStyle_eccv16_tuning
Tuned threshold for FastNeuralStyle_eccv16 test
2023-10-13 10:29:41 +03:00
Alexander Smorkalov
cd7cbe3d41
Merge pull request #24324 from hanliutong:rewrite-fluid
Rewrite Universal Intrinsic code: gapi module (fluid part).
2023-10-13 10:25:07 +03:00
Alexander Smorkalov
b3d3acf75f
Merge pull request #24370 from LiuPeiqiCN:4.x
Fix imshow icons missing when linking the static opencv library
2023-10-12 21:57:41 +03:00
Dmitry Kurtaev
5ddf3de4ce
Merge pull request #24350 from dkurt:py_return_non_utf8_string
Encode QR code data to UTF-8 #24350

### Pull Request Readiness Checklist

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

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

This is first PR in a series. Here we just return a raw Unicode. Later I will try expand QR codes decoding methods to use ECI assignment number and return a string with proper encoding, not only UTF-8 or raw unicode.

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-10-12 17:39:57 +03:00
Alexander Smorkalov
3859ac921a
Merge pull request #24355 from AleksandrPanov:dynamic_window_in_aruco_cornerRefinement
add dynamic window in aruco cornerRefinement
2023-10-12 10:52:56 +03:00
Alexander Smorkalov
7e17f01b7b
Merge pull request #24368 from mshabunin:rvv-clang-17
RISC-V: added v0.12 intrinsics compatibility header
2023-10-12 10:28:54 +03:00
definitelyuncertain
a1028efdcf
Merge pull request #24333 from definitelyuncertain:CvtRGB2YUV422
Implement color conversion from RGB to YUV422 family #24333

Related PR for extra: https://github.com/opencv/opencv_extra/pull/1104

Hi,

This patch provides CPU and OpenCL implementations of color conversions from RGB/BGR to YUV422 family (such as UYVY and YUY2).

These features would come in useful for enabling standard RGB images to be supplied as input to algorithms or networks that make use of images in YUV422 format directly (for example, on resource constrained devices working with camera images captured in YUV422).

The code, tests and perf tests are all written following the existing pattern. There is also an example `bin/example_cpp_cvtColor_RGB2YUV422` that loads an image from disk, converts it from BGR to UYVY and then back to BGR, and displays the result as a visual check that the conversion works.

The OpenCL performance for the forward conversion implemented here is the same as the existing backward conversion on my hardware. The CPU implementation, unfortunately, isn't very optimized as I am not yet familiar with the SIMD code.

Please let me know if I need to fix something or can make other modifications.

Thanks!

### 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
- [x] The feature is well documented and sample code can be built with the project CMake
2023-10-12 10:18:24 +03:00
Yuantao Feng
590f150d5e
dnn: hotfixes for fast gemm (#24315)
* remove Conformance from test names

* integrate neon optimization into default

* quick fix: define CV_NEON_AARCH64 0 for non NEON platforms

* remove var batch that leads to memory leak

* put neon code back to fast_gemm_kernels.simd

* reorganize code to reduce duplicate code
2023-10-07 21:48:44 +03:00
刘佩其
631f229827 Fix the issue of missing imshow icons when linking OpenCV as a static library (https://github.com/opencv/opencv-python/issues/585) 2023-10-07 11:18:32 +08:00
Maksim Shabunin
8edf37903d RISC-V: added v0.12 intrinsics compatibility header 2023-10-06 20:16:57 +03:00
Alex
fd4af21350 add dynamic window in aruco cornerRefinement 2023-10-06 16:44:09 +03:00
Sean McBride
5fb3869775
Merge pull request #23109 from seanm:misc-warnings
* Fixed clang -Wnewline-eof warnings
* Fixed all trivial clang -Wextra-semi and -Wc++98-compat-extra-semi warnings
* Removed trailing semi from various macros
* Fixed various -Wunused-macros warnings
* Fixed some trivial -Wdocumentation warnings
* Fixed some -Wdocumentation-deprecated-sync warnings
* Fixed incorrect indentation
* Suppressed some clang warnings in 3rd party code
* Fixed QRCodeEncoder::Params documentation.

---------

Co-authored-by: Alexander Smorkalov <alexander.smorkalov@xperience.ai>
2023-10-06 13:33:21 +03:00
jvuillaumier
24fd39538e
Merge pull request #24233 from jvuillaumier:rotate_flip_hal_hooks
Add HAL implementation hooks to cv::flip() and cv::rotate() functions from core module #24233

Hello,

This change proposes the addition of HAL hooks for cv::flip() and cv::rotate() functions from OpenCV core module.
Flip and rotation are functions commonly available from 2D hardware accelerators. This is convenient provision to enable custom optimized implementation of image flip/rotation on systems embedding such accelerator.

Thank you

### 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-10-06 12:31:53 +03:00
HAN Liutong
07bf9cb013
Merge pull request #24325 from hanliutong:rewrite
Rewrite Universal Intrinsic code: float related part #24325

The goal of this series of PRs is to modify the SIMD code blocks guarded by CV_SIMD macro: rewrite them by using the new Universal Intrinsic API.

The series of PRs is listed below:
#23885 First patch, an example
#23980 Core module
#24058 ImgProc module, part 1
#24132 ImgProc module, part 2
#24166 ImgProc module, part 3
#24301 Features2d and calib3d module
#24324 Gapi module

This patch (hopefully) is the last one in the series. 

This patch mainly involves 3 parts
1. Add some modifications related to float (CV_SIMD_64F)
2. Use `#if (CV_SIMD || CV_SIMD_SCALABLE)` instead of `#if CV_SIMD || CV_SIMD_SCALABLE`, 
    then we can get the `CV_SIMD` module that is not enabled for `CV_SIMD_SCALABLE` by looking for `if CV_SIMD`
3. Summary of `CV_SIMD` blocks that remains unmodified: Updated comments
    - Some blocks will cause test fail when enable for RVV, marked as `TODO: enable for CV_SIMD_SCALABLE, ....`
    - Some blocks can not be rewrited directly. (Not commented in the source code, just listed here)
      - ./modules/core/src/mathfuncs_core.simd.hpp (Vector type wrapped in class/struct)
      - ./modules/imgproc/src/color_lab.cpp (Array of vector type)
      - ./modules/imgproc/src/color_rgb.simd.hpp (Array of vector type)
      - ./modules/imgproc/src/sumpixels.simd.hpp (fixed length algorithm, strongly ralated with `CV_SIMD_WIDTH`)
      These algorithms will need to be redesigned to accommodate scalable backends.

### 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-10-05 17:57:25 +03:00
Dmitry Kurtaev
2c92eb3175 Enable more tests for OpenVINO 2023.0 2023-10-05 12:51:55 +03:00
Alexander Smorkalov
33d64d0491 Tuned threshold for FastNeuralStyle_eccv16 test for systems without AVX2. 2023-10-04 16:19:13 +03:00
Alexander Smorkalov
7b6d65cf20
Merge pull request #24337 from mshabunin:bump-ade-012c
3rdparty: update ade version
2023-10-04 14:59:16 +03:00
Wanli
62b5470b78
Merge pull request #24298 from WanliZhong:extend_perf_net_test
Extend performance test models #24298

**Merged With https://github.com/opencv/opencv_extra/pull/1095**

This PR aims to extend the performance tests. 

- **YOLOv5** for object detection
- **YOLOv8** for object detection
- **EfficientNet** for classification

Models from OpenCV Zoo:

- **YOLOX** for object detection
- **YuNet** for face detection
- **SFace** for face recognization
- **MPPalm** for palm detection
- **MPHand** for hand landmark
- **MPPose** for pose estimation
- **ViTTrack** for object tracking
- **PPOCRv3** for text detection
- **CRNN** for text recognization
- **PPHumanSeg** for human segmentation

If other models should be added, **please leave some comments**. Thanks!



Build opencv with script:
```shell
-DBUILD_opencv_python2=OFF
-DBUILD_opencv_python3=OFF
-DBUILD_opencv_gapi=OFF
-DINSTALL_PYTHON_EXAMPLES=OFF
-DINSTALL_C_EXAMPLES=OFF
-DBUILD_DOCS=OFF
-DBUILD_EXAMPLES=OFF
-DBUILD_ZLIB=OFF
-DWITH_FFMPEG=OFF
```



Performance Test on **Apple M2 CPU**
```shell
MacOS 14.0
8 threads
```

**1 thread:**
| Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th |
|--------------|:---------:|:---------:|:---------:|:---------:|:---------:|
| CRNN         |  76.244   |  76.611   |  62.534   |  57.678   |  57.238   |
| EfficientNet |    ---    |    ---    |  109.224  |  130.753  |  109.076  |
| MPHand       |    ---    |    ---    |  19.289   |  22.727   |  27.593   |
| MPPalm       |  47.150   |  47.061   |  41.064   |  65.598   |  40.109   |
| MPPose       |    ---    |    ---    |  26.592   |  32.022   |  26.956   |
| PPHumanSeg   |  41.672   |  41.790   |  27.819   |  27.212   |  30.461   |
| PPOCRv3      |    ---    |    ---    |  140.371  |  187.922  |  170.026  |
| SFace        |  43.830   |  43.834   |  27.575   |  30.653   |  26.387   |
| ViTTrack     |    ---    |    ---    |    ---    |  14.617   |  15.028   |
| YOLOX        | 1060.507  | 1061.361  |  495.816  |  533.309  |  549.713  |
| YOLOv5       |    ---    |    ---    |    ---    |  191.350  |  193.261  |
| YOLOv8       |    ---    |    ---    |  198.893  |  218.733  |  223.142  |
| YuNet        |  27.084   |  27.095   |  26.238   |  30.512   |  34.439   |
| MobileNet_SSD_Caffe         |  44.742   |  44.565   |  33.005   |  29.421   |  29.286   |
| MobileNet_SSD_v1_TensorFlow |  49.352   |  49.274   |  35.163   |  32.134   |  31.904   |
| MobileNet_SSD_v2_TensorFlow |  83.537   |  83.379   |  56.403   |  42.947   |  42.148   |
| ResNet_50                   |  148.872  |  148.817  |  77.331   |  67.682   |  67.760   |


**n threads:**
| Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth |
|--------------|:---------:|:---------:|:---------:|:---------:|:---------:|
| CRNN         |  44.262   |  44.408   |  41.540   |  40.731   |  41.151   |
| EfficientNet |    ---    |    ---    |  28.683   |  42.676   |  38.204   |
| MPHand       |    ---    |    ---    |   6.738   |  13.126   |   8.155   |
| MPPalm       |  16.613   |  16.588   |  12.477   |  31.370   |  17.048   |
| MPPose       |    ---    |    ---    |  12.985   |  19.700   |  16.537   |
| PPHumanSeg   |  14.993   |  15.133   |  13.438   |  15.269   |  15.252   |
| PPOCRv3      |    ---    |    ---    |  63.752   |  85.469   |  76.190   |
| SFace        |  10.685   |  10.822   |   8.127   |   8.318   |   7.934   |
| ViTTrack     |    ---    |    ---    |    ---    |  10.079   |   9.579   |
| YOLOX        |  417.358  |  422.977  |  230.036  |  234.662  |  228.555  |
| YOLOv5       |    ---    |    ---    |    ---    |  74.249   |  75.480   |
| YOLOv8       |    ---    |    ---    |  63.762   |  88.770   |  70.927   |
| YuNet        |   8.589   |   8.731   |  11.269   |  16.466   |  14.513   |
| MobileNet_SSD_Caffe         |  12.575   |  12.636   |  11.529   |  12.114   |  12.236   |
| MobileNet_SSD_v1_TensorFlow |  13.922   |  14.160   |  13.078   |  12.124   |  13.298   |
| MobileNet_SSD_v2_TensorFlow |  25.096   |  24.836   |  22.823   |  20.238   |  20.319   |
| ResNet_50                   |  41.561   |  41.296   |  29.092   |  30.412   |  29.339   |


Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html)
```shell
Ubuntu 22.04.2 LTS
8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz)
4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz)
20 threads
```


**1 thread:**
| Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th |
|--------------|:---------:|:---------:|:---------:|:---------:|:---------:|
| CRNN         |  16.752   |  16.851   |  16.840   |  16.625   |  16.663   |
| EfficientNet |    ---    |    ---    |  61.107   |  76.037   |  53.890   |
| MPHand       |    ---    |    ---    |   8.906   |   9.969   |   8.403   |
| MPPalm       |  24.243   |  24.638   |  18.104   |  35.140   |  18.387   |
| MPPose       |    ---    |    ---    |  12.322   |  16.515   |  12.355   |
| PPHumanSeg   |  15.249   |  15.303   |  10.203   |  10.298   |  10.353   |
| PPOCRv3      |    ---    |    ---    |  87.788   |  144.253  |  90.648   |
| SFace        |  15.583   |  15.884   |  13.957   |  13.298   |  13.284   |
| ViTTrack     |    ---    |    ---    |    ---    |  11.760   |  11.710   |
| YOLOX        |  324.927  |  325.173  |  235.986  |  253.653  |  254.472  |
| YOLOv5       |    ---    |    ---    |    ---    |  102.163  |  102.621  |
| YOLOv8       |    ---    |    ---    |  87.013   |  103.182  |  103.146  |
| YuNet        |  12.806   |  12.645   |  10.515   |  12.647   |  12.711   |
| MobileNet_SSD_Caffe         |  23.556   |  23.768   |  24.304   |  22.569   |  22.602   |
| MobileNet_SSD_v1_TensorFlow |  26.136   |  26.276   |  26.854   |  24.828   |  24.961   |
| MobileNet_SSD_v2_TensorFlow |  43.521   |  43.614   |  46.892   |  44.044   |  44.682   |
| ResNet_50                   |  73.588   |  73.501   |  75.191   |  66.893   |  65.144   |


**n thread:**
| Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | 
|--------------|:---------:|:---------:|:---------:|:---------:|:---------:|
| CRNN         |   8.665   |   8.827   |  10.643   |   7.703   |   7.743   | 
| EfficientNet |    ---    |    ---    |  16.591   |  12.715   |   9.022   |   
| MPHand       |    ---    |    ---    |   2.678   |   2.785   |   1.680   |           
| MPPalm       |   5.309   |   5.319   |   3.822   |  10.568   |   4.467   |       
| MPPose       |    ---    |    ---    |   3.644   |   6.088   |   4.608   |        
| PPHumanSeg   |   4.756   |   4.865   |   5.084   |   5.179   |   5.148   |        
| PPOCRv3      |    ---    |    ---    |  32.023   |  50.591   |  32.414   |      
| SFace        |   3.838   |   3.980   |   4.629   |   3.145   |   3.155   |       
| ViTTrack     |    ---    |    ---    |    ---    |  10.335   |  10.357   |   
| YOLOX        |  68.314   |  68.081   |  82.801   |  74.219   |  73.970   |      
| YOLOv5       |    ---    |    ---    |    ---    |  47.150   |  47.523   |    
| YOLOv8       |    ---    |    ---    |  32.195   |  30.359   |  30.267   |    
| YuNet        |   2.604   |   2.644   |   2.622   |   3.278   |   3.349   |    
| MobileNet_SSD_Caffe         |  13.005   |   5.935   |   8.586   |   4.629   |   4.713   |
| MobileNet_SSD_v1_TensorFlow |   7.002   |   7.129   |   9.314   |   5.271   |   5.213   |
| MobileNet_SSD_v2_TensorFlow |  11.939   |  12.111   |  22.688   |  12.038   |  12.086   |
| ResNet_50                   |  18.227   |  18.600   |  26.150   |  15.584   |  15.706   |
2023-10-04 13:05:32 +03:00
Alexander Smorkalov
670c52f75e
Merge pull request #24356 from VadimLevin:dev/vlevin/typing-re-export
feat: re-export cv2.typing module as typing
2023-10-04 09:14:51 +03:00
Alexander Smorkalov
6bcf3d4311
Merge pull request #24354 from asmorkalov:as/charuco_ub
Removed invalid reference usage in charuco detector
2023-10-03 17:45:42 +03:00
Dmitry Kurtaev
d752bac43f
Merge pull request #24234 from dkurt:distanceTransform_max_dist
Change max distance at distanceTransform #24234

### Pull Request Readiness Checklist

resolves https://github.com/opencv/opencv/issues/23895
related: https://github.com/opencv/opencv/pull/12278

* DIST_MASK_3 and DIST_MASK_5 maximal distance increased from 8192 to 65533 +/- 1
* Fix squares processing at DIST_MASK_PRECISE
* - [ ] TODO: Check with IPP

```cpp
    cv::Mat gray = cv::imread("opencv/samples/data/stuff.jpg", cv::ImreadModes::IMREAD_GRAYSCALE);

    cv::Mat gray_resize;
    cv::resize(gray, gray_resize, cv::Size(70000,70000), 0.0, 0.0, cv::INTER_LINEAR);

    gray_resize = gray_resize >= 100;

    cv::Mat dist;
    cv::distanceTransform(gray_resize, dist, cv::DIST_L2, cv::DIST_MASK_5, CV_32F);

    double minVal, maxVal;
    minMaxLoc(dist, &minVal, &maxVal);
    dist = 255 * (dist - minVal) / (maxVal - minVal);
    std::cout << minVal << " " << maxVal << std::endl;

    cv::Mat dist_resize;
    cv::resize(dist, dist_resize, cv::Size(1024,1024), 0.0, 0.0, cv::INTER_LINEAR);

    cv::String outfilePath = "test_mask_5.png";
    cv::imwrite(outfilePath, dist_resize);
```

mask | 4.x | PR |
----------|--------------|--------------
DIST_MASK_3 | <img src="https://github.com/opencv/opencv/assets/25801568/23e5de76-a8ba-4eb8-ab03-fa55672834be" width="128"> | <img src="https://github.com/opencv/opencv/assets/25801568/e1149f6a-49d6-47bd-a2a8-20bb7e4dafa4" width="128"> |
DIST_MASK_5 | <img src="https://github.com/opencv/opencv/assets/25801568/98aba29b-8865-4b9a-8066-669b16d175c9" width="128"> | <img src="https://github.com/opencv/opencv/assets/25801568/54f62ed2-9ef6-485f-bd63-48cc96accd7d" width="128"> |
DIST_MASK_PRECISE | <img src="https://github.com/opencv/opencv/assets/25801568/c4d79451-fd7a-461f-98fc-13060c63f473" width="128"> | <img src="https://github.com/opencv/opencv/assets/25801568/b5bfcaf5-bc48-40ba-b8e3-d000e5ab48db" width="128">|

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-10-03 17:23:32 +03:00
Maksim Shabunin
1bccc14e05
Merge pull request #24343 from mshabunin:fix-test-writes
Fix tests writing to current work dir #24343

Several tests were writing files in the current work directory and did not clean up after test. Moved all temporary files to the `/tmp` dir and added a cleanup code.
2023-10-03 16:34:25 +03:00
Yuriy Chernyshov
9f74982a54
Merge pull request #24323 from georgthegreat:akaze-variadic 2023-10-03 16:16:41 +03:00
Vadim Levin
4708d1aed7 feat: re-export cv2.typing module as typing
Import Python typing module as `_typing` to avoid name clashes.
2023-10-03 14:12:55 +03:00
alexlyulkov
9bd14d5417
Merge pull request #24353 from alexlyulkov:al/fixed-cumsum-layer
Fixed CumSum dnn layer #24353

Fixes #20110

The algorithm had several errors, so I rewrote it.
Also the layer didn't work with non constant axis tensor. Fixed it.
Enabled CumSum layer tests from ONNX conformance.
2023-10-03 13:58:25 +03:00
Alexander Smorkalov
c497fe05a0 Removed invalid reference usage in charuco detector. 2023-10-03 11:31:48 +03:00
Alexander Smorkalov
4e60392040
Merge pull request #24349 from AleksandrPanov:aruco_check_board_separation
add aruco board separation check
2023-10-03 10:00:03 +03:00
Alex
e5b114e5b8 Added ArUco marker size check for Aruco and Charuco boards. 2023-10-03 09:16:07 +03:00
Alexander Smorkalov
63819c1e1f
Merge pull request #24342 from asmorkalov:as/java_test_status
Fail Java test suite, execution, if one of test failed.
2023-10-02 09:17:11 +03:00
Alexander Smorkalov
2af5815d47 Fail Java test suite, execution, if one of test failed. 2023-10-01 18:31:04 +03:00
Alexander Smorkalov
5caee5cc64 Fixed OpenCL PF16 fallback in Einsum layer. 2023-09-29 15:52:23 +03:00
Dmitry Kurtaev
c7ec0d599a
Merge pull request #23987 from dkurt:openvino_int8_backend
OpenVINO backend for INT8 models #23987

### Pull Request Readiness Checklist

TODO:
- [x] DetectionOutput layer (https://github.com/opencv/opencv/pull/24069)
- [x] Less FP32 fallbacks (i.e. Sigmoid, eltwise sum)
- [x] Accuracy, performance tests (https://github.com/opencv/opencv/pull/24039)
- [x] Single layer tests (convolution)
- [x] ~~Fixes for OpenVINO 2022.1 (https://pullrequest.opencv.org/buildbot/builders/precommit_custom_linux/builds/100334)~~


Performace results for object detection model `coco_efficientdet_lite0_v1_1.0_quant_2021_09_06.tflite`:
| backend | performance (median time) |
|---|---|
| OpenCV | 77.42ms |
| OpenVINO 2023.0 | 10.90ms |

CPU: `11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz`

Serialized model per-layer stats (note that Convolution should use `*_I8` primitives if they are quantized correctly): https://gist.github.com/dkurt/7772bbf1907035441bb5454f19f0feef

---

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-09-28 16:24:43 +03:00
Alexander Smorkalov
b8d4ac589d
Merge pull request #24334 from fengyuentau:fix_24319
dnn onnx: fix not-found constant indices for Gather if shared
2023-09-28 13:08:26 +03:00
Maksim Shabunin
0433fe539c 3rdparty: update ade version 2023-09-28 12:45:34 +03:00
fengyuentau
7fa0493ca0 init commit 2023-09-28 11:50:21 +08:00
casualwinds
7b399c4248
Merge pull request #24280 from casualwind:parallel_opt
Optimization for parallelization when large core number #24280

**Problem description:**
When the number of cores is large, OpenCV’s thread library may reduce performance when processing parallel jobs.

**The reason for this problem:**
When the number of cores (the thread pool initialized the threads, whose number is as same as the number of cores) is large, the main thread will spend too much time on waking up unnecessary threads.
When a parallel job needs to be executed, the main thread will wake up all threads in sequence, and then wait for the signal for the  job completion after waking up all threads. When the number of threads is larger than the parallel number of a job slices, there will be a situation where the main thread wakes up the threads in sequence and the awakened threads have completed the job, but the main thread is still waking up the other threads. The threads woken up by the main thread after this have nothing to do, and the broadcasts made by the waking threads take a lot of time, which reduce the performance.

**Solution:**
Reduce the time for the process of main thread waking up the worker threads through the following two methods:

•	The number of threads awakened by the main thread should be adjusted according to the parallel number of a job slices. If the number of threads is greater than the number of the parallel number of job slices, the total number of threads awakened should be reduced.
•	In the process of waking up threads in sequence, if the main thread finds that all parallel job slices have been allocated, it will jump out of the loop in time and wait for the signal for the job completion.

**Performance Test:**
The tests were run in the manner described by https://github.com/opencv/opencv/wiki/HowToUsePerfTests.
At core number =  160, There are big performance gain in some cases.

Take the following cases in the video module as examples:

OpticalFlowPyrLK_self::Path_Idx_Cn_NPoints_WSize_Deriv::("cv/optflow/frames/VGA_%02d.png", 2, 1, (9, 9), 11, true)
Performance improves 191%:0.185405ms ->0.0636496ms
perf::DenseOpticalFlow_VariationalRefinement::(320x240, 10, 10)
Performance improves 112%:23.88938ms -> 11.2562ms  
Among all the modules, the performance improvement is greatest on module video, and there are also certain improvements on other modules.

At core number = 160, the times labeled below are the geometric mean of the average time of all cases for one module. The optimization is available on each module.

overall | time(ms) |   |   |   |   |   |   |  
-- | -- | -- | -- | -- | -- | -- | -- | --
module   name | gapi | dnn | features2d | objdetect | core | imgproc | stitching | video
original | 0.185 | 1.586 | 9.998 | 11.846 | 0.205 | 0.215 | 164.409 | 0.803
optimized | 0.174 | 1.353 | 9.535 | 11.105 | 0.199 | 0.185 | 153.972 | 0.489
Performance   improves | 6% | 17% | 5% | 7% | 3% | 16% | 7% | 64%

Meanwhile, It is found that adjusting the order of test cases will have an impact on some test cases. For example, we used option --gtest-shuffle to run opencv_perf_gapi, the performance of TestPerformance::CmpWithScalarPerfTestFluid/CmpWithScalarPerfTest::(compare_f, CMP_GE, 1920x1080, 32FC1, { gapi.kernel_package })  case had 30% changes compared to the case without shuffle. I would like to ask if you have also encountered such a situation and could you share your experience?

### 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-09-27 16:21:20 +03:00
Yuantao Feng
307324f4ac
Merge pull request #24283 from fengyuentau:halide_tests
dnn: merge tests from test_halide_layers to test_backends #24283

Context: https://github.com/opencv/opencv/pull/24231#pullrequestreview-1628649980

### 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-09-27 14:09:47 +03:00
Dmitry Kurtaev
2b6d0f36f0
Merge pull request #24309 from dkurt:gemm_ov_hotfix
Update OpenVINO init of new GEMM layer #24309

### Pull Request Readiness Checklist

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

CI validation:

- [x] 2022.1.0: https://pullrequest.opencv.org/buildbot/builders/precommit_custom_linux/builds/100368
- [ ] 2021.4.2: https://pullrequest.opencv.org/buildbot/builders/precommit_custom_linux/builds/100373

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
2023-09-27 10:25:45 +03:00
Yuantao Feng
bb171a0c05
dnn: expand refactor with cv::broadcast for onnx models (#24295)
* add expand impl with cv::broadcast

* remove expandMid

* deduce shape from -1

* add constant folding

* handle input constant; handle input constant 1d

* add expand conformance tests; add checks to disallow shape of neg values; add early copy for unchanged total elements

* fix ExpandSubgraph

* dummy commit to trigger build

* dummy commit to trigger build 1

* remove conformance from test names
2023-09-27 09:28:52 +03:00
Alexander Smorkalov
9942757bab
Merge pull request #24316 from alexlyulkov:al/fix-caffe-read-segfault
Fixed segfault when reading Caffe model
2023-09-25 17:53:54 +03:00
HAN Liutong
aa143a3dd1
Merge pull request #24301 from hanliutong:rewrite-stereo-sift
Rewrite Universal Intrinsic code: features2d and calib3d module. #24301

The goal of this series of PRs is to modify the SIMD code blocks guarded by CV_SIMD macro: rewrite them by using the new Universal Intrinsic API.

This is the modification to the features2d module and calib3d module.

Test with clang 16 and QEMU v7.0.0. `AP3P.ctheta1p_nan_23607` failed beacuse of a small calculation error. But this patch does not touch the relevant code, and this error always reproduce on QEMU, regardless of whether the patch is applied or not. I think we can ignore it
```
[ RUN      ] AP3P.ctheta1p_nan_23607
/home/hanliutong/project/opencv/modules/calib3d/test/test_solvepnp_ransac.cpp:2319: Failure
Expected: (cvtest::norm(res.colRange(0, 2), expected, NORM_INF)) <= (3e-16), actual: 3.33067e-16 vs 3e-16
[  FAILED  ] AP3P.ctheta1p_nan_23607 (26 ms)

...

[==========] 148 tests from 64 test cases ran. (1147114 ms total)
[  PASSED  ] 147 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] AP3P.ctheta1p_nan_23607
```

Note: There are 2 test cases failed with GCC 13.2.1 without this patch, seems like there are someting wrong with RVV part on GCC.
```
[----------] Global test environment tear-down
[==========] 148 tests from 64 test cases ran. (1511399 ms total)
[  PASSED  ] 146 tests.
[  FAILED  ] 2 tests, listed below:
[  FAILED  ] Calib3d_StereoSGBM.regression
[  FAILED  ] Calib3d_StereoSGBM_HH4.regression
```

The patch is partially auto-generated by using the [rewriter](https://github.com/hanliutong/rewriter).

### 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-09-25 13:03:25 +03:00
Alexander Lyulkov
72e7672a6c Fixed segfault when reading Caffe model 2023-09-25 12:55:11 +07:00
Abduragim Shtanchaev
865e7cacca
Merge pull request #24037 from Abdurrahheem:ash/dev_einsum
Add Support for Einsum Layer #24037

### This PR adding support for [Einsum Layer](https://pytorch.org/docs/stable/generated/torch.einsum.html) (in progress). 

This PR is currently not to be merged but only reviewed. Test cases are located in [#1090](https://github.com/opencv/opencv_extra/pull/1090)RP in OpenCV extra

**DONE**: 
 - [x] 2-5D GMM support added
 - [x] Matrix transpose support added
 - [x] Reduction type comupte  'ij->j'
 - [x] 2nd shape computation - during forward 

**Next PRs**:
- [ ] Broadcasting reduction "...ii ->...i"
- [ ] Add lazy shape deduction. "...ij, ...jk->...ik"
- [ ] Add implicit output computation support. "bij,bjk ->" (output subscripts should be "bik")
- [ ] Add support for CUDA backend 
- [ ] BatchWiseMultiply optimize

**Later in 5.x version (requires support for 1D matrices)**: 
- [ ] Add 1D vector multiplication support 
- [ ] Inter product "i, i" (problems with 1D shapes)

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2023-09-22 11:25:02 +03:00
Liutong HAN
419060da84 Rewrite fluid related part. 2023-09-22 12:14:43 +08:00
Alexander Smorkalov
b51a78d439
Merge pull request #24302 from dkurt:ts_setup_skip
Skip test cases in case of SkipTestException in SetUp
2023-09-21 12:41:08 +03:00
Alexander Smorkalov
6295f7d05b
Merge pull request #24303 from asmorkalov:as/vittack_warning_fix
Warnings fix on Windows.
2023-09-20 22:08:02 +03:00
Alexander Smorkalov
219a34261f Warnings fix on Windows. 2023-09-20 16:53:40 +03:00
Alexander Smorkalov
224dac9427
Merge pull request #24126 from AleksandrPanov:fix_charuco_checkBoard
fix charuco checkBoard
2023-09-20 14:38:14 +03:00
Dmitry Kurtaev
d78637102c Skip test cases in case of SkipTestException in SetUp 2023-09-20 13:27:06 +03:00
Alex
60ae973142 fix charuco checkBoard 2023-09-20 12:27:07 +03:00
Alexander Smorkalov
799bb0cd18
Merge pull request #24291 from visitorckw:fix-memory-leak
Fix memory leak and handle realloc failure
2023-09-20 08:49:56 +03:00
Yuantao Feng
8a96e34e33
dnn: add gemm_layer in place of fully_connected_layer for onnx models (#23897)
* first commit

* turned C from input to constant; force C constant in impl; better handling 0d/1d cases

* integrate with gemm from ficus nn

* fix const inputs

* adjust threshold for int8 tryQuantize

* adjust threshold for int8 quantized 2

* support batched gemm and matmul; tune threshold for rcnn_ilsvrc13; update googlenet

* add gemm perf against innerproduct

* add perf tests for innerproduct with bias

* fix perf

* add memset

* renamings for next step

* add dedicated perf gemm

* add innerproduct in perf_gemm

* remove gemm and innerproduct perf tests from perf_layer

* add perf cases for vit sizes; prepack constants

* remove batched gemm; fix wrong trans; optimize KC

* remove prepacking for const A; several fixes for const B prepacking

* add todos and gemm expression

* add optimized branch for avx/avx2

* trigger build

* update macros and signature

* update signature

* fix macro

* fix bugs for neon aarch64 & x64

* add backends: cuda, cann, inf_ngraph and vkcom

* fix cuda backend

* test commit for cuda

* test cuda backend

* remove debug message from cuda backend

* use cpu dispatcher

* fix neon macro undef in dispatcher

* fix dispatcher

* fix inner kernel for neon aarch64

* fix compiling issue on armv7; try fixing accuracy issue on other platforms

* broadcast C with beta multiplied; improve func namings

* fix bug for avx and avx2

* put all platform-specific kernels in dispatcher

* fix typos

* attempt to fix compile issues on x64

* run old gemm when neon, avx, avx2 are all not available; add kernel for armv7 neon

* fix typo

* quick fix: add macros for pack4

* quick fix: use vmlaq_f32 for armv7

* quick fix for missing macro of fast gemm pack f32 4

* disable conformance tests when optimized branches are not supported

* disable perf tests when optimized branches are not supported

* decouple cv_try_neon and cv_neon_aarch64

* drop googlenet_2023; add fastGemmBatched

* fix step in fastGemmBatched

* cpu: fix initialization ofb; gpu: support batch

* quick followup fix for cuda

* add default kernels

* quick followup fix to avoid macro redef

* optmized kernels for lasx

* resolve mis-alignment; remove comments

* tune performance for x64 platform

* tune performance for neon aarch64

* tune for armv7

* comment time consuming tests

* quick follow-up fix
2023-09-20 00:53:34 +03:00
lpylpy0514
70d7e83dca
Merge pull request #24201 from lpylpy0514:4.x
VIT track(gsoc realtime object tracking model) #24201

Vit tracker(vision transformer tracker) is a much better model for real-time object tracking. Vit tracker can achieve speeds exceeding nanotrack by 20% in single-threaded mode with ARM chip, and the advantage becomes even more pronounced in multi-threaded mode. In addition, on the dataset, vit tracker demonstrates better performance compared to nanotrack. Moreover, vit trackerprovides confidence values during the tracking process, which can be used to determine if the tracking is currently lost.
opencv_zoo: https://github.com/opencv/opencv_zoo/pull/194
opencv_extra: [https://github.com/opencv/opencv_extra/pull/1088](https://github.com/opencv/opencv_extra/pull/1088)

# Performance comparison is as follows:
NOTE: The speed below is tested by **onnxruntime** because opencv has poor support for the transformer architecture for now.

ONNX speed test on ARM platform(apple M2)(ms):
| thread nums | 1| 2| 3| 4|
|--------|--------|--------|--------|--------|
| nanotrack| 5.25| 4.86| 4.72| 4.49|
| vit tracker| 4.18| 2.41| 1.97| **1.46 (3X)**|

ONNX speed test on x86 platform(intel i3 10105)(ms):
| thread nums | 1| 2| 3| 4|
|--------|--------|--------|--------|--------|
| nanotrack|3.20|2.75|2.46|2.55|
| vit tracker|3.84|2.37|2.10|2.01|

opencv speed test on x86 platform(intel i3 10105)(ms):
| thread nums | 1| 2| 3| 4|
|--------|--------|--------|--------|--------|
| vit tracker|31.3|31.4|31.4|31.4|

preformance test on lasot dataset(AUC is the most important data. Higher AUC means better tracker):

|LASOT | AUC| P| Pnorm|
|--------|--------|--------|--------|
| nanotrack| 46.8| 45.0| 43.3|
| vit tracker| 48.6| 44.8| 54.7|

[https://youtu.be/MJiPnu1ZQRI](https://youtu.be/MJiPnu1ZQRI)
 In target tracking tasks, the score is an important indicator that can indicate whether the current target is lost. In the video, vit tracker can track the target and display the current score in the upper left corner of the video. When the target is lost, the score drops significantly. While nanotrack will only return 0.9 score in any situation, so that we cannot determine whether the target is lost.

### 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
2023-09-19 15:36:38 +03:00
HAN Liutong
320c0bf419
Merge pull request #24166 from hanliutong:rewrite-remaining
Rewrite Universal Intrinsic code: ImgProc (CV_SIMD_WIDTH related Part) #24166

Related PR: #24058, #24132. The goal of this series of PRs is to modify the SIMD code blocks in the opencv/modules/imgproc folder by using the new Universal Intrinsic API.

The modification of this PR mainly focuses on the code that uses the `CV_SIMD_WIDTH` macro. This macro is sometimes used for loop tail processing, such as `box_filter.simd.hpp` and `morph.simd.hpp`.

```cpp
#if CV_SIMD
int i = 0;
for (i < n - v_uint16::nlanes; i += v_uint16::nlanes) {
// some universal intrinsic code
// e.g. v_uint16...
}
#if CV_SIMD_WIDTH > 16
for (i < n - v_uint16x8::nlanes; i += v_uint16x8::nlanes) {
// handle loop tail by 128 bit SIMD
// e.g. v_uint16x8
}
#endif //CV_SIMD_WIDTH 
#endif// CV_SIMD
```
The main contradiction is that the variable-length Universal Intrinsic backend cannot use 128bit fixed-length data structures. Therefore, this PR uses the scalar loop to handle the loop tail.

This PR is marked as draft because the modification of the `box_filter.simd.hpp` file caused a compilation error. The cause of the error is initially believed to be due to an internal error in the GCC compiler.

```bash
box_filter.simd.hpp:1162:5: internal compiler error: Segmentation fault
 1162 |     }
      |     ^
0xe03883 crash_signal
        /wafer/share/gcc/gcc/toplev.cc:314
0x7ff261c4251f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x6bde48 hash_set<rtl_ssa::set_info*, false, default_hash_traits<rtl_ssa::set_info*> >::iterator::operator*()
        /wafer/share/gcc/gcc/hash-set.h:125
0x6bde48 extract_single_source
        /wafer/share/gcc/gcc/config/riscv/riscv-vsetvl.cc:1184
0x6bde48 extract_single_source
        /wafer/share/gcc/gcc/config/riscv/riscv-vsetvl.cc:1174
0x119ad9e pass_vsetvl::propagate_avl() const
        /wafer/share/gcc/gcc/config/riscv/riscv-vsetvl.cc:4087
0x119ceaf pass_vsetvl::execute(function*)
        /wafer/share/gcc/gcc/config/riscv/riscv-vsetvl.cc:4344
0x119ceaf pass_vsetvl::execute(function*)
        /wafer/share/gcc/gcc/config/riscv/riscv-vsetvl.cc:4325
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
```

This PR can be compiled with Clang 16, and `opencv_test_imgproc` is passed on QEMU.

### 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-09-19 15:12:52 +03:00
Kumataro
b870ad46bf
Merge pull request #24074 from Kumataro/fix24057
Python: support tuple src for cv::add()/subtract()/... #24074

fix https://github.com/opencv/opencv/issues/24057

### 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-09-19 10:32:47 +03:00
HAN Liutong
f617fbe166
Merge pull request #24132 from hanliutong:rewrite-imgproc2
Rewrite Universal Intrinsic code by using new API: ImgProc module Part 2 #24132

The goal of this series of PRs is to modify the SIMD code blocks guarded by CV_SIMD macro in the opencv/modules/imgproc folder: rewrite them by using the new Universal Intrinsic API.

This is the second part of the modification to the Imgproc module ( Part 1: #24058 ), And I tested this patch on RVV (QEMU) and AVX devices, `opencv_test_imgproc` is passed.

The patch is partially auto-generated by using the [rewriter](https://github.com/hanliutong/rewriter).

### 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-09-19 08:52:42 +03:00
Alexander Smorkalov
8f2e6640e3
Merge pull request #24288 from tailsu:sd/emscripten-3.1.45-fixes
build fixes for emscripten 3.1.45
2023-09-19 08:09:18 +03:00
Kuan-Wei Chiu
e16ca08b33 Fix memory leak and handle realloc failure
In the previous code, there was a memory leak issue where the
previously allocated memory was not freed upon a failed realloc
operation. This commit addresses the problem by releasing the old
memory before setting the pointer to NULL in case of a realloc failure.
This ensures that memory is properly managed and avoids potential
memory leaks.
2023-09-18 22:43:44 +08:00
Stefan Dragnev
9b5a719d80 build fixes for emscripten 3.1.45 2023-09-18 15:38:31 +02:00
Alexander Smorkalov
157b0e7760
Merge pull request #24275 from alexlyulkov:al/fix-tf-graph-simplifier
Fixed removePhaseSwitches in tf_graph_simplifier
2023-09-18 11:02:44 +03:00
Alexander Smorkalov
0a53afe8ba
Merge pull request #24278 from georgthegreat:compat-fixes
More fixes for iterators-are-pointers case
2023-09-18 10:47:53 +03:00
Dmitry Kurtaev
6bc369fc56
Merge pull request #24250 from dkurt:ts_fixture_constructor_skip_2
Skip test on SkipTestException at fixture's constructor (version 2) #24250

### Pull Request Readiness Checklist

Another version of https://github.com/opencv/opencv/pull/24186 (reverted by https://github.com/opencv/opencv/pull/24223). Current implementation cannot handle skip exception at `static void SetUpTestCase` but works on `virtual void SetUp`.

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-09-18 10:23:24 +03:00
Yuriy Chernyshov
638c575c73 More fixes for iterators-are-pointers case 2023-09-15 12:37:43 +03:00
Alexander Lyulkov
d4cb564ce2 Fixed removePhaseSwitches in tf_graph_simplifier 2023-09-15 14:22:21 +07:00
HAN Liutong
5e9191558d
Merge pull request #24058 from hanliutong:rewrite-imgporc
Rewrite Universal Intrinsic code by using new API: ImgProc module. #24058

The goal of this series of PRs is to modify the SIMD code blocks guarded by CV_SIMD macro in the `opencv/modules/imgproc` folder: rewrite them by using the new Universal Intrinsic API. 

For easier review, this PR includes a part of the rewritten code, and another part will be brought in the next PR (coming soon). I tested this patch on RVV (QEMU) and AVX devices, `opencv_test_imgproc` is passed.

The patch is partially auto-generated by using the [rewriter](https://github.com/hanliutong/rewriter), related PR https://github.com/opencv/opencv/pull/23885 and https://github.com/opencv/opencv/pull/23980.



### 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-09-14 20:37:46 +03:00
Alexander Smorkalov
515f119a59
Merge pull request #24270 from dkurt:fix_24256
Higher threshold for FasterRCNN_vgg16
2023-09-14 15:58:23 +03:00
Vincent Rabaud
3880d059b3
Merge pull request #24260 from vrabaud:ubsan
Fix undefined behavior arithmetic in copyMakeBorder and adjustROI. #24260

This is due to the undefined: negative int multiplied by size_t pointer increment.

To test, compile with:
```
mkdir build
cd build
cmake ../ -DCMAKE_C_FLAGS_INIT="-fsanitize=undefined" -DCMAKE_CXX_FLAGS_INIT="-fsanitize=undefined" -DCMAKE_C_COMPILER="/usr/bin/clang" -DCMAKE_CXX_COMPILER="/usr/bin/clang++" -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=undefined -lubsan"
```
And run:
```
make -j opencv_test_core && ./bin/opencv_test_core --gtest_filter=*UndefinedBehavior*
```

### 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-09-14 15:16:28 +03:00
Dmitry Kurtaev
c5edd20354 Higher threshold for FasterRCNN_vgg16 2023-09-14 13:11:53 +03:00
alexlyulkov
1e54e56579
Merge pull request #24266 from alexlyulkov:al/tf-argmax-default-dim
Added default dimension value to tensorflow ArgMax and ArgMin layers #24266

Added default dimension value to tensorflow ArgMax and ArgMin layers.
Added exception when accessing layer's input with out of range index.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=48452
2023-09-14 10:25:24 +03:00
Yuriy Chernyshov
eb20bb3b23 Add missing sanitizer interface include 2023-09-13 12:15:34 +03:00
Alexander Smorkalov
97614920ef
Merge pull request #24247 from AleksandrPanov:fix_drawDetectedCornersCharuco_type_error
fix type cast in drawDetectedMarkers, drawDetectedCornersCharuco, drawDetectedDiamonds
2023-09-12 17:38:44 +03:00
Alex
ae1d1b6d55 fix drawDetectedCornersCharuco, drawDetectedMarkers, drawDetectedDiamonds added tests 2023-09-12 12:17:57 +03:00
Alexander Smorkalov
6694d87a23
Merge pull request #24239 from asmorkalov:as/msmf_returned_fourcc
More strict test for MSMF FOURCC (camera)
2023-09-11 11:00:54 +03:00
Alexander Smorkalov
ee867ead1d
Merge pull request #24248 from opencv-pushbot:gitee/alalek/issue_22751
JavaScript: include LUT support
2023-09-11 08:59:02 +03:00
Alexander Smorkalov
62c0556c58
Merge pull request #24252 from opencv-pushbot:gitee/alalek/refactor_24218
cmake: revise OPENCV_DNN_BACKEND_DEFAULT integration
2023-09-11 08:55:19 +03:00
Alexander Alekhin
02525abd9f cmake: revise OPENCV_DNN_BACKEND_DEFAULT integration
- disable message on default value
2023-09-10 13:11:36 +00:00
Dmitry Kurtaev
5dc5b27858 Enable build with OpenVINO in Debug 2023-09-09 20:38:59 +03:00
Alexander Alekhin
c319735d9b js: include LUT support 2023-09-09 03:31:39 +00:00
Alexander Smorkalov
e60825e75b
Merge pull request #24218 from CSBVision:patch-5
Added CMake configuration OPENCV_DNN_BACKEND_DEFAULT
2023-09-08 14:21:39 +03:00
Alexander Smorkalov
5a042af7e3
Merge pull request #24246 from asmorkalov:as/merge_input_check2
Check that cv::merge input matrices are not empty
2023-09-08 13:41:43 +03:00
Alexander Smorkalov
0367a12b92 Check that cv::merge input matrices are not empty. 2023-09-08 12:36:46 +03:00
Alexander Smorkalov
757d296382
Merge pull request #24228 from AleksandrPanov:fix_extendDictionary
fix extendDictionary
2023-09-08 11:01:43 +03:00
Alex
e5ff41ec9b fixes extendDictionary, add test 2023-09-07 16:01:51 +03:00
jason_w
e8f94182f5
Merge pull request #24180 from MambaWong:4.x
Fixed the channels when capturing yuv422 with v4l2 backend #24180

example to reproduce the problem
```cpp
#include <iostream>

#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/videoio.hpp>

using namespace cv;
using namespace std;

void help_func(VideoCapture& cap) {
  int height      = cap.get(cv::CAP_PROP_FRAME_HEIGHT);
  int width       = cap.get(cv::CAP_PROP_FRAME_WIDTH);
  int pixel_type  = cap.get(cv::CAP_PROP_FORMAT);
  int channels    = CV_MAT_CN(pixel_type);
  int pixel_bytes = CV_ELEM_SIZE(pixel_type);
  bool to_bgr     = static_cast<bool>(cap.get(cv::CAP_PROP_CONVERT_RGB));

  std::cout << "backend: " << cap.getBackendName() << std::endl;
  std::cout << std::hex << "fourcc: " << static_cast<int>(cap.get(cv::CAP_PROP_FOURCC)) << std::endl;
  std::cout << std::boolalpha << "to_bgr: " << to_bgr << std::endl;
  std::cout << std::dec << "height: " << height << " width: " << width << " channels: " << channels
            << " pixel_bytes: " << pixel_bytes << std::endl;

  std::cout << "-----------------------------------------" << std::endl;
}

int main(int, char**) {

  VideoCapture cap;
  cap.open("/dev/video0");
  if (!cap.isOpened()) {
    cerr << "ERROR! Unable to open camera\n";
    return -1;
  }

  {
    help_func(cap);
  }

  {
    cap.set(cv::CAP_PROP_FRAME_HEIGHT, 1080);
    cap.set(cv::CAP_PROP_FRAME_WIDTH, 1920);
    cap.set(cv::CAP_PROP_CONVERT_RGB, 0);
    help_func(cap);
  }

  // {
  //   cap.set(cv::CAP_PROP_CONVERT_RGB, 0);
  //   cap.set(cv::CAP_PROP_FRAME_HEIGHT, 1080);
  //   cap.set(cv::CAP_PROP_FRAME_WIDTH, 1920);
  //   help_func(cap);
  // }

  Mat frame;
  int frame_idx = 0;
  while (cap.read(frame)) {
    std::cout << "frame index: " << frame_idx++ << std::endl;
    help_func(cap);
    if (frame.empty()) {
      cerr << "ERROR! blank frame grabbed\n";
      break;
    }
    Mat bgr;
    if (cap.get(cv::CAP_PROP_CONVERT_RGB)) {
      bgr = frame;
    } else {
      cv::cvtColor(frame, bgr, cv::COLOR_YUV2BGR_YUYV);
    }

    imshow("frame", bgr);
    if (waitKey(5) >= 0) {
      break;
    }
  }

  return 0;
}
```
The above code will get the wrong channels. By changing lines 41-45 like below, can get the correct channels.
<img width="747" alt="code" src="https://github.com/opencv/opencv/assets/16932438/55f44463-8465-4dba-a979-e71a50d58008">
This is because `cap.set(cv::CAP_PROP_FRAME_HEIGHT, 1080);` and `cap.set(cv::CAP_PROP_FRAME_WIDTH, 1920);` reinitialize the `frame`, but `cap.set(cv::CAP_PROP_CONVERT_RGB, 0);` not.
Log info.
<img width="691" alt="log" src="https://github.com/opencv/opencv/assets/16932438/236e3b26-f5b2-447a-b202-bcd607c71af6">
We can also observe that we get the correct channels in the while loop. This is because:
ca0bd70cde/modules/videoio/src/cap_v4l.cpp (L2309-L2310)
reinitialize the `frame`.
2023-09-07 15:47:00 +03:00
Alexander Smorkalov
5c9f58e124 More strict test for MSMF FOURCC (camera). 2023-09-07 13:16:20 +03:00
beanjoy
d0de575aef
Merge pull request #24142 from beanjoy:4.x
Modify the outputVideoFormat after changing the output format in MSMF backend #24142

After changing the output format, need to modify the outputVideoFormat, otherwise the outputVideoFormat is always CV_CAP_MODE_BGR, and an error will occur when converting the format in retrieveVideoFrame(), and will always enter "case CV_CAP_MODE_BGR:" process.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake

Co-authored-by: 李龙 <lilong@sobey.com>
2023-09-07 13:06:39 +03:00
Alexander Smorkalov
1ebea1e0f0
Merge pull request #24232 from georgthegreat:missing-qualifiers
Add missing std namespace qualifiers
2023-09-06 17:50:51 +03:00
Alexander Smorkalov
5350fba319
Merge pull request #24128 from CSBVision:CSBVision-patch-1
Fix bug at blobFromImagesWithParams
2023-09-06 16:20:37 +03:00
Yuriy Chernyshov
8a415c881a Add missing std namespace qualifiers 2023-09-06 13:46:39 +03:00
CSBVision
674c618471 Update dnn_utils.cpp 2023-09-06 10:01:07 +03:00
Alexander Smorkalov
f64738218a
Merge pull request #24227 from georgthegreat:missing-includes
Add missing <sstream> includes
2023-09-06 09:16:57 +03:00
Yuriy Chernyshov
494d201fda Add missing <sstream> includes 2023-09-05 22:04:26 +03:00
Alexander Smorkalov
91808e64a1
Merge pull request #24211 from philsc:fix-asan-crash
Fix "use after free" issue in `essential_solver.cpp`
2023-09-05 18:42:58 +03:00
Dmitry Kurtaev
178fdbbda8
Merge pull request #24196 from dkurt:ov_backend_cleanups
Use ngraph::Output in OpenVINO backend wrapper #24196

### Pull Request Readiness Checklist

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

* Use `ngraph::Output<ngraph::Node>>` insead of `std::shared_ptr<ngraph::Node>` as a backend wrapper. It lets access to multi-output nodes: 588ddf1b18/modules/dnn/src/net_openvino.cpp (L501-L504)
* All layers can be customizable with OpenVINO >= 2022.1. nGraph reference code used for default layer implementation does not required CPU plugin also (might be tested by commenting CPU plugin at `/opt/intel/openvino/runtime/lib/intel64/plugins.xml`).
* Correct inference if only intermediate blobs requested.


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-09-05 18:08:28 +03:00
Yuriy Chernyshov
2c53e3f53d
Merge pull request #24204 from georgthegreat:mser-license
Properly preserve chi_table license as mandated by BSD-3-Clause #24204

Amend reference to online hosted file with the full license quotation as mandated by the original license.
2023-09-05 17:05:47 +03:00
Alexander Smorkalov
af9be78ead
Merge pull request #24223 from asmorkalov:as/24186_revert
Revert PR 24186 as it forces skipping tests
2023-09-05 16:35:46 +03:00
Alexander Smorkalov
c9d70d46b1
Merge pull request #24139 from AleksandrPanov:fix_refineDetectedMarkers
fix refineDetectedMarkers
2023-09-05 15:24:57 +03:00
Dmitry Kurtaev
c4c2e2e796
Merge pull request #24214 from dkurt:distanceTransform_big_step
Fix distanceTransform for inputs with large step and height #24214

### Pull Request Readiness Checklist

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

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-09-05 15:21:10 +03:00
Alexander Smorkalov
cca4ee2e46 Revert PR 24186 as it force skip tests. 2023-09-05 14:35:37 +03:00
Alexander Smorkalov
21fb10c6a3
Merge pull request #24209 from alexlyulkov:al/fixed-mjpeg
Fixed bug with the last 4 bytes in MJPEG encoder
2023-09-05 13:45:26 +03:00
Björn Böken
639836ebf0 Added CMake configuration OPENCV_DNN_BACKEND_DEFAULT 2023-09-05 10:05:12 +02:00
Dmitry Kurtaev
6ae7caaa01
Merge pull request #24216 from dkurt:inter_lines_less_compute
Minor optimization of two lines intersection #24216

### Pull Request Readiness Checklist

Not significant, but we can reduce number of multiplications while compute two lines intersection. Both methods are used heavily in their modules.

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.
- [x] The feature is well documented and sample code can be built with the project CMake
2023-09-05 10:44:56 +03:00
Alexander Lyulkov
f280e3cbd9 Fixed bug with the last 4 bytes in MJPEG encoder. 2023-09-05 10:38:19 +03:00
Wanli
84f32bbb24 increase Fast Math threshold 2023-09-05 14:03:54 +08:00
Philipp Schrader
c91c631ae2 Fix "use after free" issue in essential_solver.cpp
The address sanitizer highlighted this issue in our code base. It
looks like the code is currently grabbing a pointer to a temporary
object and then performing operations on it.

I printed some information right before the asan crash:

    eigensolver address: 0x7f0ad95032f0
    eigensolver size: 4528
    eig_vecs_ ptr: 0x7f0ad95045e0
    eig_vecs_ offset: 4848

This shows that `eig_vecs_` points past the end of `eigensolver`. In
other words, it points at the temporary object created by the
`eigensolver.eigenvectors()` call.

Compare the docs for `.eigenvalues()`:
https://eigen.tuxfamily.org/dox/classEigen_1_1EigenSolver.html#a0f507ad7ab14797882f474ca8f2773e7
to the docs for `.eigenvectors()`:
https://eigen.tuxfamily.org/dox/classEigen_1_1EigenSolver.html#a66288022802172e3ee059283b26201d7

The difference in return types is interesting. `.eigenvalues()`
returns a reference. But `.eigenvectors()` returns a matrix.

This patch here fixes the problem by saving the temporary object and
then grabbing a pointer into it.

This is a curated snippet of the original asan failure:

    ==12==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fc633704640 at pc 0x7fc64f7f1593 bp 0x7ffe8875fc90 sp 0x7ffe8875fc88
    READ of size 8 at 0x7fc633704640 thread T0
        #0 0x7fc64f7f1592 in cv::usac::EssentialMinimalSolverStewenius5ptsImpl::estimate(std::__1::vector<int, std::__1::allocator<int> > const&, std::__1::vector<cv::Mat, std::__1::allocator<cv::Mat> >&) const /proc/self/cwd/external/com_github_opencv_opencv/modules/calib3d/src/usac/essential_solver.cpp:181:48
        #1 0x7fc64f915d92 in cv::usac::EssentialEstimatorImpl::estimateModels(std::__1::vector<int, std::__1::allocator<int> > const&, std::__1::vector<cv::Mat, std::__1::allocator<cv::Mat> >&) const /proc/self/cwd/external/com_github_opencv_opencv/modules/calib3d/src/usac/estimator.cpp:110:46
        #2 0x7fc64fa74fb0 in cv::usac::Ransac::run(cv::Ptr<cv::usac::RansacOutput>&) /proc/self/cwd/external/com_github_opencv_opencv/modules/calib3d/src/usac/ransac_solvers.cpp:152:58
        #3 0x7fc64fa6cd8e in cv::usac::run(cv::Ptr<cv::usac::Model const> const&, cv::_InputArray const&, cv::_InputArray const&, int, cv::Ptr<cv::usac::RansacOutput>&, cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&) /proc/self/cwd/external/com_github_opencv_opencv/modules/calib3d/src/usac/ransac_solvers.cpp:1010:16
        #4 0x7fc64fa6fb46 in cv::usac::findEssentialMat(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, int, double, double, cv::_OutputArray const&) /proc/self/cwd/external/com_github_opencv_opencv/modules/calib3d/src/usac/ransac_solvers.cpp:527:9
        #5 0x7fc64f3b5522 in cv::findEssentialMat(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, int, double, double, int, cv::_OutputArray const&) /proc/self/cwd/external/com_github_opencv_opencv/modules/calib3d/src/five-point.cpp:437:16
        #6 0x7fc64f3b7e00 in cv::findEssentialMat(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, int, double, double, cv::_OutputArray const&) /proc/self/cwd/external/com_github_opencv_opencv/modules/calib3d/src/five-point.cpp:486:12
        ...

    Address 0x7fc633704640 is located in stack of thread T0 at offset 17984 in frame
        #0 0x7fc64f7ed4ff in cv::usac::EssentialMinimalSolverStewenius5ptsImpl::estimate(std::__1::vector<int, std::__1::allocator<int> > const&, std::__1::vector<cv::Mat, std::__1::allocator<cv::Mat> >&) const /proc/self/cwd/external/com_github_opencv_opencv/modules/calib3d/src/usac/essential_solver.cpp:36

      This frame has 63 object(s):
        [32, 56) 'coefficients' (line 38)
        [96, 384) 'ee' (line 55)
        ...
        [13040, 17568) 'eigensolver' (line 142)
        [17824, 17840) 'ref.tmp518' (line 143)
        [17856, 17872) 'ref.tmp523' (line 144)
        [17888, 19488) 'ref.tmp524' (line 144) <== Memory access at offset 17984 is inside this variable
        [19616, 19640) 'ref.tmp532' (line 169)
        ...

The crash report says that we're accessing a temporary object from
line 144 when we shouldn't be. Line 144 looks like this:
https://github.com/opencv/opencv/blob/4.6.0/modules/calib3d/src/usac/essential_solver.cpp#L144

    const auto * const eig_vecs_ = (double *) eigensolver.eigenvectors().real().data();

We are using version 4.6.0 for this, but the problem is present on the
4.x branch.

Note that I am dropping the .real() call here. I think that is safe because
of the code further down (line 277 in the most recent version):

    const int eig_i = 20 * i + 12; // eigen stores imaginary values too

The code appears to expect to have to skip doubles for the imaginary parts
of the complex numbers.

Admittedly, I couldn't find a test case that exercised this code path to
validate correctness.
2023-09-04 11:10:05 -07:00
Alex
ca527040e2 fix refineDetectedMarkers, add test 2023-09-04 18:28:28 +03:00
alexander-varjo
114c23e411
Merge pull request #23607 from alexander-varjo:alexander-varjo-patch-1
Fix crash in ap3p #23607

### 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
- [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.
- [x] The feature is well documented and sample code can be built with the project CMake
2023-09-04 17:49:45 +03:00
Alexander Smorkalov
748279d5f1
Merge pull request #23904 from kai-waang:removing-unreachable
removing unreachable codes in `gbackend`
2023-09-04 17:06:45 +03:00
Alexander Smorkalov
e274e72869
Merge pull request #24098 from 0xMihir:4.x
Fix fullscreen behavior for macOS
2023-09-04 16:48:04 +03:00
Alexander Smorkalov
4dd755443a
Merge pull request #24215 from Kumataro:fix24213
core: arm64: v_round() works with round to nearest, ties to even.
2023-09-04 12:51:02 +03:00
Dmitry Matveev
d19fc1264b
Merge pull request #24178 from dmatveev:dm/streaming_queue
G-API: Introduce a Queue Source #24178

- Added a new IStreamSource class: in fact, a wrapper over a concurrent queue;
- Added minimal example on how it can be used;
- Extended IStreamSource with optional "halt" interface to break the blocking calls in the emitter threads when required to stop.
- Introduced a QueueInput class which allows to pass the whole graph's input vector at once. In fact it is a thin wrapper atop of individual Queue Sources.

There is a hidden trap found with our type system as described in https://github.com/orgs/g-api-org/discussions/2

While it works even in this form, it should be addressed somewhere in the 5.0 timeframe.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2023-09-04 12:48:53 +03:00
Alexander Smorkalov
d3bccd7b23
Merge pull request #24199 from Kumataro:fixlibTiffSite
imgcodecs: fix libtiff URL in opencv source code
2023-09-04 10:54:43 +03:00
Kumataro
72bb8bb73c core: arm64: v_round() works with round to nearest, ties to even. 2023-09-04 10:27:55 +03:00
Alexander Smorkalov
c53b3c5f84
Merge pull request #24203 from thesamesam:arm64-fp16
Fix compilation on arm64 with FP16 when disabled
2023-09-04 09:32:46 +03:00
Yuantao Feng
a308dfca98
core: add broadcast (#23965)
* add broadcast_to with tests

* change name

* fix test

* fix implicit type conversion

* replace type of shape with InputArray

* add perf test

* add perf tests which takes care of axis

* v2 from ficus expand

* rename to broadcast

* use randu in place of declare

* doc improvement; smaller scale in perf

* capture get_index by reference
2023-08-30 09:53:59 +03:00
Sam James
c20febdbb0
Fix compilation on arm64 with FP16 when disabled
If building with -mcpu=native or any other setting which implies the current
CPU has FP16 but with intrinsics disabled, we mistakenly try to use it even
though convolution.hpp conditionally defines it correctly based on whether
we should *use it*. convolution.cpp on the other hand was mismatched and
trying to use it if the CPU supported it, even if not enabled in the build
system.

Make the guards match.

Bug: https://bugs.gentoo.org/913031
Signed-off-by: Sam James <sam@gentoo.org>
2023-08-29 03:05:49 +01:00
Vincent Rabaud
8a1b998b2b
Merge pull request #24194 from vrabaud:compilation_fix
* Fix compilation when forcing later C++.

* Remove random_shuffle.

* Remove random_shuffle.
2023-08-27 17:46:24 +00:00
Kumataro
4b1a4bdb49 imgcodecs: fix libtiff homepage 2023-08-27 19:49:37 +09:00
Dmitry Kurtaev
588ddf1b18
Merge pull request #24186 from dkurt:ts_fixture_constructor_skip
Skip test on SkipTestException at fixture's constructor

* Skip test on SkipTestException at fixture's constructor

* Add warning supression

* Skip Python tests if no test file found

* Skip instances of test fixture with exception at SetUpTestCase

* Skip test with exception at SetUp method

* Try remove warning disable

* Add CV_NORETURN

* Remove FAIL assertion

* Use findDataFile to throw Skip exception

* Throw exception conditionally
2023-08-25 14:53:34 +03:00
Kumataro
81cc89a3ce
Merge pull request #24179 from Kumataro:fix24145
* core:add OPENCV_IPP_MEAN/MINMAX/SUM option to enable IPP optimizations

* fix: to use guard HAVE_IPP and ocv_append_source_file_compile_definitions() macro.

* support OPENCV_IPP_ENABLE_ALL

* add document for OPENCV_IPP_ENABLE_ALL

* fix OPENCV_IPP_ENABLE_ALL comment
2023-08-23 22:53:11 +03:00
Dmitry Kurtaev
a0debc3a9a Enable OpenVINO max pooling with indices since 2022.1 2023-08-23 10:39:38 +03:00
Alexander Alekhin
ca0bd70cde Merge pull request #24143 from seanm:sprintf4 2023-08-18 15:49:20 +00:00
Dmitry Kurtaev
d88ad46978 Remove explitit transB attribute from MatMul perf test 2023-08-18 15:10:14 +03:00
Alexander Alekhin
bb7c35b99f Merge pull request #24160 from mshabunin:update-ade 2023-08-18 08:02:44 +00:00
Alexander Alekhin
2b87e78e18 Merge pull request #24157 from dkurt:gapi_ov_optional 2023-08-18 08:02:11 +00:00
autoantwort
f5a14532c2
Merge pull request #24167 from autoantwort:missing-include
* add missing include

* Apply CR
2023-08-17 09:34:19 +00:00
Sean McBride
d792ebc5d2 Fixed buffer overrun; removed the last two uses of sprintf
Fixed an off-by-1 buffer resize, the space for the null termination was forgotten.

Prefer snprintf, which can never overflow (if given the right size).

In one case I cheated and used strcpy, because I cannot figure out the buffer size at that point in the code.
2023-08-16 20:04:17 -04:00
Alexander Alekhin
abda763073 Merge pull request #24150 from DeePingXian:4.x 2023-08-16 22:25:11 +00:00
Dmitry Kurtaev
8ad5eb521a
Merge pull request #24120 from dkurt:actualize_dnn_links
OCL_FP16 MatMul with large batch

* Workaround FP16 MatMul with large batch

* Fix OCL reinitialization

* Higher thresholds for INT8 quantization

* Try fix gemm_buffer_NT for half (columns)

* Fix GEMM by rows

* Add batch dimension to InnerProduct layer test

* Fix Test_ONNX_conformance.Layer_Test/test_basic_conv_with_padding

* Batch 16

* Replace all vload4

* Version suffix for MobileNetSSD_deploy Caffe model
2023-08-16 15:46:11 +03:00
Alexander Alekhin
8d1c73a912 Merge pull request #24156 from zihaomu:fix_24041 2023-08-16 12:37:50 +00:00
MuZihao
16681d1080 fix the issue in layer fused 2023-08-16 09:34:59 +08:00
Maksim Shabunin
8e52c0155b gapi: update ADE library to 0.1.2b 2023-08-15 20:49:21 +03:00
Dmitry Kurtaev
ad7ecf1dba Mark OpenVINO models for G-API tests optional 2023-08-15 11:32:44 +03:00
Mihir Patil
fb34f36c69
style: remove extraneous std::cout 2023-08-14 19:11:14 -04:00
Ginkgo
a301d1c298 fix ipp_warpAffine return value error 2023-08-14 20:58:35 +08:00
Alexander Alekhin
27d718b223 Merge pull request #24138 from mshabunin:fix-gst-plugin-camera 2023-08-13 19:47:21 +00:00
DeePingXian
a300e7e945 Adding support for Streamlabs Desktop Virtual Webcam
Streamlabs Desktop has the same issue in https://github.com/opencv/opencv/issues/19746.
This fixes it using https://github.com/opencv/opencv/pull/23460 method.
2023-08-13 16:40:38 +08:00
Alexander Smorkalov
747b7cab6c
Merge pull request #23734 from seanm:unaligned-copy
Fixed invalid cast and unaligned memory access
2023-08-11 15:23:08 +03:00
Alexander Smorkalov
232c67bf76
Merge pull request #24140 from sthibaul:4.x
Fix GNU/Hurd build
2023-08-11 12:32:22 +03:00
Alexander Smorkalov
5b41134ee7
Merge pull request #24012 from cudawarpedЖvideocapture_raw_read
`VideoCapture`: remove decoder initialization when demuxing
2023-08-11 11:28:57 +03:00
HAN Liutong
0dd7769bb1
Merge pull request #23980 from hanliutong:rewrite-core
Rewrite Universal Intrinsic code by using new API: Core module. #23980

The goal of this PR is to match and modify all SIMD code blocks guarded by `CV_SIMD` macro in the `opencv/modules/core` folder and rewrite them by using the new Universal Intrinsic API.

The patch is almost auto-generated by using the [rewriter](https://github.com/hanliutong/rewriter), related PR #23885.

Most of the files have been rewritten, but I marked this PR as draft because, the `CV_SIMD` macro also exists in the following files, and the reasons why they are not rewrited are:

1. ~~code design for fixed-size SIMD (v_int16x8, v_float32x4, etc.), need to manually rewrite.~~ Rewrited
- ./modules/core/src/stat.simd.hpp
- ./modules/core/src/matrix_transform.cpp
- ./modules/core/src/matmul.simd.hpp

2. Vector types are wrapped in other class/struct, that are not supported by the compiler in variable-length backends. Can not be rewrited directly.
- ./modules/core/src/mathfuncs_core.simd.hpp 
```cpp
struct v_atan_f32
{
    explicit v_atan_f32(const float& scale)
    {
...
    }

    v_float32 compute(const v_float32& y, const v_float32& x)
    {
...
    }

...
    v_float32 val90; // sizeless type can not used in a class
    v_float32 val180;
    v_float32 val360;
    v_float32 s;
};
```

3. The API interface does not support/does not match

- ./modules/core/src/norm.cpp 
Use `v_popcount`, ~~waiting for #23966~~ Fixed
- ./modules/core/src/has_non_zero.simd.hpp
Use illegal Universal Intrinsic API: For float type, there is no logical operation `|`. Further discussion needed

```cpp
/** @brief Bitwise OR

Only for integer types. */
template<typename _Tp, int n> CV_INLINE v_reg<_Tp, n> operator|(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);
template<typename _Tp, int n> CV_INLINE v_reg<_Tp, n>& operator|=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b);
```

```cpp
#if CV_SIMD
    typedef v_float32 v_type;
    const v_type v_zero = vx_setzero_f32();
    constexpr const int unrollCount = 8;
    int step = v_type::nlanes * unrollCount;
    int len0 = len & -step;
    const float* srcSimdEnd = src+len0;

    int countSIMD = static_cast<int>((srcSimdEnd-src)/step);
    while(!res && countSIMD--)
    {
        v_type v0 = vx_load(src);
        src += v_type::nlanes;
        v_type v1 = vx_load(src);
        src += v_type::nlanes;
....
        src += v_type::nlanes;
        v0 |= v1; //Illegal ?
....
        //res = v_check_any(((v0 | v4) != v_zero));//beware : (NaN != 0) returns "false" since != is mapped to _CMP_NEQ_OQ and not _CMP_NEQ_UQ
        res = !v_check_all(((v0 | v4) == v_zero));
    }

    v_cleanup();
#endif
```

### 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-08-11 08:33:33 +03:00
Samuel Thibault
82de5b3a67 Fix GNU/Hurd build
It has the usual Unix filesystem operations.
2023-08-10 22:43:46 +02:00
Alexander Smorkalov
3421b950ce
Merge pull request #24133 from alexlyulkov:al/fixed-msmf-webcam
Fixed bug when MSMF webcamera doesn't start when build with VIDEOIO_PLUGIN_ALL
2023-08-10 11:48:38 +03:00
Maksim Shabunin
53dfd9536a videoio: fix camera opening with GStreamer plugin 2023-08-10 11:39:29 +03:00
Alexander Lyulkov
4a12707103 Fixed bug when MSMF webcamera doesn't start when build with VIDEOIO_PLUGIN_ALL 2023-08-09 18:43:49 +08:00
Alexander Smorkalov
eccfd98b92
Merge pull request #24089 from cudawarped:cuda_gpumat_fix_convertTo_copyTo_bindings
`cuda`: Fix `GpuMat::copyTo` and `GpuMat::converTo` python bindings
2023-08-09 13:25:39 +03:00
Alexander Smorkalov
9b5b2540a4
Merge pull request #24086 from Kumataro:fix24081
videoio: doc: add odd width or height limitation for FFMPEG
2023-08-09 09:31:47 +03:00
Yuantao Feng
ba70ec99b3
Merge pull request #24122 from fengyuentau:remove_tengine
dnn: cleanup of tengine backend #24122

🚀 Cleanup for OpenCV 5.0. Tengine backend is added for convolution layer speedup on ARM CPUs, but it is not maintained and the convolution layer on our default backend has reached similar performance to that of Tengine.

Tengine backend related PRs:
- https://github.com/opencv/opencv/pull/16724
- https://github.com/opencv/opencv/pull/18323

### 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-08-09 09:26:02 +03:00
Mihir Patil
afb406f1de
style: remove trailing whitespace 2023-08-06 20:10:05 -04:00
unknown
87b7ce4415 Solved issue 24044 2023-08-04 21:57:22 +02:00
Laurent Berger
2ff16d4c45
Merge pull request #24101 from LaurentBerger:I24076
Invalid memory access fix for ONNX split layer parser #24076 #24101

### 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 https://github.com/opencv/opencv/issues/24076
- [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-08-04 12:18:49 +03:00
Alexander Smorkalov
5466fd2606
Merge pull request #24104 from cudawarped:cuda_fix_cuda_toolkit_12_2
`cuda`: fix for compatibility with CUDA Toolkit >= 12.2.0
2023-08-04 12:11:15 +03:00
Dmitry Kurtaev
4b8aeb1129
Merge pull request #24039 from dkurt:tflite_test_backends
TFLite models on different backends (tests and improvements) #24039

### Pull Request Readiness Checklist

* MaxUnpooling with OpenVINO
* Fully connected with transposed inputs/weights with OpenVINO
* Enable backends tests for TFLite (related to https://github.com/opencv/opencv/issues/23992#issuecomment-1640691722)
* Increase existing tests thresholds

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-08-04 11:28:51 +03:00
Dmitry Kurtaev
96f23e3da1
Merge pull request #24080 from dkurt:dnn_cuda_layers
Resolve uncovered CUDA dnn layer #24080

### Pull Request Readiness Checklist

* Gelu activation layer on CUDA
* Try to relax GEMM from ONNX

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

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-08-03 09:13:42 +03:00
cudawarped
e4ad7e3778 VideoCapture: remove decoder initialization when CAP_PROP_FORMAT== -1 (rawMode == true) 2023-08-02 16:34:22 +03:00
Dmitry Kurtaev
0245c0cd10
Merge pull request #24072 from dkurt:openvino_cpu_tests
Remove legacy nGraph logic #24072

### Pull Request Readiness Checklist

TODO:
- [x] Test with OpenVINO 2021.4 (tested locally)

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.
- [x] The feature is well documented and sample code can be built with the project CMake
2023-08-02 14:39:11 +03:00
Dmitry Kurtaev
195aad8e6a
Merge pull request #24069 from dkurt:openvino_detection_layer
DetectionOutput layer on OpenVINO without limitations #24069

### Pull Request Readiness Checklist

required for https://github.com/opencv/opencv/pull/23987

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.
- [x] The feature is well documented and sample code can be built with the project CMake
2023-08-02 14:28:47 +03:00
Anatoliy Talamanov
f46f7eff0c
Merge pull request #24059 from TolyaTalamanov:at/add-onnx-cuda-execution-provider
G-API: Support CUDA & TensoRT Execution Providers for ONNXRT Backend #24059

### 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-08-02 14:13:07 +03:00
Mihir Patil
e1d0f07c90
highgui(cocoa): fix fullscreen behavior 2023-08-02 00:01:37 -04:00
cudawarped
bea0c1b660 cuda: Fix GpuMat::copyTo and GpuMat::converTo python bindings 2023-08-01 15:09:37 +03:00
Maksim Shabunin
9fc83ac544 videoio: fix V4L compilation for older kernels 2023-08-01 14:11:14 +03:00
Maksim Shabunin
e0e537d94e videoio: fixed MSVC warning in test 2023-08-01 14:09:22 +03:00
cudawarped
ab8cb6f8a9 cuda: fix for compatibility with CUDA Toolkit >= 12.2.0 2023-08-01 13:02:42 +03:00
Kumataro
68968eda8d videoio: doc: add odd width or height limitation for FFMPEG 2023-08-01 18:56:20 +09:00
Alexander Smorkalov
0323761ea6
Merge pull request #24035 from vrabaud:calibration
Fix stereoRectify image boundaries.
2023-07-27 19:36:33 +03:00
Vincent Rabaud
15815fb54d Fix stereoRectify image boundaries.
This should hav ebeen fixed with https://github.com/opencv/opencv/issues/23304
2023-07-27 17:47:26 +03:00
Dmitry Kurtaev
677a28fd2a
Merge pull request #24056 from dkurt:eltwise_prelu
PReLU with element-wise scales #24056

### Pull Request Readiness Checklist

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

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-07-27 16:36:40 +03:00
SaltFish-T
ab6bffc6f8
Merge pull request #23936 from SaltFish-T:4.x
Update opencv dnn to support cann version >=6.3 #23936

1.modify the search path of "libopsproto.so" in OpenCVFindCANN.cmake
2.add the search path of "libgraph_base.so" in OpenCVFindCANN.cmake
3.automatic check Ascend socVersion,and test on Ascend310/Ascend310B/Ascend910B well
2023-07-27 14:21:30 +03:00
Vadim Levin
0c5d74ec1a
Merge pull request #24066 from VadimLevin:dev/vlevin/python-typing-register-dnn-layer
Python typing refinement for dnn_registerLayer/dnn_unregisterLayer functions #24066

This patch introduces typings generation for `dnn_registerLayer`/`dnn_unregisterLayer` manually defined in [`cv2/modules/dnn/misc/python/pyopencv_dnn.hpp`](https://github.com/opencv/opencv/blob/4.x/modules/dnn/misc/python/pyopencv_dnn.hpp)

Updates:

- Add `LayerProtocol` to `cv2/dnn/__init__.pyi`:

    ```python
    class LayerProtocol(Protocol):
        def __init__(
            self, params: dict[str, DictValue],
            blobs: typing.Sequence[cv2.typing.MatLike]
        ) -> None: ...

        def getMemoryShapes(
            self, inputs: typing.Sequence[typing.Sequence[int]]
        ) -> typing.Sequence[typing.Sequence[int]]: ...

        def forward(
            self, inputs: typing.Sequence[cv2.typing.MatLike]
        ) -> typing.Sequence[cv2.typing.MatLike]: ...
    ```

- Add `dnn_registerLayer` function to `cv2/__init__.pyi`:

    ```python
    def dnn_registerLayer(layerTypeName: str,
                          layerClass: typing.Type[LayerProtocol]) -> None: ...
    ```

- Add `dnn_unregisterLayer` function to `cv2/__init__.pyi`:

    ```python
    def dnn_unregisterLayer(layerTypeName: str) -> None: ...
    ```
### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2023-07-27 11:28:00 +03:00
Vadim Levin
e59b8cd905 feat: add typing stub for redirectError
Python interface for `redirectError`:

```python
def redirectError(
    onError: Callable[[int, str, str, str, int], None] | None
) -> None: ...
```
2023-07-26 21:35:37 +03:00
Alexander Smorkalov
91749a284b
Merge pull request #24061 from VadimLevin:dev/vlevin/python-typing-highgui-refinement
feat: add highgui functions to typing stubs
2023-07-26 20:01:45 +03:00
Vincent Rabaud
94de7e5d21
Merge pull request #24042 from vrabaud:circle
Fix harmless ASAN error. #24042

For an empty radius, &v[0] would be accessed (though the called functions would not use it due to v.size() being 0). Also add checks for emptyness and fix the first element checks, in case we get INT_MAX to compare to.

### 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-07-26 20:00:22 +03:00
Vadim Levin
dad72fd47b feat: add highgui functions to typing stubs
Manually add typing stubs for functions defined in `cv2_highgui.hpp`:
- `createTrackbar`

    ```python
     def createTrackbar(trackbarName: str,
                   windowName: str,
                   value: int,
                   count: int,
                   onChange: Callable[[int], None]) -> None: ...
    ```

- `createButton`

    ```python
    def createButton(buttonName: str,
                     onChange: Callable[[tuple[int] | tuple[int, Any]], None],
                     userData: Any | None = ...,
                     buttonType: int = ...,
                     initialButtonState: int = ...) -> None: ...
    ```

- `setMouseCallback`

    ```python
    def setMouseCallback(
        windowName: str,
        onMouse: Callback[[int, int, int, int, Any | None], None],
        param: Any | None = ...
    ) -> None: ...
    ```
2023-07-26 16:34:43 +03:00
Anatoliy Talamanov
a817813b50
Merge pull request #24045 from TolyaTalamanov:at/add-onnx-directml-execution-provider
G-API: Support DirectML Execution Provider for ONNXRT Backend #24045

### 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-07-26 16:00:20 +03:00
Alexander Smorkalov
a25e809da1
Merge pull request #24046 from VadimLevin:dev/vlevin/add-cuda-gpu-mat-to-big-types
feat: add cuda_GpuMat to big types
2023-07-26 13:18:32 +03:00
Vadim Levin
be29c99d5a feat: add cuda_GpuMat to big types
This patch enables passing GpuMat as an in/out argument in several functions.
2023-07-26 10:16:49 +03:00
Alexander Smorkalov
b22c2505a8 Disable warning C5054 in VS 2022 C++20 2023-07-26 09:23:32 +03:00
Alexander Smorkalov
e5e1a3bfde
Merge pull request #24043 from zixianweei:use-vaddq_f32-on-arm64
fix compilation error on Windows ARM, use vaddq_f32 instead of +=
2023-07-25 11:41:09 +03:00
Alexander Smorkalov
c9a4775d49
Merge pull request #24047 from ivashmak:remove_unused_4.x
Remove unused features in USAC in 4.x
2023-07-23 21:12:28 +03:00
Alexander Smorkalov
12acf5603a
Merge pull request #24001 from legrosbuffle:legrosbuffle-cvround-intrinsic
Use intrinsics for `cvRound` on x86_64 `__GNUC__` (clang/gcc linux) too.
2023-07-23 09:53:18 +03:00
Ivashechkin, Maxim (PG/R - Comp Sci & Elec Eng)
0bcd66d553 remove unused 2023-07-22 10:44:37 +01:00
Alexander Smorkalov
d69c1d8652
Merge pull request #24032 from vrabaud:ubsan
Fix undefined behavior with wrong function pointers called.
2023-07-21 17:16:12 +03:00
Alexander Smorkalov
d4af868528
Merge pull request #24040 from asmorkalov:as/cuda_dnn_eps_fix
Increase eps for Test_Torch_nets.FastNeuralStyle_accuracy to prevent sporadic test failres with CUDA.
2023-07-21 16:46:34 +03:00
Vadim Levin
2fc7d21971
Merge pull request #24029 from VadimLevin:dev/vlevin/python-add-cuda-stream-to-simple-types
feat: add cuda_Stream and cuda_GpuMat to simple types mapping #24029

This patch fixes usage of `cuda::Stream` in function arguments.

Affected modules: `cudacodec`: 
[`using namespace cuda`](9dfe233020/modules/cudacodec/include/opencv2/cudacodec.hpp (L62))  in public `cudacodec.hpp` header can be removed after merge of the patch.

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2023-07-21 14:57:32 +03:00
zixgo
ec7689421d fix compilation error on Windows ARM, use vaddq_f32 instead of += 2023-07-21 19:54:43 +08:00
Alexander Smorkalov
d96ff496b4 Increase eps for Test_Torch_nets.FastNeuralStyle_accuracy to prevent sporadic test failres with CUDA. 2023-07-21 13:51:03 +03:00
Vadim Levin
e3cb5f80e7
Merge pull request #24028 from VadimLevin:dev/vlevin/fix-flann-python-bindings
Fix FLANN python bindings #24028

As a side-effect this patch improves reporting errors by FLANN `get_param`.

resolves #21642

### 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-07-21 12:44:56 +03:00
Alexander Smorkalov
09d2f4ea46
Merge pull request #23931 from asmorkalov:as/drawing_overflow
Fixed possible out-of-bound access in circles drawing
2023-07-21 12:28:14 +03:00
Anatoliy Talamanov
5261961a6e
Merge pull request #24024 from TolyaTalamanov:at/add-onnx-openvino-execution-provider
G-API: Support OpenVINO Execution Provider for ONNXRT Backend #24024

### 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-07-21 12:18:06 +03:00
Clement Courbet
3cce299a78 Use intrinsics for cvRound on x86 and x86_64 __GNUC__ (clang/gcc linux) too.
We've measured a 7x improvement in speed for `cvRound` using the intrinsic.
2023-07-21 10:57:54 +03:00
Dmitry Kurtaev
e41ba90f17
Merge pull request #24004 from dkurt:tflite_new_layers
[TFLite] Pack layer and other fixes for SSD from Keras #24004

### Pull Request Readiness Checklist

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

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

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-07-21 09:13:37 +03:00
Vincent Rabaud
423ab8ddb8 Use void* 2023-07-20 15:53:57 +02:00
Vincent Rabaud
20784d3da2 Fix undefined behavior with wrong function pointers called.
Details here: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58006
runtime error: call to function (unknown) through pointer to incorrect function type 'void (*)(const unsigned char **, const int *, unsigned char **, const int *, int, int)'
2023-07-20 15:32:05 +02:00
Vadim Levin
1794cdc03c
Merge pull request #24023 from VadimLevin:dev/vlevin/python-typing-magic-constants
Python typing magic constants #24023

This patch adds typing stubs generation for `__all__` and `__version__` constants.

Introduced `__all__` is intentionally empty for all generated modules stubs. 

Type hints won't work for star imports

resolves #23950

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2023-07-20 09:18:29 +03:00
Alexander Smorkalov
c792233d9c
Merge pull request #24026 from VadimLevin:dev/vlevin/python-numpy-writeable-flag-check
fix: preserve NumPY writeable flag in output arguments
2023-07-19 19:17:30 +03:00
Vadim Levin
4c568e6ed3 fix: preserve NumPY writeable flag in output arguments 2023-07-19 17:22:10 +03:00
Vadim Levin
9519e67ad2
Merge pull request #24022 from VadimLevin:dev/vlevin/python-typing-cuda
Fix python typing stubs generation for CUDA modules #24022

resolves #23946
resolves #23945
resolves opencv/opencv-python#871

### 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.
- [x] The feature is well documented and sample code can be built with the project CMake
2023-07-19 16:51:41 +03:00
Alexander Smorkalov
b0cbd6ef77
Merge pull request #23999 from asmorkalov:as/opencv_logging
Use OpenCV logging instead of std::cerr
2023-07-19 14:46:27 +03:00
Alexander Smorkalov
23f27d8dbe Use OpenCV logging instead of std::cerr. 2023-07-19 10:49:54 +03:00
Alexander Smorkalov
81f07f001e
Merge pull request #24008 from iarspider:patch-1
test_houghlines: Fix C++20 compatibility
2023-07-18 15:37:43 +03:00
iarspider
55906457e6
test_houghlines: Fix C++20 compatibility
C++20 made it invalid to use simple-template-ids for constructors and destructors: https://eel.is/c++draft/diff.cpp17.class#2
GCC 11 and later throw an error on this, with the unhelpful message `expected unqualified-id before ')' token`. This PR fixes the problem.
2023-07-18 09:18:17 +02:00
cudawarped
e00c904585 cuda: add SkipTestException handling 2023-07-17 18:03:40 +03:00
Zihao Mu
1920993525
Merge pull request #23952 from zihaomu:fix_depth_conv_5x5
DNN: optimize the speed of general Depth-wise #23952

Try to solve the issue: https://github.com/opencv/opencv/issues/23941

### 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-07-14 17:34:39 +03:00
Alexander Smorkalov
1f7025f028
Merge pull request #23920 from loongson-zn:4.x
Fix LoongArch Macro Definition
2023-07-14 15:00:41 +03:00
firebladed
7819ec784b
Merge pull request #18498 from firebladed:patch-1
Add V4L2_PIX_FMT_Y16_BE pixel format #18498

Address #18495
relates to #23944

### 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 other license that is incompatible with OpenCV
- [ ] The PR is proposed to proper branch
- [x] There is reference to 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
- [ ] Test using Melexis MLX90640
2023-07-14 11:31:55 +03:00
Alexander Smorkalov
52d9685cb9 Fixed possible out-of-bound access in circles drawing. 2023-07-14 09:21:33 +03:00
Alexander Smorkalov
3aeaa34023
Merge pull request #23914 from AleksandrPanov:update_aruco_byteList_docs
update ArUco Dictionary documentation
2023-07-13 15:48:57 +03:00
Alex
c12e1ecb86 update aruco bytesList docs 2023-07-13 13:50:07 +03:00
Alexander Smorkalov
bd2695f01b
Merge pull request #23966 from hanliutong:popcount
Add missing ”v_popcount“ for RVV and enable tests.
2023-07-13 12:22:46 +03:00
Vincent Rabaud
fdfb875208
Merge pull request #23922 from vrabaud:imgwarp
Fix imgwarp at borders when transparent. #23922

I believe this is a proper fix to #23562

The PR #23754 overwrites data while that should not be the case with transparent data. The original test is failing because points at the border do not get computed because they do not have 4 neighbors to be computed. Still ,we can approximate their computation with whatever neighbors that are available.

### 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-07-12 15:20:01 +03:00
Alexander Smorkalov
85f0074f23
Merge pull request #23973 from mshabunin:riscv-unaligned-access
RISC-V: fix unaligned loads and stores
2023-07-12 14:51:56 +03:00
Alexander Smorkalov
0f17851562
Merge pull request #23972 from Avasam:partially-unknown-mat
Prefer using `TYPE_CHECKING` condition in `cv2.typing` module
2023-07-12 14:51:08 +03:00
Alexander Smorkalov
53af876999
Merge pull request #23969 from asmorkalov:as/python2_test_fix
Fixed tests execution with Python 2.7
2023-07-11 20:53:01 +03:00
Maksim Shabunin
3f0707234f risc-v: fix unaligned loads and stores 2023-07-11 19:23:12 +03:00
Avasam
cd9f85dbda Update usages of ConditionalAliasTypeNode following #23838 to use TYPE_CHECKING 2023-07-11 12:22:27 -04:00
Alexander Smorkalov
99058ee30b
Merge pull request #23956 from VadimLevin:dev/vlevin/recursive-re-export-submodules
fix: recursively re-export nested submodules in typing stubs
2023-07-11 18:45:27 +03:00
Alexander Smorkalov
48c52c8bbb Fixed tests execution with Python 2.7 2023-07-11 18:24:08 +03:00
Alexander Smorkalov
40727c8369
Merge pull request #23970 from mshabunin:fix-v4l-test
videoio: fix v4l2 test on older platforms (centos)
2023-07-11 18:16:28 +03:00
Maksim Shabunin
e3c1405254 videoio: fix v4l2 test on older platforms (centos) 2023-07-11 17:05:32 +03:00
Yusuke Kameda
87f8cdd699
doxygen: Fix ImwriteFlags documentation misalignment 2023-07-11 19:08:58 +09:00
Liutong HAN
a00818047f Add missing ”v_popcount“ for RVV and enable tests. 2023-07-11 16:10:27 +08:00
Alexander Smorkalov
6af4a02941
Merge pull request #23958 from VadimLevin:dev/vlevin/friendly-wrong-npy-type-message
feat: update NumPy type to Mat type fail message
2023-07-11 10:42:41 +03:00
Alexander Smorkalov
6ff5245cf2
Merge pull request #23927 from Avasam:partially-unknown-mat
Fix partially unknown Mat
2023-07-11 10:32:48 +03:00
Vincent Rabaud
2af6775c14
Merge pull request #23943 from vrabaud:avif_tsan
Fix checkSignature not thread safe for AVIF. #23943

A common decoder cannot be shared with checkSignature which is used like a static function (on a static ist of decoders).

### 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-07-11 10:25:53 +03:00
Alexander Smorkalov
bb61cc0dba
Merge pull request #23954 from VadimLevin:dev/vlevin/matrix-type-constants-stubs
feat: add matrix type stubs generation
2023-07-10 18:48:01 +03:00
Vadim Levin
953de60ff0 feat: update NumPy type to Mat type fail message
Output string representation of NumPy array type if it is not
convertible to OpenCV Mat type
2023-07-10 18:09:15 +03:00
Vadim Levin
986e379f28 feat: add matrix type stubs generation
Adds missing typing stubs:

- Matrix depths: `CV_8U`, `CV_8S` and etc.
- Matrix type constants: `CV_8UC1`, `CV_32FC3` and etc.
- Matrix type factory functions: `CV_*(channels) -> int` and `CV_MAKETYPE`
2023-07-10 17:35:27 +03:00
Vadim Levin
a6df336477 fix: recursively re-export nested submodules 2023-07-10 14:39:59 +03:00
Vadim Levin
8097bdc2f4 fix: typing stubs overload presence check 2023-07-10 14:30:44 +03:00
Alexander Smorkalov
fdc0c12b7f
Merge pull request #23944 from mshabunin:test-v4l2
videoio: test for V4L using virtual device
2023-07-10 12:54:43 +03:00
Alexander Smorkalov
05becd56e5
Merge pull request #23938 from mshabunin/fix-warnings-gcc
Fix compiler warnings for GCC 11-12 and Clang 13
2023-07-10 12:41:37 +03:00
Alexander Smorkalov
d2951d6d4c
Merge pull request #23928 from Avasam:Add-missing-properties-to-error-class
Add missing properties to error class
2023-07-10 12:40:06 +03:00
Maksim Shabunin
09944a83d9 build: w/a compiler warnings for GCC 11-12 and Clang 13, reduce build output 2023-07-10 11:27:59 +03:00
Maksim Shabunin
e43bc88fc3 videoio: test for V4L using virtual device 2023-07-07 17:33:33 +03:00
Maksim Shabunin
8931f08362 videoio: fix CAP_IMAGES with non-numbered file 2023-07-06 22:26:53 +03:00
Zhang Na
10294a84fa Fix LoongArch Macro Definition 2023-07-05 17:42:39 +08:00
Avasam
32251c9b04 Add missing properties to error class 2023-07-04 17:57:30 -04:00
Avasam
9f87475129 Fix partially unknown Mat 2023-07-04 16:44:32 -04:00
Berke
71796edf95
removed trailing semicolon after function
It gives error when building projects with -Wpedantic -Werror

error: extra ‘;’ [-Werror=pedantic]

Issue ##23916
2023-07-04 21:18:30 +03:00
Alexander Smorkalov
8839bd572e
Merge pull request #23815 from LaurentBerger:CAP_IMAGES
Add single image support to VideoCapture
2023-07-04 16:31:29 +03:00
Alexander Smorkalov
c9d8b541fc
Merge pull request #23896 from mshabunin:test-cap-images
videoio: tests for CAP_IMAGES
2023-07-04 16:30:53 +03:00
Alexander Alekhin
67faf1610e Merge pull request #23885 from hanliutong:UniversalIntrinsicRewriter 2023-07-03 14:56:30 +00:00
Alexander Smorkalov
377be68d92
Merge pull request #23892 from vrabaud:compile_fix
Fix compilation when HAVE_QUIRC is not set.
2023-07-03 13:16:49 +03:00
Wang Kai
0661aff4a5
Merge pull request #23900 from kai-waang:fixing-typo
Fixing typos in usac #23900

Just read and correct some typos in `usac`
### 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-07-03 12:08:12 +03:00
Vincent Rabaud
e9414169a3 Fix compilation when HAVE_QUIRC is not set.
One variable is unknown while the other one is unused.
Fixed build warnings.
2023-07-03 11:35:05 +03:00
Maksim Shabunin
1d9c0d3e12 videoio: tests for CAP_IMAGES 2023-07-03 10:33:16 +03:00
Wang Kai
d25d44156b removing unreachable codes in gbackend 2023-07-02 15:33:52 +08:00
Wang Kai
bca5868817 removing duplicated statement 2023-07-01 13:29:02 +08:00
Alexander Smorkalov
131dab774c Merge branch 'release_4.8.0' into 4.x 2023-06-28 15:22:43 +03:00
Alexander Smorkalov
f9a59f2592 Release OpenCV 4.8.0 2023-06-28 14:53:33 +03:00
Anatoliy Talamanov
b8b8c7c9e5
Merge pull request #23884 from TolyaTalamanov:at/fix-async-infer-ov-backend
G-API: Fix async inference for OpenVINO backend #23884

### 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-06-28 14:52:15 +03:00
Liutong HAN
d17507052e Rewrite SIMD code by using new Universal Intrinsic API. 2023-06-28 17:12:37 +08:00
Alexander Smorkalov
bf06bc92aa Merge branch '3.4' into merge-3.4 2023-06-23 20:12:58 +03:00
Yuantao Feng
aff420329c
Merge pull request #23853 from fengyuentau:disable_fp16_warning
dnn: disable warning when loading a fp16 model #23853

### 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-06-23 19:52:04 +03:00
Alexander Smorkalov
21d79abb1f
Merge pull request #23859 from TolyaTalamanov:at/ov-backend-core-wa
G-API: Apply ov::Core lifetime WA for OpenVINO Backend
2023-06-23 19:49:06 +03:00
Alexander Smorkalov
d9a5603fa3
Merge pull request #23860 from fengyuentau:fix_overflow_sigmoid_v3.4
dnn: fix overflow in sigmoid layer for 3.4
2023-06-23 19:47:42 +03:00
Alexander Smorkalov
ee97dd5211
Merge pull request #23806 from asmorkalov:as/usac_drop_mat_ptr
Get rid of unsafe raw pointers to Mat object in USAC
2023-06-23 16:23:03 +03:00
fengyuentau
29388f80a5 fix overflow 2023-06-23 21:22:21 +08:00
Alexander Panov
e7501b69ea
Merge pull request #23647 from AleksandrPanov:fix_charuco_board_detect
Add charuco board check #23647

Added charuco board checking to avoid detection of incorrect board.
Fixes #23517

### 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
2023-06-23 16:16:22 +03:00
TolyaTalamanov
c0fda696f3 Apply ov::Core WA 2023-06-23 12:16:21 +00:00
Paul Kim (김형준)
3b264d5877
Add pthread.h Inclusion if HAVE_PTHREADS_PF is defined
Single-case tested with success on Windows 11 with MinGW-w64 Standalone GCC v13.1.0 while building OpenCV 4.7.0
2023-06-23 17:53:03 +09:00
Alexander Smorkalov
0866a135c6 Git rid of unsafe raw pointers to Mat object. 2023-06-23 09:20:24 +03:00
Alexander Smorkalov
2849a774e3
Merge pull request #23846 from asmorkalov:as/ffmpeg_update_4.x
FFmpeg/4.x: update FFmpeg wrapper 2023.6
2023-06-22 21:00:06 +03:00
Alexander Panov
affc69bf1f
Merge pull request #23848 from AleksandrPanov:fix_detectDiamonds_api
Fix detect diamonds api #23848

`detectDiamonds` cannot be called from python, reproducer:

```
import numpy as np
import cv2 as cv

detector = cv.aruco.CharucoDetector(
    cv.aruco.CharucoBoard(
        (3, 3), 200.0, 100.0,
        cv.aruco.getPredefinedDictionary(cv.aruco.DICT_4X4_250)
    )
)
image = np.zeros((640, 480, 1), dtype=np.uint8)
res = detector.detectDiamonds(image)
print(res)
```

The error in `detectDiamonds` API fixed by replacing `InputOutputArrayOfArrays markerIds` with `InputOutputArray markerIds`.


### 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
2023-06-22 17:30:44 +03:00
Dmitry Kurtaev
22b747eae2
Merge pull request #23702 from dkurt:py_rotated_rect
Python binding for RotatedRect #23702

### Pull Request Readiness Checklist

related: https://github.com/opencv/opencv/issues/23546#issuecomment-1562894602

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-06-22 15:09:53 +03:00
Alexander Smorkalov
426b088754 FFmpeg/4.x: update FFmpeg wrapper 2023.6 2023-06-22 13:58:58 +03:00
Anatoliy Talamanov
60848519b5
Merge pull request #23843 from TolyaTalamanov:at/fix-missing-opaque-kind-for-kernel
G-API: Fix incorrect OpaqueKind for Kernel outputs #23843

### Pull Request Readiness Checklist

#### Overview
The PR is going to fix several problems:
1. Major: `GKernel` doesn't hold `kind` for its outputs. Since `GModelBuilder` traverse graph from outputs to inputs once it reaches any output of the operation it will use its `kind` to create  `Data` meta for all operation outputs. Since it essential for `python` to know `GTypeInfo` (which is `shape` and `kind`) it will be confused.

Consider this operation:
```
 @cv.gapi.op('custom.square_mean', in_types=[cv.GArray.Int], out_types=[cv.GOpaque.Float, cv.GArray.Int])
    class GSquareMean:
        @staticmethod
        def outMeta(desc):
            return cv.empty_gopaque_desc(), cv.empty_array_desc()
```
Even though `GOpaque` is `Float`, corresponding metadata might have `Int` kind because it might be taken from `cv.GArray.Int`
so it will be a problem if one of the outputs of these operation is graph output because python will cast it to the wrong type based on `Data` meta.

2. Minor: Some of the OpenVINO `IR`'s doesn't any layout information for input. It's usually true only for `IRv10` but since `OpenVINO 2.0` need this information to correctly configure resize we need to put default layout if there no such assigned in `ov::Model`. 

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-06-22 12:46:25 +03:00
Alexander Smorkalov
61d48dd0f8
Merge pull request #23540 from cudawarped:add_CAP_PROP_CODEC_FOURCC
`VideoCapture`: change `CAP_PROP_FOURCC` to fix #22876
2023-06-22 12:21:59 +03:00
Alexander Alekhin
1656e7573e gapi: fix static build with openvino 2023-06-21 14:17:44 +00:00
Alexander Smorkalov
fc810434de
Merge pull request #23801 from VadimLevin:dev/vlevin/python-stubs-api-refinement
feat: manual refinement for Python API definition
2023-06-21 10:44:36 +03:00
Alexander Smorkalov
65b957a5b3
Merge pull request #23832 from asmorkalov:as/reshape_docs
Document parameters of multi-dimentional reshape
2023-06-21 09:04:17 +03:00
Alexander Smorkalov
9eaa7bd566 Document parameters of multi-dimentional reshape. 2023-06-20 21:54:49 +03:00
Vadim Levin
f20edba925 fix: conditionally define generic NumPy NDArray alias 2023-06-20 20:05:58 +03:00
Alexander Smorkalov
fe4f5b539e
Merge pull request #23835 from VadimLevin:dev/vlevin/fix-ast-nodes-required-usage-imports
fix: AST nodes required usage imports
2023-06-20 18:34:07 +03:00
Vadim Levin
06b40aef91 fix: AST nodes required usage imports 2023-06-20 16:31:55 +03:00
Alexander Smorkalov
51702ffd92 pre: OpenCV 4.8.0 (version++) 2023-06-20 15:52:57 +03:00
Alexander Smorkalov
805946baaf pre: OpenCV 3.4.20 (version++) 2023-06-20 14:10:08 +03:00
Alexander Smorkalov
726ba0210e
Merge pull request #23825 from ulvido:4.x
if browser supports wasm but only asm.js path provided use asm.js as fallback
2023-06-20 13:35:18 +03:00
Anatoliy Talamanov
71790e12ad
Merge pull request #23799 from TolyaTalamanov:at/ov20-backend-implement-missing-kernels
G-API: Implement InferROI, InferList, InferList2 for OpenVINO backend #23799

### 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-06-20 13:29:23 +03:00
Anatoliy Talamanov
0cf45b89ec
Merge pull request #23796 from TolyaTalamanov:at/align-ie-backend-with-latest-openvino
G-API: Align IE Backend with the latest OpenVINO version #23796

### 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-06-20 12:33:08 +03:00
Alexander Smorkalov
004801f1c5 Merge remote-tracking branch 'origin/3.4' into merge-3.4 2023-06-20 09:56:57 +03:00
lamm45
ddcbd2cc26
Merge pull request #22798 from lamm45:distransform-large
Fix distransform to work with large images #22798

This attempts to fix the following bug which was caused by storing squares of large integers into 32-bit floating point variables:
https://github.com/opencv/opencv/issues/22732


### 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
2023-06-19 15:11:01 +03:00
Ulvi YELEN
d6d15c136a
if browser supports wasm but only asm.js path provided use asm.js as fallback 2023-06-17 09:38:57 +03:00
Alexander Smorkalov
a4a739b99e Force mat_wrapper import to satisfy dependencies for MatLike alias. 2023-06-16 21:51:17 +03:00
Alexander Smorkalov
c0d4e16833
Merge pull request #23819 from asmorkalov:as/objdetect_no_dnn
Fixed barcode to be built without DNN
2023-06-16 20:03:45 +03:00
Vadim Levin
94703fc5b0
Merge pull request #23816 from VadimLevin:dev/vlevin/export-all-caps-enum-constants
Export enums ALL_CAPS version to typing stub files #23816

- Export ALL_CAPS versions alongside from normal names for enum constants, since both versions are available in runtime
- Change enum names entries comments to documentary strings

Before patch
```python
RMat_Access_R: int
RMat_Access_W: int
RMat_Access = int  # One of [R, W]
```
After patch
```python
RMat_Access_R: int
RMAT_ACCESS_R: int
RMat_Access_W: int
RMAT_ACCESS_W: int
RMat_Access = int
"""One of [RMat_Access_R, RMAT_ACCESS_R, RMat_Access_W, RMAT_ACCESS_W]"""
```

Resolves: #23776

### 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-06-16 20:03:19 +03:00
Alexander Smorkalov
496474392e
Merge pull request #23809 from VadimLevin:dev/vlevin/re-export-stubs-submodules
feat: re-export symbols to cv2 level
2023-06-16 20:01:24 +03:00
Dmitry Kurtaev
433c364456
Merge pull request #23724 from dkurt:java_without_ant
Build Java without ANT #23724

### Pull Request Readiness Checklist

Enables a path of building Java bindings without ANT

* Able to build OpenCV JAR and Docs without ANT
  ```
  --   Java:
  --     ant:                         NO
  --     JNI:                         /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include/linux /usr/lib/jvm/default-java/include
  --     Java wrappers:               YES
  --     Java tests:                  NO
  ```
* Possible to build OpenCV JAR without ANT but tests still require ANT

**Merge with**: https://github.com/opencv/opencv_contrib/pull/3502

Notes:
- Use `OPENCV_JAVA_IGNORE_ANT=1` to force "Java" flow for building Java bindings
- Java tests still require Apache ANT
- JAR doesn't include `.java` source code files.


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.
- [x] The feature is well documented and sample code can be built with the project CMake
2023-06-16 19:58:20 +03:00
Dmitry Kurtaev
ec95efca10
Merge pull request #23754 from dkurt:remap_linear_transparent
Keep inliers for linear remap with BORDER_TRANSPARENT #23754

Address https://github.com/opencv/opencv/issues/23562

### Pull Request Readiness Checklist

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

I do think that this is a bug because with `INTER_CUBIC + BORDER_TRANSPARENT` the last column and row are preserved. So same should be done for `INTER_LINEAR`

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-06-16 18:30:21 +03:00
Alexander Smorkalov
003d048b0d
Merge pull request #23813 from VadimLevin:dev/vlevin/runtime-typing-module
fix: typing module enums references
2023-06-16 18:20:44 +03:00
Alexander Smorkalov
b6d1402361 Fixed barcode to be built without DNN 2023-06-16 15:12:49 +03:00
unknown
1eaa074a49 remove line 2023-06-16 11:28:11 +02:00
cudawarped
024c836462 cv::VideoCapture: change CAP_PROP_FOURCC to prefer codec_id over codec_tag 2023-06-16 11:56:44 +03:00
Maksym Ivashechkin
44881592c3
Merge pull request #23078 from ivashmak:update_vsac
Update USAC #23078

### 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
2023-06-16 10:59:13 +03:00
Alexander Smorkalov
3c0b71bcec
Merge pull request #23795 from dkurt:tf_half_pixel_for_nn
Consider half pixel mode in ONNX resize
2023-06-16 10:21:20 +03:00
Alexander Smorkalov
a9d547dfee
Merge pull request #23807 from mshabunin:barcode-test
objdetect: updated barcode test
2023-06-16 10:10:27 +03:00
Vadim Levin
69ebecc54f feat: add OpenCV error class to cv2/__init__.pyi 2023-06-15 23:10:10 +03:00
unknown
8762c37c22 solve issue 23808 2023-06-15 21:29:18 +02:00
Vadim Levin
a3b6a5b606 fix: typing module enums references
Enum names exist only during type checking.
During runtime they should be denoted as named integral types
2023-06-15 21:29:40 +03:00
dizcza
e625b32841 [opencv 3.x] back-ported tbb support ubuntu 22.04 2023-06-15 19:30:40 +03:00
Dmitry Kurtaev
924c01dbec
Replace CV_Assert_N 2023-06-15 17:30:33 +03:00
Alexander Smorkalov
0d7c039ea1
Merge pull request #23797 from asmorkalov:as/barcode_js_bindings
Barcode js bindings
2023-06-15 17:29:20 +03:00
Alexander Smorkalov
291689a178
Merge pull request #23800 from kai-waang:4.x
removing unreachable code and fixing a typo
2023-06-15 17:28:33 +03:00
Vadim Levin
1acbeb217b feat: re-export symbols to cv2 level
- Re-export native submodules of cv2 package level.
- Re-export  manually registered  symbols like cv2.mat_wrapper.Mat
2023-06-15 16:32:48 +03:00
Maksim Shabunin
2b3424b536 objdetect: updated barcode test 2023-06-15 15:32:19 +03:00
Alexander Smorkalov
538b13aeec JS bindings for bar code detector. 2023-06-15 15:01:01 +03:00
Alexander Smorkalov
0dde3b65d5
Merge pull request #23798 from VadimLevin:dev/vlevin/runtime-typing-module
feat: provide cv2.typing aliases at runtime
2023-06-15 14:41:13 +03:00
Maksim Shabunin
463cd09811
Merge pull request #23666 from mshabunin:barcode-move
Moved barcode from opencv_contrib #23666

Merge with https://github.com/opencv/opencv_contrib/pull/3497

##### TODO
- [x] Documentation (bib)
- [x] Tutorial (references)
- [x] Sample app (refactored)
- [x] Java (test passes)
- [x] Python (test passes)
- [x] Build without DNN
2023-06-14 22:21:38 +03:00
Vadim Levin
5859a531e5 feat: manual refinement for Python API definition
Mark `resize` and `calcHist` arguments as optional regardless of
their C++ API optionality
2023-06-14 21:24:05 +03:00
Vadim Levin
8e8638431d feat: provide cv2.typing aliases at runtime 2023-06-14 20:09:32 +03:00
Wang Kai
fc2d933224 removing unreachable code and fixing a typo 2023-06-15 01:09:02 +08:00
Alexander Smorkalov
52f46589a0
Merge pull request #23790 from asmorkalov:as/qrcode_aruco_js
JS bindings for Aruco-based QR code detector
2023-06-14 17:05:09 +03:00
Dmitry Kurtaev
6909fffde1 Consider half pixel mode in ONNX resize 2023-06-14 14:21:28 +03:00
Damiano Falcioni
19f4f2eb92
Merge pull request #23785 from damianofalcioni:4.x
added Aruco MIP dictionaries #23785

added Aruco MIP dictionaries: DICT_ARUCO_MIP_16h3, DICT_ARUCO_MIP_25h7, DICT_ARUCO_MIP_36h12 from [Aruco.js](https://github.com/damianofalcioni/js-aruco2), converted in opencv format using https://github.com/damianofalcioni/js-aruco2/blob/master/src/dictionaries/utils/dic2opencv.js

### 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-06-14 13:29:30 +03:00
Anatoliy Talamanov
b854d4ecd8
Merge pull request #23786 from TolyaTalamanov:at/expose-preprocessing-to-ie-backend
G-API: Expose explicit preprocessing for IE Backend #23786

### 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-06-14 09:29:49 +03:00
Alexander Smorkalov
b522148bd9
Merge pull request #23788 from dkurt:py_scalar_assign
Change Scalar assignment in Python from single value
2023-06-13 18:12:00 +03:00
Anatoliy Talamanov
a371bdac9d
Merge pull request #23766 from TolyaTalamanov:at/segmentation-demo-desync
G-API: Refine Semantic Segmentation Demo #23766

### Overview
* Supported demo working with camera id (e.g `--input=0`)
* Supported 3d output segmentation models (e.g `deeplabv3`)
* Supported `desync` execution
* Supported higher camera resolution
* Changed the color map to pascal voc (https://cloud.githubusercontent.com/assets/4503207/17803328/1006ca80-65f6-11e6-9ff6-36b7ef5b9ac6.png)

### 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-06-13 18:06:19 +03:00
Alexander Smorkalov
3af6001a75 JS bindings for Aruco-based QR code detector. 2023-06-13 17:20:52 +03:00
Alexander Smorkalov
843daca26e JS bingings fix for QR code detector. 2023-06-13 15:36:29 +03:00
Dmitry Kurtaev
f9d7f47e28 Change Scalar assignment in Python from single value 2023-06-13 10:45:03 +03:00
Alexander Smorkalov
e60a7c0d49
Merge pull request #23775 from kai-waang:fixing-typo
fixing typo of a variable name in dnn::runFastConv
2023-06-12 17:50:12 +03:00
zihaomu
37459f89c9 remove unsupported unsupported unicode 2023-06-11 23:02:34 +08:00
Wang Kai
4622f1e89b fixing typo of a variable name in dnn::runFastConv 2023-06-11 01:54:03 +08:00
Alexander Smorkalov
6ca697bc12
Merge pull request #23725 from asmorkalov:as/aruco_js_refresh
Refreshed JavaScript bindings for Aruco related algorithms
2023-06-10 09:21:24 +03:00
Sean McBride
57da72d444 Fixed invalid cast and unaligned memory access
Although acceptible to Intel CPUs, it's still undefined behaviour according to the C++ standard.

It can be replaced with memcpy, which makes the code simpler, and it generates the same assembly code with gcc and clang with -O2 (verified with godbolt).

Also expanded the test to include other little endian CPUs by testing for __LITTLE_ENDIAN__.
2023-06-09 18:56:49 -04:00
Alexander Smorkalov
fe14e7ab24
Merge pull request #23758 from AleksandrPanov:add_GenericGraphicalCode_interface
Add graphical code detector interface
2023-06-09 15:46:32 +03:00
Alexander Smorkalov
61488885b5 Refreshed JavaScript bindings for Aruco related algorithms. 2023-06-09 15:43:43 +03:00
Vincent Rabaud
472aad46a6
Merge pull request #23596 from vrabaud:libavif
Add AVIF support through libavif. #23596

This is to fix https://github.com/opencv/opencv/issues/19271
Extra: https://github.com/opencv/opencv_extra/pull/1069

### 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-06-09 15:39:10 +03:00
Alexander Smorkalov
0c8e6e0e68
Merge pull request #23740 from Peekabooc:4.x
fixing typo in stitching parameter names
2023-06-09 13:40:02 +03:00
Pierre Chatelier
60b806f9b8
Merge pull request #22947 from chacha21:hasNonZero
Added cv::hasNonZero() #22947 

`cv::hasNonZero()` is semantically equivalent to (`cv::countNonZero()>0`) but stops parsing the image when a non-zero value is found, for a performance gain

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

This pull request might be refused, but I submit it to know if further work is needed or if I just stop working on it.
The idea is only a performance gain vs `countNonZero()>0` at the cost of more code.

Reasons why it might be refused :

- this is just more code
- the execution time is "unfair"/"unpredictable" since it depends on the position of the first non-zero value
- the user must be aware that default search is from first row/col to last row/col and has no way to customize that, even if his use case lets him know where a non zero could be found
- the PR in its current state is using, for the ocl implementation, a mere `countNonZero()>0` ; there is not much sense in trying to break early the ocl kernel call when non-zero is encountered. So the ocl implementation does not bring any improvement.
- there is no IPP function that can help (`countNonZero()` is based in `ippCountInRange`)
- the PR in its current state might be slower than a call to `countNonZero()>0` in some cases (see "challenges" below)

Reasons why it might be accepted :

- the performance gain is huge on average, if we consider that "on average" means "non zero in the middle of the image"
- the "missing" IPP implementation is replaced by an "Open-CV universal intrinsics" implementation
- the PR in its current state is almost always faster than a call to `countNonZero()>0`, is only slightly slower in the worst cases, and not even for all matrices

**Challenges**
The worst case is either an all-zero matrix, or a non-zero at the very last position.  In such a case, the `hasNonZero()` implementation will parse the whole matrix like `countNonZero()` would do. But we expect the performance to be the same in this case. And `ippCountInRange` is hard to beat !
There is also the case of very small matrices (<=32x32...) in 8b, where the SIMD can be hard to feed.

For all cases but the worse, my custom `hasNonZero()` performs better than `ippCountInRange()`
For the worst case, my custom `hasNonZero()` performs better than `ippCountInRange()` *except for large matrices of type CV_32S or CV_64F* (but surprisingly, not CV_32F).
The difference is small, but it exists (and I don't understand why).
For very small CV_8U matrices `ippCountInRange()` seems unbeatable.

Here is the code that I use to check timings

```

  //test cv::hasNonZero() vs (cv::countNonZero()>0) for different matrices sizes, types, strides...
  {
    cv::setRNGSeed(1234);
    const std::vector<cv::Size> sizes = {{32, 32}, {64, 64}, {128, 128}, {320, 240}, {512, 512}, {640, 480}, {1024, 768}, {2048, 2048}, {1031, 1000}};
    const std::vector<int> types = {CV_8U, CV_16U, CV_32S, CV_32F, CV_64F};
    const size_t iterations = 1000;
    for(const cv::Size& size : sizes)
    {
      for(const int type : types)
      {
        for(int c = 0 ; c<2 ; ++c)
        {
          const bool continuous = !c;
          for(int i = 0 ; i<4 ; ++i)
          {
            cv::Mat m = continuous ? cv::Mat::zeros(size, type) : cv::Mat(cv::Mat::zeros(cv::Size(2*size.width, size.height), type), cv::Rect(cv::Point(0, 0), size));
            const bool nz = (i <= 2);
            const unsigned int nzOffsetRange = 10;
            const unsigned int nzOffset = cv::randu<unsigned int>()%nzOffsetRange;
            const cv::Point pos = 
              (i == 0) ? cv::Point(nzOffset, 0) :
              (i == 1) ? cv::Point(size.width/2-nzOffsetRange/2+nzOffset, size.height/2) :
              (i == 2) ? cv::Point(size.width-1-nzOffset, size.height-1) :
              cv::Point(0, 0);
            std::cout << "============================================================" << std::endl;
            std::cout << "size:" << size << "  type:" << type << "  continuous = " << (continuous ? "true" : "false") << "  iterations:" << iterations << "  nz=" << (nz ? "true" : "false");
            std::cout << "  pos=" << ((i == 0) ? "begin" : (i == 1) ? "middle" : (i == 2) ? "end" : "none");
            std::cout << std::endl;
            cv::Mat mask = cv::Mat::zeros(size, CV_8UC1);
            mask.at<unsigned char>(pos) = 0xFF;
            m.setTo(cv::Scalar::all(0));
            m.setTo(cv::Scalar::all(nz ? 1 : 0), mask);
            std::vector<bool> results;
            std::vector<double> timings;

            {
              bool res = false;
              auto ref = cv::getTickCount();
              for(size_t k = 0 ; k<iterations ; ++k)
                res = cv::hasNonZero(m);
              auto now = cv::getTickCount();
              const bool error = (res != nz);
              if (error)
                printf("!!ERROR!!\r\n");
              results.push_back(res);
              timings.push_back(1000.*(now-ref)/cv::getTickFrequency());
            }
            {
              bool res = false;
              auto ref = cv::getTickCount();
              for(size_t k = 0 ; k<iterations ; ++k)
                res = (cv::countNonZero(m)>0);
              auto now = cv::getTickCount();
              const bool error = (res != nz);
              if (error)
                printf("!!ERROR!!\r\n");
              results.push_back(res);
              timings.push_back(1000.*(now-ref)/cv::getTickFrequency());
            }

            const size_t bestTimingIndex = (std::min_element(timings.begin(), timings.end())-timings.begin());
            if ((bestTimingIndex != 0) || (std::find_if_not(results.begin(), results.end(), [&](bool r) {return (r == nz);}) != results.end()))
            {
              std::cout << "cv::hasNonZero\t\t=>" << results[0] << ((results[0] != nz) ? "  ERROR" : "") << "   perf:" << timings[0] << "ms => " << (iterations/timings[0]*1000) << " im/s" << ((bestTimingIndex == 0) ? " * " : "") << std::endl;
              std::cout << "cv::countNonZero\t=>" << results[1] << ((results[1] != nz) ? "  ERROR" : "") << "   perf:" << timings[1] << "ms => " << (iterations/timings[1]*1000) << " im/s" << ((bestTimingIndex == 1) ? " * " : "") << std::endl;
            }
          }
        }
      }
    }
  }

```

Here is a report of this benchmark (it only reports timings when `cv::countNonZero()` is faster)
My CPU is an Intel Core I7 4790 @ 3.60Ghz

```

============================================================
size:[32 x 32]  type:0  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[32 x 32]  type:0  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[32 x 32]  type:0  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[32 x 32]  type:0  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[32 x 32]  type:0  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[32 x 32]  type:0  continuous = false  iterations:1000  nz=true  pos=middle
cv::hasNonZero          =>1   perf:0.353764ms => 2.82674e+06 im/s
cv::countNonZero        =>1   perf:0.282044ms => 3.54555e+06 im/s *
============================================================
size:[32 x 32]  type:0  continuous = false  iterations:1000  nz=true  pos=end
cv::hasNonZero          =>1   perf:0.610478ms => 1.63806e+06 im/s
cv::countNonZero        =>1   perf:0.283182ms => 3.5313e+06 im/s *
============================================================
size:[32 x 32]  type:0  continuous = false  iterations:1000  nz=false  pos=none
cv::hasNonZero          =>0   perf:0.630115ms => 1.58701e+06 im/s
cv::countNonZero        =>0   perf:0.282044ms => 3.54555e+06 im/s *
============================================================
size:[32 x 32]  type:2  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[32 x 32]  type:2  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[32 x 32]  type:2  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[32 x 32]  type:2  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[32 x 32]  type:2  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[32 x 32]  type:2  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[32 x 32]  type:2  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[32 x 32]  type:2  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[32 x 32]  type:4  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[32 x 32]  type:4  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[32 x 32]  type:4  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[32 x 32]  type:4  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[32 x 32]  type:4  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[32 x 32]  type:4  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[32 x 32]  type:4  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[32 x 32]  type:4  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[32 x 32]  type:5  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[32 x 32]  type:5  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[32 x 32]  type:5  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[32 x 32]  type:5  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[32 x 32]  type:5  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[32 x 32]  type:5  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[32 x 32]  type:5  continuous = false  iterations:1000  nz=true  pos=end
cv::hasNonZero          =>1   perf:0.607347ms => 1.64651e+06 im/s
cv::countNonZero        =>1   perf:0.467037ms => 2.14116e+06 im/s *
============================================================
size:[32 x 32]  type:5  continuous = false  iterations:1000  nz=false  pos=none
cv::hasNonZero          =>0   perf:0.618162ms => 1.6177e+06 im/s
cv::countNonZero        =>0   perf:0.468175ms => 2.13595e+06 im/s *
============================================================
size:[32 x 32]  type:6  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[32 x 32]  type:6  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[32 x 32]  type:6  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[32 x 32]  type:6  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[32 x 32]  type:6  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[32 x 32]  type:6  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[32 x 32]  type:6  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[32 x 32]  type:6  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[64 x 64]  type:0  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[64 x 64]  type:0  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[64 x 64]  type:0  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[64 x 64]  type:0  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[64 x 64]  type:0  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[64 x 64]  type:0  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[64 x 64]  type:0  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[64 x 64]  type:0  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[64 x 64]  type:2  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[64 x 64]  type:2  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[64 x 64]  type:2  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[64 x 64]  type:2  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[64 x 64]  type:2  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[64 x 64]  type:2  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[64 x 64]  type:2  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[64 x 64]  type:2  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[64 x 64]  type:4  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[64 x 64]  type:4  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[64 x 64]  type:4  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[64 x 64]  type:4  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[64 x 64]  type:4  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[64 x 64]  type:4  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[64 x 64]  type:4  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[64 x 64]  type:4  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[64 x 64]  type:5  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[64 x 64]  type:5  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[64 x 64]  type:5  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[64 x 64]  type:5  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[64 x 64]  type:5  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[64 x 64]  type:5  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[64 x 64]  type:5  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[64 x 64]  type:5  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[64 x 64]  type:6  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[64 x 64]  type:6  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[64 x 64]  type:6  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[64 x 64]  type:6  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[64 x 64]  type:6  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[64 x 64]  type:6  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[64 x 64]  type:6  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[64 x 64]  type:6  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[128 x 128]  type:0  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[128 x 128]  type:0  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[128 x 128]  type:0  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[128 x 128]  type:0  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[128 x 128]  type:0  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[128 x 128]  type:0  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[128 x 128]  type:0  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[128 x 128]  type:0  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[128 x 128]  type:2  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[128 x 128]  type:2  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[128 x 128]  type:2  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[128 x 128]  type:2  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[128 x 128]  type:2  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[128 x 128]  type:2  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[128 x 128]  type:2  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[128 x 128]  type:2  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[128 x 128]  type:4  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[128 x 128]  type:4  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[128 x 128]  type:4  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[128 x 128]  type:4  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[128 x 128]  type:4  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[128 x 128]  type:4  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[128 x 128]  type:4  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[128 x 128]  type:4  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[128 x 128]  type:5  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[128 x 128]  type:5  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[128 x 128]  type:5  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[128 x 128]  type:5  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[128 x 128]  type:5  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[128 x 128]  type:5  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[128 x 128]  type:5  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[128 x 128]  type:5  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[128 x 128]  type:6  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[128 x 128]  type:6  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[128 x 128]  type:6  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[128 x 128]  type:6  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[128 x 128]  type:6  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[128 x 128]  type:6  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[128 x 128]  type:6  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[128 x 128]  type:6  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[320 x 240]  type:0  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[320 x 240]  type:0  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[320 x 240]  type:0  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[320 x 240]  type:0  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[320 x 240]  type:0  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[320 x 240]  type:0  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[320 x 240]  type:0  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[320 x 240]  type:0  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[320 x 240]  type:2  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[320 x 240]  type:2  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[320 x 240]  type:2  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[320 x 240]  type:2  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[320 x 240]  type:2  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[320 x 240]  type:2  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[320 x 240]  type:2  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[320 x 240]  type:2  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[320 x 240]  type:4  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[320 x 240]  type:4  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[320 x 240]  type:4  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[320 x 240]  type:4  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[320 x 240]  type:4  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[320 x 240]  type:4  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[320 x 240]  type:4  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[320 x 240]  type:4  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[320 x 240]  type:5  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[320 x 240]  type:5  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[320 x 240]  type:5  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[320 x 240]  type:5  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[320 x 240]  type:5  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[320 x 240]  type:5  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[320 x 240]  type:5  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[320 x 240]  type:5  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[320 x 240]  type:6  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[320 x 240]  type:6  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[320 x 240]  type:6  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[320 x 240]  type:6  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[320 x 240]  type:6  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[320 x 240]  type:6  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[320 x 240]  type:6  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[320 x 240]  type:6  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[512 x 512]  type:0  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[512 x 512]  type:0  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[512 x 512]  type:0  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[512 x 512]  type:0  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[512 x 512]  type:0  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[512 x 512]  type:0  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[512 x 512]  type:0  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[512 x 512]  type:0  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[512 x 512]  type:2  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[512 x 512]  type:2  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[512 x 512]  type:2  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[512 x 512]  type:2  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[512 x 512]  type:2  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[512 x 512]  type:2  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[512 x 512]  type:2  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[512 x 512]  type:2  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[512 x 512]  type:4  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[512 x 512]  type:4  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[512 x 512]  type:4  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[512 x 512]  type:4  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[512 x 512]  type:4  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[512 x 512]  type:4  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[512 x 512]  type:4  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[512 x 512]  type:4  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[512 x 512]  type:5  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[512 x 512]  type:5  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[512 x 512]  type:5  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[512 x 512]  type:5  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[512 x 512]  type:5  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[512 x 512]  type:5  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[512 x 512]  type:5  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[512 x 512]  type:5  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[512 x 512]  type:6  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[512 x 512]  type:6  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[512 x 512]  type:6  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[512 x 512]  type:6  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[512 x 512]  type:6  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[512 x 512]  type:6  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[512 x 512]  type:6  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[512 x 512]  type:6  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[640 x 480]  type:0  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[640 x 480]  type:0  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[640 x 480]  type:0  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[640 x 480]  type:0  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[640 x 480]  type:0  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[640 x 480]  type:0  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[640 x 480]  type:0  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[640 x 480]  type:0  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[640 x 480]  type:2  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[640 x 480]  type:2  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[640 x 480]  type:2  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[640 x 480]  type:2  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[640 x 480]  type:2  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[640 x 480]  type:2  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[640 x 480]  type:2  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[640 x 480]  type:2  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[640 x 480]  type:4  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[640 x 480]  type:4  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[640 x 480]  type:4  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[640 x 480]  type:4  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[640 x 480]  type:4  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[640 x 480]  type:4  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[640 x 480]  type:4  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[640 x 480]  type:4  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[640 x 480]  type:5  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[640 x 480]  type:5  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[640 x 480]  type:5  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[640 x 480]  type:5  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[640 x 480]  type:5  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[640 x 480]  type:5  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[640 x 480]  type:5  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[640 x 480]  type:5  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[640 x 480]  type:6  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[640 x 480]  type:6  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[640 x 480]  type:6  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[640 x 480]  type:6  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[640 x 480]  type:6  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[640 x 480]  type:6  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[640 x 480]  type:6  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[640 x 480]  type:6  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[1024 x 768]  type:0  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[1024 x 768]  type:0  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[1024 x 768]  type:0  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[1024 x 768]  type:0  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[1024 x 768]  type:0  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[1024 x 768]  type:0  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[1024 x 768]  type:0  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[1024 x 768]  type:0  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[1024 x 768]  type:2  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[1024 x 768]  type:2  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[1024 x 768]  type:2  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[1024 x 768]  type:2  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[1024 x 768]  type:2  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[1024 x 768]  type:2  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[1024 x 768]  type:2  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[1024 x 768]  type:2  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[1024 x 768]  type:4  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[1024 x 768]  type:4  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[1024 x 768]  type:4  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[1024 x 768]  type:4  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[1024 x 768]  type:4  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[1024 x 768]  type:4  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[1024 x 768]  type:4  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[1024 x 768]  type:4  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[1024 x 768]  type:5  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[1024 x 768]  type:5  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[1024 x 768]  type:5  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[1024 x 768]  type:5  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[1024 x 768]  type:5  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[1024 x 768]  type:5  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[1024 x 768]  type:5  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[1024 x 768]  type:5  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[1024 x 768]  type:6  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[1024 x 768]  type:6  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[1024 x 768]  type:6  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[1024 x 768]  type:6  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[1024 x 768]  type:6  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[1024 x 768]  type:6  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[1024 x 768]  type:6  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[1024 x 768]  type:6  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[2048 x 2048]  type:0  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[2048 x 2048]  type:0  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[2048 x 2048]  type:0  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[2048 x 2048]  type:0  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[2048 x 2048]  type:0  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[2048 x 2048]  type:0  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[2048 x 2048]  type:0  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[2048 x 2048]  type:0  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[2048 x 2048]  type:2  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[2048 x 2048]  type:2  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[2048 x 2048]  type:2  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[2048 x 2048]  type:2  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[2048 x 2048]  type:2  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[2048 x 2048]  type:2  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[2048 x 2048]  type:2  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[2048 x 2048]  type:2  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[2048 x 2048]  type:4  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[2048 x 2048]  type:4  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[2048 x 2048]  type:4  continuous = true  iterations:1000  nz=true  pos=end
cv::hasNonZero          =>1   perf:895.381ms => 1116.84 im/s
cv::countNonZero        =>1   perf:882.569ms => 1133.06 im/s *
============================================================
size:[2048 x 2048]  type:4  continuous = true  iterations:1000  nz=false  pos=none
cv::hasNonZero          =>0   perf:899.53ms => 1111.69 im/s
cv::countNonZero        =>0   perf:870.894ms => 1148.24 im/s *
============================================================
size:[2048 x 2048]  type:4  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[2048 x 2048]  type:4  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[2048 x 2048]  type:4  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[2048 x 2048]  type:4  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[2048 x 2048]  type:5  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[2048 x 2048]  type:5  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[2048 x 2048]  type:5  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[2048 x 2048]  type:5  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[2048 x 2048]  type:5  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[2048 x 2048]  type:5  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[2048 x 2048]  type:5  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[2048 x 2048]  type:5  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[2048 x 2048]  type:6  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[2048 x 2048]  type:6  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[2048 x 2048]  type:6  continuous = true  iterations:1000  nz=true  pos=end
cv::hasNonZero          =>1   perf:2018.92ms => 495.313 im/s
cv::countNonZero        =>1   perf:1966.37ms => 508.552 im/s *
============================================================
size:[2048 x 2048]  type:6  continuous = true  iterations:1000  nz=false  pos=none
cv::hasNonZero          =>0   perf:2005.87ms => 498.537 im/s
cv::countNonZero        =>0   perf:1992.78ms => 501.812 im/s *
============================================================
size:[2048 x 2048]  type:6  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[2048 x 2048]  type:6  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[2048 x 2048]  type:6  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[2048 x 2048]  type:6  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[1031 x 1000]  type:0  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[1031 x 1000]  type:0  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[1031 x 1000]  type:0  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[1031 x 1000]  type:0  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[1031 x 1000]  type:0  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[1031 x 1000]  type:0  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[1031 x 1000]  type:0  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[1031 x 1000]  type:0  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[1031 x 1000]  type:2  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[1031 x 1000]  type:2  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[1031 x 1000]  type:2  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[1031 x 1000]  type:2  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[1031 x 1000]  type:2  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[1031 x 1000]  type:2  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[1031 x 1000]  type:2  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[1031 x 1000]  type:2  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[1031 x 1000]  type:4  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[1031 x 1000]  type:4  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[1031 x 1000]  type:4  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[1031 x 1000]  type:4  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[1031 x 1000]  type:4  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[1031 x 1000]  type:4  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[1031 x 1000]  type:4  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[1031 x 1000]  type:4  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[1031 x 1000]  type:5  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[1031 x 1000]  type:5  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[1031 x 1000]  type:5  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[1031 x 1000]  type:5  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[1031 x 1000]  type:5  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[1031 x 1000]  type:5  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[1031 x 1000]  type:5  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[1031 x 1000]  type:5  continuous = false  iterations:1000  nz=false  pos=none
============================================================
size:[1031 x 1000]  type:6  continuous = true  iterations:1000  nz=true  pos=begin
============================================================
size:[1031 x 1000]  type:6  continuous = true  iterations:1000  nz=true  pos=middle
============================================================
size:[1031 x 1000]  type:6  continuous = true  iterations:1000  nz=true  pos=end
============================================================
size:[1031 x 1000]  type:6  continuous = true  iterations:1000  nz=false  pos=none
============================================================
size:[1031 x 1000]  type:6  continuous = false  iterations:1000  nz=true  pos=begin
============================================================
size:[1031 x 1000]  type:6  continuous = false  iterations:1000  nz=true  pos=middle
============================================================
size:[1031 x 1000]  type:6  continuous = false  iterations:1000  nz=true  pos=end
============================================================
size:[1031 x 1000]  type:6  continuous = false  iterations:1000  nz=false  pos=none
done

```
2023-06-09 13:37:20 +03:00
Zihao Mu
eec8a20c33
Merge pull request #23763 from zihaomu:add_runtime_check
DNN: fix bug for X86 Winograd #23763

Address https://github.com/opencv/opencv/issues/23760
The patch aims to add a runtime check for X86 platform without AVX(2).

### 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-06-09 09:18:12 +03:00
Alexander Smorkalov
5d913f4d72
Merge pull request #21959 from cpoerschke:4.x-intelligent-scissors-optimisation
imgproc: optimise local cost computation in IntelligentScissorsMB::buildMap
2023-06-08 16:45:04 +03:00
Alex
b729d8e821 added graphicalCodeDetector, remove QRCodeDetectorBase 2023-06-08 14:50:58 +03:00
Alexander Smorkalov
6d2cbc4055
Merge pull request #23761 from LaurentBerger:typeblobfromimages
checktype in blobFromImages and blobFromImagesWithParams
2023-06-08 09:59:01 +03:00
Christine Poerschke
f597838685 imgproc: optimise local cost computation in IntelligentScissorsMB::buildMap 2023-06-07 22:06:52 +01:00
TolyaTalamanov
af95395fe7 Fix ifdef condition 2023-06-07 15:42:54 +01:00
unknown
5f8e43da85 checktype in blobFromImages and blobFromImagesWithParams 2023-06-07 16:15:58 +02:00
Abduragim Shtanchaev
6b53fe8f7b
Merge pull request #23746 from Abdurrahheem:ash/graph_simplifier
Assertion Fix in Split Layer #23746

### Pull Request Readiness Checklist

This PR fixes issue mentioned in [#23663](https://github.com/opencv/opencv/issues/23663)
Merge with https://github.com/opencv/opencv_extra/pull/1067

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-06-07 16:01:42 +03:00
Christine Poerschke
d3e7968927
Merge pull request #23688 from cpoerschke:4.x-pr-21959-prep
imgproc: add contour values check to IntelligentScissorsMB tests

Preparation for the #21959 changes as per @asmorkalov's https://github.com/opencv/opencv/pull/21959#issuecomment-1560511500 suggestion.

### 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
2023-06-07 11:32:17 +03:00
Alexander Smorkalov
b9ce87e8e2
Merge pull request #23750 from mshabunin:fix-bgr2hls-access
imgproc/cvtColor: fixed invalid read in BGR2HLS
2023-06-06 11:34:08 +03:00
Alexander Smorkalov
af03e000c7
Merge pull request #23732 from vekkuli:vekkuli-patch-create-featherblender
Fix missuse of try_gpu in stitching/FeatherBlender
2023-06-06 10:00:36 +03:00
Maksim Shabunin
adab462e42 imgproc/cvtColor: fixed invalid read in BGR2HLS 2023-06-05 23:25:44 +03:00
Alex
b5ac7ef2f2 fix cornerRefinementMethod binding 2023-06-05 11:04:11 +03:00
Wang Kai
983925c685 fixing typo 2023-06-04 19:06:26 +08:00
Jaakko Rantala
385003e9fe
Update blenders.cpp
Removed passing try_gpu parameter to FeatherBlender constructor because it only has sharpness parameter.
2023-06-02 16:46:05 +03:00
Alexander Panov
9fa014edcd
Merge pull request #23264 from AleksandrPanov:add_detect_qr_with_aruco
Add detect qr with aruco #23264

Using Aruco to detect finder patterns to search QR codes.

TODO (in next PR):
- add single QR detect (update `detect()` and `detectAndDecode()`)
- need reduce full enumeration of finder patterns
- need add finder pattern info to `decode` step
- need to merge the pipeline of the old and new algorithm

[Current results:](https://docs.google.com/spreadsheets/d/1ufKyR-Zs-IGXwvqPgftssmTlceVjiQX364sbrjr2QU8/edit#gid=1192415584)
+20% total detect, +8% total decode in OpenCV [QR benchmark](https://github.com/opencv/opencv_benchmarks/tree/develop/python_benchmarks/qr_codes) 

![res1](https://user-images.githubusercontent.com/22337800/231228556-191d3eae-a318-44e1-af99-e7d420bf6248.png)


78.4% detect, 58.7% decode vs 58.5 detect, 50.5% decode in default

[main.py.txt](https://github.com/opencv/opencv/files/10762369/main.py.txt)

![res2](https://user-images.githubusercontent.com/22337800/231229123-ed7f1eda-159a-444b-a3ff-f107d8eb4a20.png)


add new info to [google docs](https://docs.google.com/spreadsheets/d/1ufKyR-Zs-IGXwvqPgftssmTlceVjiQX364sbrjr2QU8/edit?usp=sharing)


### 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
2023-06-02 16:18:24 +03:00
Anatoliy Talamanov
5330112f05
Merge pull request #23595 from TolyaTalamanov:at/implement-openvino-backend
[G-API] Implement OpenVINO 2.0 backend #23595

### Pull Request Readiness Checklist

Implemented basic functionality for `OpenVINO` 2.0 G-API backend.

#### Overview
- [x] Implement `Infer` kernel with some of essential configurable parameters + IR/Blob models format support.
- [ ] Implement the rest of kernels: `InferList`, `InferROI`, `Infer2` + other configurable params (e.g reshape)
- [x] Asyncrhonous execution support
- [ ] Remote context support

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
- [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-06-02 14:31:03 +03:00
Alexander Smorkalov
2104d61d4a
Merge pull request #23668 from TolyaTalamanov:at/fix-resize-applying-logic-ie-backend
WIP: [G-API] IE Backend: Update the condition for applying the resize preprocessing
2023-06-01 13:55:07 +03:00
Alexander Smorkalov
0787c31f41 Python package classifiers sync with OpenCV-Python repo. 2023-06-01 10:49:27 +03:00
Anna Khakimova
6d3dd24622
Merge pull request #21797 from anna-khakimova:ak/merge3_extend_supported_types
GAPI Fluid SIMD:Add support of new several types for the Merge3

- Support of the new several types was added.
- Fixes for the Split/Merge and ConvertTo issues.
2023-05-31 14:59:39 +03:00
Dmitry Matveev
fc5d412ba7
Merge pull request #23597 from dmatveev:dm/gapi_onnx_py_integration
G-API: Integration branch for ONNX & Python-related changes #23597

# Changes overview

## 1. Expose ONNX backend's Normalization and Mean-value parameters in Python

* Since Python G-API bindings rely on `Generic` infer to express Inference, the `Generic` specialization of `onnx::Params` was extended with new methods to control normalization (`/255`) and mean-value; these methods were exposed in the Python bindings
* Found some questionable parts in the existing API which I'd like to review/discuss (see comments)

UPD:
1. Thanks to @TolyaTalamanov normalization inconsistencies have been identified with `squeezenet1.0-9` ONNX model itself; tests using these model were updated to DISABLE normalization and NOT using mean/value.
2. Questionable parts were removed and tests still pass.

### Details (taken from @TolyaTalamanov's comment):

`squeezenet1.0.*onnx` - doesn't require scaling to [0,1] and mean/std because the weights of the first convolution already scaled. ONNX documentation is broken. So the correct approach to use this models is:

1. ONNX: apply preprocessing from the documentation: https://github.com/onnx/models/blob/main/vision/classification/imagenet_preprocess.py#L8-L44 but without normalization step:
```
# DON'T DO IT:
# mean_vec = np.array([0.485, 0.456, 0.406])
# stddev_vec = np.array([0.229, 0.224, 0.225])
# norm_img_data = np.zeros(img_data.shape).astype('float32')
# for i in range(img_data.shape[0]):
#     norm_img_data[i,:,:] = (img_data[i,:,:]/255 - mean_vec[i]) / stddev_vec[i]
#     # add batch channel
#     norm_img_data = norm_img_data.reshape(1, 3, 224, 224).astype('float32')
#     return norm_img_data

# INSTEAD
return img_data.reshape(1, 3, 224, 224)
```

2. G-API: Convert image from BGR to RGB and then pass to `apply` as-is with configuring parameters:
```
net = cv.gapi.onnx.params('squeezenet', model_filename)
net.cfgNormalize('data_0', False)
```
**Note**: Results might be difference because `G-API` doesn't apply central crop but just do resize to model resolution.

---

`squeezenet1.1.*onnx` - requires scaling to [0,1] and mean/std - onnx documentation is correct.
1. ONNX: apply preprocessing from the documentation: https://github.com/onnx/models/blob/main/vision/classification/imagenet_preprocess.py#L8-L44
2. G-API: Convert image from BGR to RGB and then pass to `apply` as-is with configuring parameters:
```
net = cv.gapi.onnx.params('squeezenet', model_filename)
net.cfgNormalize('data_0', True) // default
net.cfgMeanStd('data_0', [0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
```
**Note**: Results might be difference because `G-API` doesn't apply central crop but just do resize to model resolution.

## 2. Expose Fluid & kernel package-related functionality in Python

* `cv::gapi::combine()`
* `cv::GKernelPackage::size()` (mainly for testing purposes)
* `cv::gapi::imgproc::fluid::kernels()`

Added a test for the above.

## 3. Fixed issues with Python stateful kernel handling

Fixed error message when `outMeta()` of custom python operation fails.

## 4. Fixed various issues in Python tests

1. `test_gapi_streaming.py` - fixed behavior of Desync test to avoid sporadic issues
2. `test_gapi_infer_onnx.py` - fixed model lookup (it was still using the ONNX Zoo layout but was NOT using the proper env var we use to point to one).

### 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-05-30 17:52:17 +03:00
Pierre Chatelier
93d490213f
Merge pull request #23690 from chacha21:rotatedRectangleIntersection_precision
better accuracy for _rotatedRectangleIntersection() (proposal for #23546) #23690

_rotatedRectangleIntersection() can be (statically) customized to use double instead of float for better accuracy
this is a proposal for experimentation around #23546

for better accuracy, _rotatedRectangleIntersection() could use double. It will still return cv::Point2f list for backward compatibility, but the inner computations are controlled by a typedef

- [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-05-30 17:46:39 +03:00
Olivier Hotel
0442c6fa81 Addition of normalize_axis to ONNXImporter::parseSqueeze to support negative values for the axes attribut.
Negative values are part of the ONNX optset>=11.

Signed-off-by: Olivier Hotel <olivier.hotel@orange.com>
2023-05-30 10:21:27 +02:00
Abduragim Shtanchaev
ecd2e8ff47 added index that check all inputs of nodes that
match
2023-05-29 14:48:42 +03:00
Alexander Smorkalov
02397ef851
Merge pull request #23567 from seanm:UBSan-overflow
Reformulated some pointer arithmetic to avoid (unsigned) overflow
2023-05-29 12:19:34 +03:00
Christine Poerschke
b5e9eb742c
Merge pull request #23698 from cpoerschke:4.x-pr-21959-perf
imgproc: add basic IntelligentScissorsMB performance test #23698

Adding basic performance test that can be used before and after the #21959 changes etc. as per @asmorkalov's https://github.com/opencv/opencv/pull/21959#issuecomment-1565240926 comment.

### 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
2023-05-29 11:02:59 +03:00
triple Mu
1bffe170e1
Update setup.py
Fix error:
UnboundLocalError: local variable 'typing_stub_files' referenced before assignment
2023-05-27 17:23:32 +08:00
Alexander Smorkalov
7b998c30e7
Merge pull request #23694 from dkurt:update_matchTemplateMask
Update matchTemplate with mask
2023-05-27 09:42:55 +03:00
Sean McBride
2083fdc9c0 Fixed UBSan warning about undefined pointer arithmetic overflow
Pointer arithmetic overflow is always undefined, whether signed or unsigned.

It warned here:

`Addition of unsigned offset to 0x00017fd31b97 overflowed to 0x00017fd30c97`

Convert the offset to a signed number, so that we can offset either forward or backwards.

In my own use of OpenCV at least, this is the only case of pointer arithmetic overflow.
2023-05-26 15:54:52 -04:00
Alexander Smorkalov
d1b158b9dd
Merge pull request #23692 from asmorkalov:as/ffmpeg_fps_3.4
backport to 3.4: Fixed FPS computation on some videos for FFmpeg backend
2023-05-26 20:47:13 +03:00
Dmitry Kurtaev
380caa1a87
Merge pull request #23691 from dkurt:pycv_float16_fixes
Import and export np.float16 in Python #23691

### Pull Request Readiness Checklist

* Also, fixes `cv::norm` with `NORM_INF` and `CV_16F`

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

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-05-26 18:56:21 +03:00
Alexander Smorkalov
900f17d563
Merge pull request #23677 from asmorkalov:as/objc_naming_backport
ObjC naming backport from 5.x
2023-05-26 18:54:34 +03:00
Dmitry Kurtaev
c97942cf78 Fix mask thresholding 2023-05-26 18:51:33 +03:00
captain-n3m0
6157db6462 Fixed matchTemplate function. #23585 2023-05-26 18:51:01 +03:00
Duong Dac
a9424868a1
Merge pull request #20370 from ddacw:stub-gen-next
Python typing stub generation #20370

Add stub generation to `gen2.py`, addressing #14590.

### 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 other license that is incompatible with OpenCV
- [x] The PR is proposed to proper branch
- [x] There is reference to 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-05-26 18:25:46 +03:00
Alexander Smorkalov
cbda161c39 Fixed FPS computation on some videos for FFmpeg backend. 2023-05-26 14:36:13 +03:00
Alexander Smorkalov
cf0ba039c3
Merge pull request #23625 from zihaomu:improve_conv
DNN: Remove unnecessary flags for convolution
2023-05-26 12:59:36 +03:00
Alexander Smorkalov
65487946cc Added final constrants check to solveLP to filter out flating-point numeric issues. 2023-05-25 17:29:01 +03:00
Dmitry Kurtaev
4823285b55
Merge pull request #23679 from dkurt:py_cv_type_macro
Python bindings for CV_8UC(n) and other types macros #23679

### Pull Request Readiness Checklist

resolves https://github.com/opencv/opencv/issues/23628#issuecomment-1562468327

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-05-25 15:54:41 +03:00
Alexander Smorkalov
26a7b332cb
Merge pull request #23671 from zihaomu:fix_potential_bug
DNN: fix potential bug, stride should not be set as 0.
2023-05-25 13:36:37 +03:00
Yuantao Feng
f07b01cc34
Merge pull request #23655 from fengyuentau:qlinearsoftmax
Support ONNX operator QLinearSoftmax in dnn #23655

Resolves https://github.com/opencv/opencv/issues/23636.
Merge with https://github.com/opencv/opencv_extra/pull/1064.

This PR maps the QLinearSoftmax (from com.microsoft domain) to SoftmaxInt8 in dnn along with some speed optimization.

Todo:
- [x] support QLinearSoftmax with opset = 13
- [x] add model and test data for QLinearSoftmax with opset = 13
- [x] ensure all models have dims >= 3.
- [x] add the script to generate model and test data 

### 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-05-25 13:35:58 +03:00
Alexander Smorkalov
bbda6f4c57 Backport 5.x: Support for module names that start from digit in ObjC bindings generator. 2023-05-25 11:45:59 +03:00
Dmitry Kurtaev
29b2f77b5f
Merge pull request #23674 from dkurt:py_cv_maketype
CV_MAKETYPE Python binding #23674 

### Pull Request Readiness Checklist

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

```python
import cv2 as cv

t = cv.CV_MAKETYPE(cv.CV_32F, 4)
```

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-05-25 09:45:22 +03:00
Maksim Shabunin
537060d96f
Merge pull request #23672 from mshabunin:fix-javadoc17 2023-05-24 23:07:27 +03:00
zihaomu
4384e77bd1 when stride ==0, it should be bug 2023-05-24 21:57:59 +08:00
TolyaTalamanov
dc714c1181 Change logic for applying resize 2023-05-24 13:06:19 +00:00
Alexander Smorkalov
d4861bfd1f Merge remote-tracking branch 'origin/3.4' into merge-3.4 2023-05-24 14:37:48 +03:00
Akshat Chauhan
c07145fe28
Merge pull request #23662 from akormous:docfix
Fix truncated sentenced in boxPoints documentation #22975 #23662

Resolves #22975

Completed the sentence as per the suggestion given in the issue #22975
### 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-05-24 11:41:25 +03:00
Alexander Smorkalov
98d678c2d2 Added check that YUYV input of cvtColor has even width. 2023-05-23 14:17:43 +03:00
Alexander Smorkalov
4a559bc2ab
Merge pull request #23656 from peters:patch-2
Build fix for AVX 256
2023-05-23 09:20:34 +03:00
Alexander Smorkalov
e3c5c0906b
Merge pull request #23371 from cudawarped:cuda_add_futher_python_interop
`cuda`: Add bindings to allow `GpuMat` and `Stream` objects to be initialized from memory initialized in other libraries
2023-05-22 18:17:12 +03:00
Alexander Smorkalov
b122a4b436
Merge pull request #23646 from dkurt:dnn_ie_region_fix
Fix Region layer with OpenVINO in case of different width/height
2023-05-22 16:22:50 +03:00
Christine Poerschke
d00a96315e
Merge pull request #23612 from cpoerschke:3.4-issue-21532
QRCodeDetector: don't floodFill with outside-of-image seedPoint #23612

Fixes #21532.

### 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
2023-05-22 13:34:30 +03:00
Peter Rekdal Khan-Sunde
04970490ec
Build fix
/build/build_cuda/3p/opencv/linux-x64/ubuntu22.04/Debug/modules/dnn/src/layers/cpu_kernels/convolution.cpp: In function 'void cv::dnn::packData8(char*&, float*&, int&, int&, int&, const int*, int, int, int)':
/build/build_cuda/3p/opencv/linux-x64/ubuntu22.04/Debug/modules/dnn/src/layers/cpu_kernels/convolution.cpp:448:43: error: 'CONV_NR' was not declared in this scope; did you mean 'CONV_3D'?
  448 |                 vx_store(inpbufC_FP32 + k*CONV_NR, vx_load(inptrInC + k1));
      |                                           ^~~~~~~
      |                                           CONV_3D
2023-05-22 11:25:04 +02:00
cudawarped
7539abecdb cuda: add python bindings to allow GpuMat and Stream objects to be initialized from raw pointers 2023-05-22 11:02:04 +03:00
Alexander Smorkalov
3f3c821800
Merge pull request #23631 from asmorkalov:as/eigen_NOMINMAX_warning_fix
Build warning fix on Windows for Eigen wrapper.
2023-05-19 21:06:41 +03:00
Alexander Smorkalov
c946285a07
Merge pull request #23601 from cudawarped:videocapture_threading
Videoio: FFMpeg remove locks from `VideoCapure/VideoWriter::open()` to fix 20114
2023-05-19 20:33:25 +03:00
Dmitry Kurtaev
c92135bdd1
Merge pull request #23634 from dkurt:fix_nearest_exact
Fix even input dimensions for INTER_NEAREST_EXACT #23634

### Pull Request Readiness Checklist

resolves https://github.com/opencv/opencv/issues/22204
related: https://github.com/opencv/opencv/issues/9096#issuecomment-1551306017

/cc @Yosshi999

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-05-19 20:32:04 +03:00
Alexander Smorkalov
f2311d1bfd
Merge pull request #23645 from Abdurrahheem:ash/tf_init_input_check
Add assert to check if layer input size is not empty
2023-05-19 13:28:24 +03:00
Zihao Mu
5025f29378
speed up vulkan dnn, and support ios and apple m1 chip. (#23349) 2023-05-18 20:02:27 +03:00
Dmitry Kurtaev
af14780526 Fix Region layer with OpenVINO in case of different width/height 2023-05-18 17:45:30 +03:00
Abduragim Shtanchaev
2b9d2c726a add assert to check if layer input size is not empty 2023-05-18 16:17:57 +03:00
SoY Szala
340e999c45 Proposed solution for issue #23633 2023-05-17 23:06:59 +02:00