opencv-haar-classifier-training icon indicating copy to clipboard operation
opencv-haar-classifier-training copied to clipboard

sh: 1: Syntax error: Unterminated quoted string

Open yanuarrizki68 opened this issue 5 years ago • 1 comments

when I run: perl bin/createsamples.pl positives.txt negatives.txt samples 1500 "opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1
-maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 20 -h 20"

yanuarrizki68 avatar Nov 06 '19 18:11 yanuarrizki68

using the perl function, we are trying to run the quoted command, but as you see the quoted function is separated by a "\n" and thus it is interpreted as two different functions.

To resolve this -

  1. You can run the command in one line. For eg> perl bin/createsamples.pl positives.txt negatives.txt samples 1500 "opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 80 -h 40"

  2. or you can use a line separator such as- For Linux - perl bin/createsamples.pl positives.txt negatives.txt samples 1500
    "opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1
    -maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 80 -h 40" For Windows - perl bin/createsamples.pl positives.txt negatives.txt samples 1500 ^ "opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 ^ -maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 80 -h 40"

varunjain3 avatar Oct 03 '20 13:10 varunjain3