opencv_createsamples invalid syntax [closed]

asked 2018-06-18 10:20:48 -0600

a_zach gravatar image

I'm using

Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit 
(AMD64)] on win32

and installed opencv via cmd.

I'm try to get a vector file via opencv_createsamples and I'm facing the following error:

opencv_createsamples -info pos.lst -num 32 -w 20 -h 20 -vec pos.vec
File "<stdin>", line 1
opencv_createsamples -info pos.lst -num 32 -w 20 -h 20 -vec pos.vec                         ^
SyntaxError: invalid syntax

Using the absolute path for .exe doesnt help either and creates the same error

"C:\\Users\\azach\\Downloads\\opencv\\build\\x64\\vc15\\bin\\opencv_createsample.exe" -info pos.lst -num 2500 -w 20 -h 20 -vec pos.vec

nor does the absolute path for pos.lst change error.

Here are a few lines from pos.lst

pos/1.jpg
pos/2.jpg
pos/3.jpg

The directory's built: haar - pos.lst - pos - -1.jpg - -2.jpg - -3.jpg

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2018-06-19 01:03:40.898457

Comments

why are you using python, to start an exe ?

the line should go straight into cmd.exe, not into python. (was that the problem ?)

berak gravatar imageberak ( 2018-06-18 10:58:16 -0600 )edit

Well, yes. Thank you!

a_zach gravatar imagea_zach ( 2018-06-18 12:02:18 -0600 )edit