Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit d7dbe18

Browse files
committed
Formatting in README
1 parent 9e3b2c8 commit d7dbe18

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,60 @@
44

55
1. Get OpenCV
66

7-
brew tap homebrew/science
8-
brew install --with-tbb opencv
7+
brew tap homebrew/science
8+
brew install --with-tbb opencv
99

1010
2. Clone this repository
1111

12-
git clone https://github.com/mrnugget/opencv-haar-classifier-training
12+
git clone https://github.com/mrnugget/opencv-haar-classifier-training
1313

1414
3. Put your positive images in the `./positive_images` folder and create a list
1515
of them:
1616

17-
find ./positive_images -iname "*.jpg" > positives.txt
17+
find ./positive_images -iname "*.jpg" > positives.txt
1818

1919
4. Put the negative images in the `./negative_images` folder and create a list of them:
2020

21-
find ./negative_images -iname "*.jpg" > negatives.txt
21+
find ./negative_images -iname "*.jpg" > negatives.txt
2222

2323
5. Create positive samples with the `bin/createsamples.pl` script and save them
2424
to the `./samples` folder:
2525

26-
perl bin/createsamples.pl positives.txt negatives.txt samples 1500\
27-
"opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1\
28-
-maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 80 -h 40"
26+
perl bin/createsamples.pl positives.txt negatives.txt samples 1500\
27+
"opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1\
28+
-maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 80 -h 40"
2929

3030
6. Compile the `mergevec.cpp` file in the `./src` directory:
3131

32-
cp src/mergevec.cpp ~/opencv-2.4.6/apps/haartraining
33-
cd ~/opencv-2.4.6/apps/haartraining
34-
g++ `pkg-config --libs --cflags opencv` -I. -o mergevec mergevec.cpp\
35-
cvboost.cpp cvcommon.cpp cvsamples.cpp cvhaarclassifier.cpp\
36-
cvhaartraining.cpp
32+
cp src/mergevec.cpp ~/opencv-2.4.6/apps/haartraining
33+
cd ~/opencv-2.4.6/apps/haartraining
34+
g++ `pkg-config --libs --cflags opencv` -I. -o mergevec mergevec.cpp\
35+
cvboost.cpp cvcommon.cpp cvsamples.cpp cvhaarclassifier.cpp\
36+
cvhaartraining.cpp
3737

3838
7. Use the compiled executable `mergevec` to merge the samples in `./samples`
3939
into one file:
4040

41-
find ./samples -name '*.vec' > samples.txt
42-
./mergevec samples.txt samples.vec
41+
find ./samples -name '*.vec' > samples.txt
42+
./mergevec samples.txt samples.vec
4343

4444
8. Start training the classifier with `opencv_traincascade`, which comes with
4545
OpenCV, and save the results to `./classifier`:
4646

47-
opencv_traincascade -data classifier -vec samples.vec -bg negatives.txt\
48-
-numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 1000\
49-
-numNeg 600 -w 80 -h 40 -mode ALL -precalcValBufSize 1024\
50-
-precalcIdxBufSize 1024
47+
opencv_traincascade -data classifier -vec samples.vec -bg negatives.txt\
48+
-numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 1000\
49+
-numNeg 600 -w 80 -h 40 -mode ALL -precalcValBufSize 1024\
50+
-precalcIdxBufSize 1024
5151

5252
9. Wait until the process is finished (which takes a long time — a couple of
5353
days probably, depending on the computer you have and how big your images are).
5454

5555
10. Use your finished classifier!
5656

57-
cd ~/opencv-2.4.5/samples/c
58-
chmod +x build_all.sh
59-
./build_all.sh
60-
./facedetect --cascade="~/finished_classifier.xml"
57+
cd ~/opencv-2.4.5/samples/c
58+
chmod +x build_all.sh
59+
./build_all.sh
60+
./facedetect --cascade="~/finished_classifier.xml"
6161

6262

6363
## Acknowledgements

0 commit comments

Comments
 (0)