Tell me more ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I compiled OpenCV in Python on my pi (without a GUI) and it recognizes my ps3 eye cam (i've streamed/saved video from it through the pi) but whenever i try some simple code it captures the video but fails to do frame = cv.QueryFrame(capture)...ihave no idea why. any help? the code works just fine on my pc. the code is:

import cv2.cv as cv

#cv.NamedWindow("w1", cv.CV_WINDOW_AUTOSIZE)
camera_index = 0
capture = cv.CaptureFromCAM(camera_index)
if not capture:
print "error opening capture device"
#count = 0

while True:
frame = cv.QueryFrame(capture)
if frame is None:
print "fail with putting in frame"
break
# print "image"
# cv.ShowImage("w1", frame)
# c = cv.WaitKey(100)

# if c == 0x1b: #ESC
#print 'esc pressed,goodbye'
#break

# if c == 0x63 or c == 0x43:
else:
c = cv.WaitKey(100)
print 'capturing!'
cv.SaveImage("pictest.jpg",frame)
# count = count + 1
# if count == 10:
# break
share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.