Skip to main content

Unofficial stubs for the opencv-python package.

Project description

OpenCV stubs

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 unhelpful 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.1.3.tar.gz (376.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opencv_stubs-0.1.3-py3-none-any.whl (365.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: opencv_stubs-0.1.3.tar.gz
  • Upload date:
  • Size: 376.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.4

File hashes

Hashes for opencv_stubs-0.1.3.tar.gz
Algorithm Hash digest
SHA256 25b74af6bd7903340587e0fdc7d49ced0d159b56bbc598e5a58d5f3a01549e1c
MD5 b822c4b8a44bce04f7ff299cdddcebc5
BLAKE2b-256 0bf48cdf24683aae51ad94e443b2b8482a117d7ecf8d6663be8877ec490a73e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opencv_stubs-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 37074b00ede8ec9e2e2b0e77d02277841421606520327087580309e968e45bfc
MD5 cf8c935e9de0aea347994c3b37382121
BLAKE2b-256 628b6041723a40fedc5092bf39a91f0daa0410ebaa09763f07385a01871309bb

See more details on using hashes here.

Supported by

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