Skip to content
This repository was archived by the owner on Dec 21, 2019. It is now read-only.

cv/opencv-wrappers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wrappers for OpenCV

A collection of object-oriented wrappers in Python wrappers for OpenCV.

Motivation

OpenCV provides an enormous amount of useful utilities and functions related to computer vision, from matrix operations to face recognition. It comes with a set of bindings for Python generated by SWIG, but unfortunately these aren’t very Object Oriented, and can be tricky to use (users have to remember to release resources by hand, etc).

This is a still very incomplete set of objects that wrap common concepts in OpenCV into objects: Camera, Image, Window and so on. There are definitely tons of bugs, so beware. This project has been set up only as a way of representing the knowledge the authors have gathered about OpenCV and is not intended to be a complete set of OO wrappers for the library – but contributions of any kind are definitely welcome.

Installation

Make sure you have OpenCV and the Python bindings for it. If you have everything installed correctly, you should be able to run this successfully:

python -c 'import opencv; import opencv.highgui'

If this command generates any output, you need to have a look at your installation of OpenCV and the Python bindings. Make sure you’re using the correct version of Python, and that it is compatible with the bindings.

Example


# Outputs the video coming from the first webcam found into the main window.
# See also @camera-display.py@.

from wrappers import *

camera = Camera(CV_CAP_ANY)
window = Window()

while True:
  window.show(camera.frame())
  if escape_pressed():
    window.destroy()
    break

About

A collection of object-oriented Python wrappers for OpenCV

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages