I've followed this tutorial to install OpenCV 2.3.1 in raspberry and it has worked fine. I've also installed from here the uv4l raspicam driver. But now I need to modify some capture properties as the width and the height of the frames. So I've tried with:
import cv2
cv2.namedWindow("preview")
vc = cv2.VideoCapture(0) #assigned by the uv4l driver
vc.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH,640.0)
vc.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT,480.0)
if vc.isOpened():
rval, frame = vc.read()
else:
rval = False
while rval:
cv2.imshow("preview", frame)
rval, frame = vc.read()
key = cv2.waitKey(33)
if key == 27:
break
but in the linux-shell it returns:
HIGHGUI ERROR: V4L: Initial Capture Error: Unable to load initial memory buffers
So I've tried also to edit those properties in the Idle shell with:
>>import cv2
>>vc = cv2.VideoCapture(0)
>>prop = vc.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)
it returns me always 64.0
(the default width), and when I try with:
>>prop = vc.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, 640.0)
it returns False
How can I set my resolution? Thanks