Skip to main content

Provides cvloop, a way to show opencv video loops. Designed for jupyter notebooks.

Simple example: Show webcam feed.

from cvloop import cvloop
cvloop()

More complex example: Show webcam feed side by side with inverted image.

from cvloop import cvloop
cvloop(function=lambda frame: 255 - frame, side_by_side=True)

Complex example: Show video file with background extraction (See OpenCV Documentation; Video).

from cvloop import cvloop
import cv2

def mog2(frame):
    return mog2.fgbg.apply(frame)
mog2.fgbg = cv2.createBackgroundSubtractorMOG2()

cvloop('768x576.avi', function=mog2, side_by_side=True)

More examples: For more examples check out the examples notebook.

Install

You can simply install cvloop using pip (make sure to install matplotlib, numpy, OpenCV and Jupyter):

pip install cvloop

Or, if you are using conda and don’t want to worry about requirements, just use conda-forge:

conda config --add channels conda-forge
conda install cvloop

Requirements

(Recommended versions, additionally tested versions in parentheses.)

  • Python 3.6

  • OpenCV 3.2

  • Jupyter 4.3.1

  • matplotlib 2.0.0

  • numpy 1.12.0

Development

To contribute, just fork the repository and create pull requests.

To publish, you need a couple of additional tools:
  • gpg to sign the packages

  • twine to upload them

  • shasum to calculate the checksum for conda-forge

  • hub to create the pull request for conda-forge

Download files

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

Source Distribution

cvloop-0.3.5.tar.gz (15.5 kB view details)

Uploaded Source

File details

Details for the file cvloop-0.3.5.tar.gz.

File metadata

  • Download URL: cvloop-0.3.5.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cvloop-0.3.5.tar.gz
Algorithm Hash digest
SHA256 67b853b514f02d02f63ac90455595f0a8a5817b7c25d629a05bc82beb369dca6
MD5 2664ceaf0559d61840c34181da92dc10
BLAKE2b-256 f1e74e40786ef7d07cbb6abe294f7139603e87302229f8a0587b5bc434443910

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.5 This release

1 file

0.3.4

1 file

0.3.3

1 file

0.3.2

1 file

0.3.1

1 file

0.3.0

1 file

0.2.0

1 file

0.1.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page