Skip to main content

A multithreaded live image processor in Python running OpenCV

Project description

CVLive

A multithreaded live image processor in Python running OpenCV that processes images from a webcam or another video source and shows the results in 'real time'. A separate thread handles the processing while the main thread displays the previous result and captures the next input, resulting in significant performance gains.

CVLive makes it possible to create live demos of a wide variety of image processing concepts in only a few lines of code.

How to Install

pip install cvlive

How to Use

  • Import cvlive
  • Create a subclass of LiveImageProcessor
  • Override one or more of the class methods: convert(), process(), display() and update() to obtain the desired functionality

Please take a look at the examples and consult the documentation found in the LiveImageProcessor base class to see how this might be done.

A Simple Example

from cvlive import LiveImageProcessor
import cv2


class MySimpleProcessor(LiveImageProcessor):
    def convert(self):
        # convert input image to grayscale
        return cv2.cvtColor(self.raw_input, cv2.COLOR_BGR2GRAY)

    def process(self):
        # blur the input using a 51x51 Gaussian filter
        self.result = cv2.GaussianBlur(self.input, (51, 51), 0)


if __name__ == "__main__":
    MySimpleProcessor().run()

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

cvlive-0.1.3.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

cvlive-0.1.3-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

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