Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step 1 opencv-haar-classifier-training error #41

Closed
rajarao47 opened this issue Jul 11, 2017 · 4 comments
Closed

Step 1 opencv-haar-classifier-training error #41

rajarao47 opened this issue Jul 11, 2017 · 4 comments

Comments

@rajarao47
Copy link

Hi,

  1. I tried step 2 to step 4. Had about 675 positive and1970 negative pictures. I could generate positives.txt and negatives.txt files.
    while running step 5:(below)
    perl bin/createsamples.pl positives.txt negatives.txt samples 1700 "opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 24 -h 24"
    I am receiving error as below:
    it gave error as:
    Error is: syntax error near unexpected token "(".

  2. I realized that I missed step 1. Hence, I restarted the process and entered the first command as below and got message as below:


root@rajas01:~/rajashaar2# brew tap homebrew/science
W: be careful as root.

========================================================================
You may want to update following environments after installed linuxbrew.

PATH, MANPATH, INFOPATH

(example: /usr/share/doc/linuxbrew-wrapper/examples/profile)

Don't run this as root!
root@rajas01:~/rajashaar2# Don't run this as root!


It indicates a warning as do not run this as root!
I have gone through previous correspondences and unable to locate any solution for this. Am I missing any step here? Please help. (Note: I am trying this on web server installed with Ubuntu.)

@mrnugget
Copy link
Owner

Regarding 1.: See #4
Regarding 2.: the error comes from the fact that you're running this on Ubuntu. brew is a package manager for macOS.

@rajarao47
Copy link
Author

rajarao47 commented Jul 12, 2017

Hi Nugget,
Thanks for your help. I did more research and realized that brew package is for mac OS. (Sorry for this as I am just bit new in programming and exploring slowly)
While running step 5, I am still getting below error message as
sh 1: ### Syntax error: "(" unexpected
"Samples' folder is still empty.

opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 -maxzangle 0.5 -maxidev 40 -w 24 -h 25 -img ./positive_images/posi (431).jpg -bg tmp -vec samples/posi (431).jpg.vec -num 2
sh: 1: Syntax error: "(" unexpected
opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 -maxzangle 0.5 -maxidev 40 -w 24 -h 25 -img ./positive_images/posi (399).jpg -bg tmp -vec samples/posi (399).jpg.vec -num 2
sh: 1: Syntax error: "(" unexpected
opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 -maxzangle 0.5 -maxidev 40 -w 24 -h 25 -img ./positive_images/posi (343).jpg -bg tmp -vec samples/posi (343).jpg.vec -num 2
sh: 1: Syntax error: "(" unexpected
opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 -maxzangle 0.5 -maxidev 40 -w 24 -h 25 -img ./positive_images/posi (208).jpg -bg tmp -vec samples/posi (208).jpg.vec -num 2
sh: 1: Syntax error: "(" unexpected
opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 -maxzangle 0.5 -maxidev 40 -w 24 -h 25 -img ./positive_images/posi (562).jpg -bg tmp -vec samples/posi (562).jpg.vec -num 2
sh: 1: Syntax error: "(" unexpected
opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 -maxzangle 0.5 -maxidev 40 -w 24 -h 25 -img ./positive_images/posi (185).jpg -bg tmp -vec samples/posi (185).jpg.vec -num 2
sh: 1: Syntax error: "(" unexpected
opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 -maxzangle 0.5 -maxidev 40 -w 24 -h 25 -img ./positive_images/posi (535).jpg -bg tmp -vec samples/posi (535).jpg.vec -num 2
sh: 1: Syntax error: "(" unexpected

Kindly help.
Is there any alternate command required for Ubuntu instead of brew

@mrnugget
Copy link
Owner

mrnugget commented Jul 12, 2017 via email

@rajarao47
Copy link
Author

Hi,
I have corrected the naming of the .jpg files. It worked fine now. Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants