Hallo zusammen,
ich möchte gerne mit Python 2 und OpenCv auf die Raspberry Pi Camera zugreifen.
Kennt jemand eine Anleitung wie man das anstellt.
OpenCV habe ich schon ans laufen bekommen.
Ich kann ein Bild öffnen. Aber wie greife ich auf das Live Camera Bild zu?
Das folgende Beispiel von Andreas Bunkahle funktioniert bei mir nicht.
http://www.bunkahle.com/Python/opencv.html
Grüße Berrie
Python
#!/usr/bin/python
# -*- coding: utf-8 -*-import cv
import cv2.cv as cv
cv.NamedWindow("Camera")
capture = cv.CaptureFromCAM(0)
img = cv.QueryFrame(capture)
if img == None:
print "No webcam"
else:
while 1:
img = cv.QueryFrame(capture)
cv.ShowImage("Camera", img)
k = cv.WaitKey(1)
if k == 27: # ESC key
break
elif k != -1:
print k
cv.DestroyWindow("Camera")
Alles anzeigen