Opencv training classifier preparation XML document 2

Source: Internet
Author: User

Take advantage of "opencv training classifier preparation XML document"

Understand the command line parameters for creating Functions

Let's take a positive sample as an example:

Suppose there are 5 positive sample image files img1.bmp ,... Img5.bmp; create a TXT text document with a positive sample named info.txt
The content of info.txt is as follows:

Positive/image1.bmp 1 0 0 24 28
Positive/image2.bmp 1 0 0 24 28
Positive/image3.bmp 1 0 0 24 28
Positive/image4.bmp 1 0 0 24 28
Positive/image5.bmp 1 0 0 24 28
Positive/image6.bmp 1 0 0 24 28

The image img1.bmp contains a single object, and the rectangle is (, 24, 28 ).
Note: to create a positive sample from an image set, use the-Info parameter instead of the-IMG parameter.
-Info <collect_file_name>
Description file of the image set marked with features.

The content of the background (negative sample) description file is as follows:
_ Img/bg1.bmp 1 0 0 24 28
_ Ing/bg2.bmp 1 0 0 24 28
_ Img/bg3.bmp 1 0 0 24 28
_ Ing/bg4.bmp 1 0 0 24 28
_ Img/bg5.bmp 1 0 0 24 28
_ Ing/bg6.bmp 1 0 0 24 28
_ Img/bg7.bmp 1 0 0 24 28
_ Ing/bg8.bmp 1 0 0 24 28
_ Img/bg9.bmp 1 0 0 24 28
_ Ing/bg10.bmp 1 0 0 24 28

These files are located in the same folder:

Now that I have talked so much nonsense, I have started to do the following:
First, open dos, (START-run-input cmd)
Switch to the folder where the file was just put, and use CD for the DOS command.

Input command

Press the Enter key to generate the positive sample file:


Okay. Next we will train the classifier. Please refer to the next article "Section 3 of the XML document for preparing opencv training classifier"

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.