Commit Graph

790 Commits

Author SHA1 Message Date
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
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
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
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
Avasam
32251c9b04 Add missing properties to error class 2023-07-04 17:57:30 -04: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
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
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
a4a739b99e Force mat_wrapper import to satisfy dependencies for MatLike alias. 2023-06-16 21:51:17 +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
Vadim Levin
69ebecc54f feat: add OpenCV error class to cv2/__init__.pyi 2023-06-15 23:10:10 +03: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
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
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
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
Dmitry Kurtaev
f9d7f47e28 Change Scalar assignment in Python from single value 2023-06-13 10:45:03 +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
0787c31f41 Python package classifiers sync with OpenCV-Python repo. 2023-06-01 10:49:27 +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
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
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
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
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
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
SoY Szala
340e999c45 Proposed solution for issue #23633 2023-05-17 23:06:59 +02:00
Spike
95f087cd0b Fix reference counting errors in registerNewType 2023-03-13 23:22:57 -06:00
Vadim Levin
642942a72f fix: remove extra '/O' modifier for '/IO' arguments 2023-02-17 13:07:28 +03:00
Vadim Levin
b07031b594 feat: named arguments handling in Python interface 2023-02-06 22:14:58 +03:00
Alexander Alekhin
b42c11de82 pre: OpenCV 4.7.0 (version++) 2022-12-25 17:00:22 +00:00
Alexander Smorkalov
9012e6dd9b
Merge pull request #22965 from vrabaud:numpy_fix
Remove references to deprecated NumPy type aliases.
2022-12-23 15:34:02 +03:00
Vincent Rabaud
ad568edd7f Remove references to deprecated NumPy type aliases.
This change replaces references to a number of deprecated NumPy
type aliases (np.bool, np.int, np.float, np.complex, np.object,
np.str) with their recommended replacement (bool, int, float,
complex, object, str).

Those types were deprecated in 1.20 and are removed in 1.24,
cf https://github.com/numpy/numpy/pull/22607.
2022-12-23 13:53:49 +03:00
Marco Feuerstein
bc8d494617
Merge pull request #22959 from feuerste:parallel_mertens
Parallelize implementation of HDR MergeMertens.

* Parallelize MergeMertens.

* Added performance tests for HDR.

* Ran clang-format.

* Optimizations.

* Fix data path for Windows.

* Remove compiiation warning on Windows.

* Remove clang-format for existing file.

* Addressing reviewer comments.

* Ensure correct summation order.

* Add test for determinism.

* Move result pyramid into sync struct.

* Reuse sync for first loop as well.

* Use OpenCV's threading primitives.

* Remove cout.
2022-12-21 14:10:59 +00:00
Alexander Alekhin
420db56ffd Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2022-12-18 02:17:17 +00:00
Alexander Alekhin
eace6adb6d Merge pull request #22934 from alalek:fix_filestorage_binding 2022-12-17 03:28:13 +00:00
Alexander Alekhin
6a8c5a1d27 python: resolve Ptr<FileStorage> requirement issue 2022-12-16 00:47:44 +00:00
Sergei Shutov
8bd17163c7
Merge pull request #22939 from stopmosk:21826-python-bindings-for-videocapturewaitany
Add Python bindings for VideoCapture::waitAny #21826

### 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
2022-12-14 22:15:02 +03:00
Alexander Smorkalov
52709c7771
Merge pull request #22954 from VadimLevin:dev/vlevin/fix-merge-artifacts-in-python-misc-tests
fix: remove function duplicates in test_misc.py
2022-12-14 09:42:43 +03:00