Ask Your Question
0

Cannot run opencv samples in python

asked Jul 24 '13

Basil Alias gravatar image

updated Jul 24 '13

berak gravatar image

i am using opencv 2.4.6,ubuntu 12.04 and also using python 2.7

When i try to run sample programs in python,some of them is showing errors $python peopledetect.py Traceback (most recent call last): File "peopledetect.py", line 17, in <module> print "cannot read " + sys.argv[1] IndexError: list index out of range

Please help me!!!

Preview: (hide)

1 answer

Sort by » oldest newest most voted
2

answered Jul 24 '13

berak gravatar image

you're expected to supply the image-path on the cmdline.

$python peopledetect.py image-with-some-ppl.png

also, please use the cv2 api ( and the samples from the python2 folder ), the old api will go away soon.

Preview: (hide)

Comments

Thanks for your reply.But when i run: python facedetect.py Picture\ 013.jpg Traceback (most recent call last): File "facedetect.py", line 63, in <module> cascade = cv.Load(options.cascade) TypeError: OpenCV returned NULL

Basil Alias gravatar imageBasil Alias (Jul 24 '13)edit
1

it did not find the haarcascade,

$python peopledetect.py image-with-some-ppl.png -c path-to-haarcascade-file

berak gravatar imageberak (Jul 24 '13)edit

Question Tools

Stats

Asked: Jul 24 '13

Seen: 2,571 times

Last updated: Jul 24 '13