Hog Pedestrian detection learning experience (how to make training samples)

Source: Internet
Author: User

From: http://www.opencv.org.cn/forum/viewtopic.php? F = 1 & t = 9146 # p35176

//////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// ////////////////////////

How to create training samples

This section analyzes the original author's dataset and describes how to create a training sample based on some online materials.
1. How to generate samples from the original image
Compared with inriaperson \ train \ pos (original image), inriaperson \ train_64x128_h96 \ pos (sample generation), we can find that the author cropped some standing persons from the original image, the left-right reflect of the cropped image is required not to be blocked. Take the first image as an example: crop001001. It cut two unblocked people, added the original photo, a total of three images, plus the left and right images, a total of six images.

2. Cropping
You can crop and save the image per program based on opencv1.0. The file name is automatically generated and saved in the newly generated image per folder in the same path.

 

3. Change the image size
You can use ACDSee software, tools/open in editor, and then select the resize option. Tools/rotate can also implement left-right reflect.


 

4. Create the POs. lst list to go To the DOS interface, locate the image folder to be created, and enter DIR/B> pos. lst to generate the file list;

 

After carefully analyzing the compute function in cvhop. cpp, you can directly call it to obtain the sample hog, and then train it to obtain the detection operator.

1. Create a sample
2. Call each image
Hog. Compute (IMG, descriptors, size (8, 8), size (0, 0 ));
Generate hog descriptors and save it to the file.
For (Int J = 0; j <3780; j ++)
Fprintf (F, "% F,", descriptors [J]);
3. Use SVM for training and classification to obtain the weight coefficient, that is, the detection operator detector called in the getdefapeoppeopledetector () function []

 

Related Article

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.