yusuf
yusuf

Reputation: 3781

cannot get frame from openni device in python-opencv

I am using raspberry pi to get frames from ASUS Xtion openni device.

Python-opencv, OpenNI, and OpenCV are installed on raspberry pi correctly.

I am using the following code:

import cv2
import cv2.cv as cv

capture = cv2.VideoCapture(cv.CV_CAP_OPENNI)
capture.set(cv.CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE. cv.CV_CAP_OPENNI_VGA_30HZ)

okay, color_image = capture.retrieve(0, cv.CV_CAP_OPENNI_BGR_IMAGE)

This code was working without any problems before. But now, I always get "okay" value as "false". How can I fix this problem?

Thanks,

Upvotes: 0

Views: 367

Answers (1)

XOR
XOR

Reputation: 427

Do you have the v4l drivers?

If not

sudo modprobe bcm2835-v4l2

Upvotes: 1

Related Questions