Generate necessaryProgram:
Add all header files under the D: \ opencv \ apps \ haartraining directory to the "header file", and add all CPP files to the "source file", as shown below:
When compiling createsamples.exe, remove the haartraining. cpp and performance. cpp files (because these two CPP files are used to generate the corresponding exe program)
Click compile and run as follows:
Createsamples.exe (generate a sample description file)
Haartraining.EXE (Training classifier)
Performance.EXE (test classifier)
Generate a positive sample description file:
Modify the samples_pos.dat file:
Replace BMP with BMP 1 0 0 20 20
That is:
E: \ mit_face_db> createsamples.exe./faces_100/sample_pos.dat-Vec./faces_100/samples_pos.vec-num 100-W 20-H 20
Generate a negative sample description file:
That is:
Training classifier:
E: \ mit_face_db> haartraining.exe-data-Vec. /faces_100/samples_pos.vec-NPOs 10-BG. /nonfaces/samples_neg.dat-nneg 20-nstage 15-nsplits 2-W 20-H 20