Skip to content

Simple API for using a camera in Python via OpenCV

Notifications You must be signed in to change notification settings

CogWorksBWSI/Camera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Camera

This provides a simple interface, via OpenCV, for configuring and utilizing a camera device, using Python

Installation Instructions

We will need to install OpenCV with the Python bindings so that we can access laptop cameras via our Python code. Follow the instructions for Windows and Mac.

Installing opencv (Recommended)

conda install -c conda-forge opencv

Clone Camera, navigate to the resulting directory, and run

pip install -e .

Usage

Please see the camera tutorial notebookin this repo for details of how to configure your camera.

%matplotlib notebook
from camera import take_picture
import matplotlib.pyplot as plt
img_array = take_picture()  # returns shape-(H, W, C) array

fig,ax = plt.subplots()
ax.imshow(img_array)

About

Simple API for using a camera in Python via OpenCV

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published