Ask Your Question
0

Cannot run opencv samples in python

asked 2013-07-24 08:25:18 -0600

Basil Alias gravatar image

updated 2013-07-24 09:51:56 -0600

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!!!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-07-24 09:50:43 -0600

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.

edit flag offensive delete link more

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 ( 2013-07-24 11:32:29 -0600 )edit
1

it did not find the haarcascade,

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

berak gravatar imageberak ( 2013-07-24 13:16:38 -0600 )edit

Question Tools

Stats

Asked: 2013-07-24 08:25:18 -0600

Seen: 2,557 times

Last updated: Jul 24 '13