Skip to main content

Allows fast prototyping in Python for OpenCV

Project description

release lic ci coverage

Work in progress. Stay tuned.


Allows fast prototyping in Python for OpenCV

Offers primitives and simplified interfaces to streamline prototypes construction in Python.


  • Windows construction and management

  • Trackbar construction

  • Configuration save/load (including trackbar values)

  • Key binding (e.g. for trackbar control, configuration save/load)

  • Video capturing and modification

  • Work with images

  • Work with text

  • Frames transformation


Color Palette

Let’s replace 37 lines of source code from Trackbar as the Color Palette tutorial with ocvproto-based implementation:

from ocvproto.toolbox import WindowManager, Canvas

with WindowManager() as wm:
    rgb = wm.window.add_trackbar_group(['R', 'G', 'B'], max=255)
    for _ in
        wm.set_frame(Canvas(512, 300, color=rgb))

Camera capture

Now let’s capture video camera stream into ocvproto.avi file, being able to adjust blur.

Let’s also setup config filepath (ocvproto.json) - this allows us to store current trackbar values (s key) and load them (r key). It is useful to restore settings between sessions.

We bind z key to take camera shots.

from ocvproto.toolbox import WindowManager, Camera

with WindowManager() as wm:'ocvproto.json')

    blur = wm.window.add_trackbar_group(['x', 'y'], 'Blur', default=1)

    with Camera() as cam:'z', cam.dump_image)

        for _ in

Read the documentation.


  • Python 3.6+

  • opencv-python (or variants)

Quick install with third-parties: $ pip install opencv-proto[all]


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-proto-0.3.0.tar.gz (19.2 kB view hashes)

Uploaded source

Built Distribution

opencv_proto-0.3.0-py2.py3-none-any.whl (18.9 kB view hashes)

Uploaded 3 6

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