Skip to content

Commit

Permalink
Webcam support for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
foosel committed Jan 2, 2013
1 parent e1d541a commit f080468
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions printer_webui/webcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

try:
#Try to find the OpenCV library for video capture.
from opencv import cv
from opencv import highgui
import cv
except:
cv = None

Expand All @@ -23,7 +22,7 @@ class Webcam(object):
def __init__(self):
self._cam = None
if cv != None:
self._cam = highgui.cvCreateCameraCapture(-1)
self._cam = cv.CreateCameraCapture(-1)
elif win32vidcap != None:
try:
self._cam = win32vidcap.Device()
Expand All @@ -46,4 +45,4 @@ def save(self, filename):
import os

webcam = Webcam()
webcam.save(os.path.join(settings().settings_dir, "image.png"))
webcam.save(os.path.join(settings().settings_dir, "image.png"))

0 comments on commit f080468

Please sign in to comment.