Skip to main content

Unofficial stubs for the opencv-python package.

Project description

OpenCV stubs

PyPI PyPI - Implementation PyPI - Python Version PyPI - Downloads License Linting

Unofficial python stubs for the opencv-python package.

Official OpenCV stubs now exist (in OpenCV>=4.8, cf this issue and this PR), so this repo was archived from 2023/03/27 to 2024/04/13.
However I found the official stubs unhelpfull when it came to type hinting, so I'm un-archiving the repo.

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 programmatically. Please open an issue/PR if you see one.

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

Installation

The package is available on pypi here, 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. 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].

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opencv_stubs-0.0.10.tar.gz (341.2 kB view details)

Uploaded Source

Built Distribution

opencv_stubs-0.0.10-py3-none-any.whl (362.6 kB view details)

Uploaded Python 3

File details

Details for the file opencv_stubs-0.0.10.tar.gz.

File metadata

  • Download URL: opencv_stubs-0.0.10.tar.gz
  • Upload date:
  • Size: 341.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for opencv_stubs-0.0.10.tar.gz
Algorithm Hash digest
SHA256 d739c5e7b0628838e1a9a7dc88f9eb1b2c0a9df14d5ae879f9615788a9de1436
MD5 50849e03bbf45268342bc055b754485a
BLAKE2b-256 5dd3cebbcce9083345047818190ae1b354166812b3687e104aefc0bb3c430580

See more details on using hashes here.

File details

Details for the file opencv_stubs-0.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for opencv_stubs-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 470f979b7403e1766857fd21922f292a9b84450da90d2e498d63c6b59148d87e
MD5 5d9ce01a5a2d58dbe7cb8a49d2d20820
BLAKE2b-256 69d2bde334d5d9a95dbda9038ae1c682529d66f4db554b0890e73881106fa7f4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page