OpenCV Get hog characteristics (use of hogdescriptor)

Source: Internet
Author: User

Personally think a lot of blogs are copied from here: http://www.cnblogs.com/justany/archive/2012/12/03/2790548.html
Just say how to use it.
Contains header files: There is no special difference to the general OPENCV program need to join the library: Opencv_objdetect244.lib (realease in the Debug plus a D, the configuration of the people should understand) basic use: (two lines of code)hogdescriptor *desc=new hogdescriptor (cvsize (40,80), Cvsize (10,20), Cvsize (5,10), Cvsize (5,5), 9);
Desc->compute (img,w,cvsize (10,20), Cvsize (0,0));
The features you get through the above are also stored in vector W. If you want to use it, it's enough to be here!
here is a basic explanation of the principle: (ref.: http://gz-ricky.blogbus.com/logs/85326280.html)
The principle is very simple, in the OPENCV implementation is R-hog, that is, the image img-> window window-> block block-> cell cell cells vector Statistics First look at the descriptor constructor, I use Hogdescriptor *desc=ne W Hogdescriptor (Cvsize (40,80), Cvsize (10,20), Cvsize (5,10), Cvsize (5,5), 9);
The window here is (+), block for (Ten), Block's step stride is (5, 10), cell cell is 5 * 5 pixels, the histogram bin of each cell is 9. So, for each cell, There are 9 vectors for each block, there are 2*4 cells, so there are 72 vectors for window, the method of calculating the number of blocks is, two direction calculation (window_size-block_size)/block_stride + 1, a total of 7 * 7 blocks, a total of 72*49=3528 vectors in the search img, when calculating the image characteristics, call Desc->compute (Img,w,cvsize (10,20), Cvsize (0,0)), where IMG is the input image, W is the vector that holds the vectors, the third is the step of the window, and the fourth is padding, which fills the picture to fit the size. When setting padding to default (0,0), the calculation (img_size-window_size)/Window_stride +1 is not necessarily an integer.
If you want to learn more, you can refer to the first link above.
Hope to have helped you!

OpenCV Get hog characteristics (use of hogdescriptor)

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.