Metadata-Version: 2.1
Name: opencv-stubs
Version: 0.0.6
Summary: Unofficial stubs for the opencv-python package.
Project-URL: Homepage, https://github.com/hoel-bagard/opencv-stubs
Project-URL: Bug Tracker, https://github.com/hoel-bagard/opencv-stubs/issues
Author: Bagard Hoel
License: MIT
License-File: LICENSE
Keywords: OpenCV,stubs
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: >=3.8
Requires-Dist: numpy>=1.21
Provides-Extra: build
Requires-Dist: hatch; extra == 'build'
Provides-Extra: dev
Requires-Dist: pip-tools; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: pyright; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: flake8
Requires-Dist: flake8; extra == 'flake8'
Requires-Dist: flake8-broken-line; extra == 'flake8'
Requires-Dist: flake8-bugbear; extra == 'flake8'
Requires-Dist: flake8-builtins; extra == 'flake8'
Requires-Dist: flake8-commas; extra == 'flake8'
Requires-Dist: flake8-comprehensions; extra == 'flake8'
Requires-Dist: flake8-docstrings; extra == 'flake8'
Requires-Dist: flake8-import-order; extra == 'flake8'
Requires-Dist: flake8-noqa; extra == 'flake8'
Requires-Dist: flake8-pyproject; extra == 'flake8'
Requires-Dist: flake8-quotes; extra == 'flake8'
Requires-Dist: pep8-naming; extra == 'flake8'
Provides-Extra: opencv
Requires-Dist: opencv-python>=4.7.0; extra == 'opencv'
Provides-Extra: opencv-contrib
Requires-Dist: opencv-contrib-python>=4.7.0; extra == 'opencv-contrib'
Provides-Extra: opencv-headless
Requires-Dist: opencv-python-headless>=4.7.0; extra == 'opencv-headless'
Description-Content-Type: text/markdown

# OpenCV stubs

[![PyPI](https://img.shields.io/pypi/v/opencv-stubs?color=green&style=flat)](https://pypi.org/project/opencv-stubs)
[![PyPI - Implementation](https://img.shields.io/pypi/implementation/opencv-stubs?style=flat)](https://pypi.org/project/opencv-stubs)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/opencv-stubs?style=flat)](https://pypi.org/project/opencv-stubs)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/opencv-stubs?style=flat-square)](https://pypistats.org/packages/opencv-stubs)
[![License](https://img.shields.io/pypi/l/opencv-stubs?style=flat)](https://opensource.org/licenses/MIT)
![Linting](https://github.com/hoel-bagard/opencv-stubs/actions/workflows/pre-commit.yaml/badge.svg)

Unofficial python stubs for the opencv-python package.

This package includes all the functions, classes and constants (please open an issue if you find a missing one).\
For some functions, OpenCV may handle more types than defined in this package. If you would like a type/function to be added or modified, please open an issue or a PR. There may also be a few errors as some types have been added progrmmatically. Please open an issue if you see one.
The typing is still a work in progress, if you want a function/method to be added first you can open an issue.

The stubs include the docstrings as they are otherwise not available in the IDE (as far as I know).

These stubs are a temporary help until official ones are made (see [this issue](https://github.com/opencv/opencv/issues/14590)).


## Installation

The package is available on pypi [here](https://pypi.org/project/opencv-stubs/), you can install it with:

```
pip install opencv-stubs
```

The dependency on opencv is optional, and can be accessed with:
- `pip install opencv-stubs[opencv]`
- `pip install opencv-stubs[opencv-contrib]`
- `pip install opencv-stubs[opencv-headless]`


## Acknowledgements

A stub file with opencv functions can be found on the [Microsoft stubs repo](https://github.com/microsoft/python-type-stubs/tree/main/cv2). This package reused those functions (with some added typing).


## TODO:
- [ ] Do something about `cv2.gapi.cv`, `cv2.utils.cv2` and `cv2.mat_wrapper.cv` (do not duplicate everything if possible).
- [ ] Handle cases like `cv2.misc.version.cv2.misc.version.cv2.misc.get_ocv_version()`.
- [ ] Only include the `opencv-contrib` specific stubs when using `opencv-stubs[opencv-contrib]`.
