Skip to content

Instantly share code, notes, and snippets.

@kieferbuch52
Created November 11, 2016 06:48
Show Gist options
  • Save kieferbuch52/e5cc06210e17a591d174c4f5f5dabcf9 to your computer and use it in GitHub Desktop.
Save kieferbuch52/e5cc06210e17a591d174c4f5f5dabcf9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# coding:utf-8
import cv2.cv as cv
import time
cv.NamedWindow("camera", 1)
capture = cv.CaptureFromCAM(0)
# 画像サイズの指定
cv.SetCaptureProperty(capture,cv.CV_CAP_PROP_FRAME_WIDTH,320)
cv.SetCaptureProperty(capture,cv.CV_CAP_PROP_FRAME_HEIGHT,240)
while True:
img = cv.QueryFrame(capture)
cv.ShowImage("camera", img)
if cv.WaitKey(10) > 0:
break
cv.DestroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment