Permalink
Browse files

option for different capture device

  • Loading branch information...
albertz committed Apr 19, 2011
1 parent 63e265d commit 728ddeb868c8407b8eb3c6d88faaf09c9e165211
Showing with 3 additions and 1 deletion.
  1. +3 −1 facerecognition.py
View
@@ -60,9 +60,11 @@ def subImageScaled(im, rect, w, h):
# create windows
#cv.NamedWindow('Camera', cv.CV_WINDOW_AUTOSIZE)
+ import sys
# create capture device
device = 0 # assume we want first device
- capture = cv.CreateCameraCapture(0)
+ if len(sys.argv) > 1: device = int(sys.argv[1])
+ capture = cv.CreateCameraCapture(device)
cv.SetCaptureProperty(capture, cv.CV_CAP_PROP_FRAME_WIDTH, 640)
cv.SetCaptureProperty(capture, cv.CV_CAP_PROP_FRAME_HEIGHT, 480)

0 comments on commit 728ddeb

Please sign in to comment.