Ask Your Question

Cannot access camera on Mac Lion System!

asked 2013-09-25 19:33:18 -0500

Hi, I am using python on the Mac Lion system. I built the latest opencv package downloaded from this website with With_V4L = ON. I wrote the simplest code as follows:

import cv2
import cv
import numpy as np
import time

def main():
    capture = cv2.VideoCapture(0)
    print capture.isOpened()
    print capture
    capture.set(cv.CV_CAP_PROP_FRAME_WIDTH, 640)
    capture.set(cv.CV_CAP_PROP_FRAME_HEIGHT, 480)

    while (capture.isOpened()):
        ret, image = 
        k = cv2.waitKey(30)
        if k == 27:

if __name__ == "__main__":

The system keeps popping out this error: File "", line 31, in <module> main() File "", line 25, in main cv2.imshow("Camera",image) cv2.error: /Users/conangausslee/Downloads/opencv- error: (-215) size.width>0 && size.height>0 in function imshow

I have no idea what is going on here. Can Anybody tell me what is the problem?

edit retag flag offensive close merge delete


nobody can help me with this?

Gauss Lee gravatar imageGauss Lee ( 2013-09-26 12:00:28 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2013-09-27 00:25:06 -0500

icylord gravatar image
edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2013-09-25 19:33:18 -0500

Seen: 385 times

Last updated: Sep 27 '13