Opencv training classifier (1): Preparations

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.