Struck tracking algorithm (III)

Source: Internet
Author: User

Next we will start to parse the Haar Feature Extraction Algorithm:

In this algorithm, Haar features are divided into six sub-features. The code and analysis are as follows:



The sub-Calculation of the six Haar feature descriptions is as follows. Next we will analyze the application of the Haar feature:

// Generate Haar feature vector 192 dimension 32*6 = 192 dimension void haarfeatures: generatesystematic () {float X [] = {0.2f, 0.4f, 0.6f, 0.8f }; float y [] = {0.2f, 0.4f, 0.6f, 0.8f}; float s [] = {0.2f, 0.4f}; For (INT Iy = 0; Iy <4; ++ Iy) // obtain the number in X [], the window coefficient {for (int ix = 0; ix <4; ++ IX) // obtain the number in Y, window coefficient {for (Int Is = 0; is <2; ++ is) // returns the number in S, window coefficient {floatrect R (X [ix]-s [is]/2, Y [Iy]-s [is]/2, s [is], s [is]); // obtains the window size. A total of 32 for (INT it = 0; it <6; ++ it) // It is the sub-type of Haar feature description (6 in total) {m_features.push_back (haarfeature (R, It) ;}}}} void haarfeatures :: updatefeaturevector (const sample & S) {for (INT I = 0; I <m_featurecount; ++ I) {// normalize m_featvec [I] = m_features [I]. eval (s );}}



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.