Harr-like feature algorithm

Source: Internet
Author: User

Introduction:

For the Harr features and adaboost explanation, there are many online analysis, here to record some good blog.

a Good article:

Two original articles:

1. Rapid Object Detection using a Boosted Cascade of Simple Features

2. An Extended Set of Haar-like Features for Rapid Object Detection

Wikipedia:

Viola–jones Object Detection Framework

Xiao Wei's practice road:

1. "OpenCV" based on AdaBoost and haar-like feature face recognition

2,"image processing" to calculate the number of Haar features

3,"image processing" using integral image method to quickly calculate Haar characteristics

ZOUXY09 's Blog:

Haar features of Image feature extraction from target detection (c)

liuliu603 's Blog:

Haar features and integral graphs

Of course, for the 24x24 sub-window, the number of Harr characteristics of the calculation is about 18K or about 16K, there is still controversy:

Viola-jones ' Face detection claims 180k features

Harr Features:

The following Harr features also say my understanding, to face detection as an example, if there is a mistake in place, also please advise. Here does not introduce the integral image, AdaBoost cascade classifier, Harr the number of features (I did not deduce) calculation and so on.

For a pair of images to be detected, the purpose is to mark the faces in the diagram. Due to the distance of the photographer or camera focus settings, will cause the image of the face resolution size is inconsistent, want to accurately detect all the faces in the image, it needs to be measured from different scales, different locations, that is, Multiscale method.

Multi-scale method: That is, the size of the image to be detected remains unchanged, by the level of the magnification of the detection window, using these different sizes of Windows to scan the entire image. Detailed instructions below.

In the image, the Sub-window takes 24x24 size, calculates the Harr feature vector in the current subwindow, the eigenvector is the representation of the current Subwindow, and sends this vector to the already trained classifier to determine whether it is a human face. If it is, mark it if it is not, then slide the child window to the next 24x24 position. Repeat the above feature calculation, until the entire image 24x24 sub-window from left to right, from top to bottom are scanned, also ended the current layer (scale) detection.

The Harr feature is also called the rectangular feature, which is the first of several:


Looking at the blogs listed above, we probably know how to use integral images to calculate Harr features. Later evolved into the following several:


No matter how the rectangular feature changes, the calculation method is the same, but the dimension of the characteristic vector of the sub-window is changed.

Take the first picture of a, B, C, D for example, there are 2 two rectangles, 2 three rectangles, a four rectangle composition, and then the detail point is:


in,a is the size of the 2x1, sliding in the 24x24 subwindow, each sliding will have a value, you can produce 23x24 values, that is, Harr eigenvalues; b,c, D. ,e can produce a number of Harr eigenvalues, which form a vector, which is the Harr eigenvector. In the image of the scanning of the sub-window, the calculation of the feature vector, whether it is a human face, recorded when the face of the window, of course, this is only a layer (a scale) detection.

In an image, some face may be small, some may be large, 24x24 window may not be detected, there is a case of missing. As shown in.


At this point, the window needs to be enlarged appropriately to form a larger window, another dimension (another layer). The amplification factor takes the 1.25 effect to be good, each scale is the 1.25 times the size of the previous scale, the scale (layer) size cannot surpass the original image size.

Of course, the Sub-window is magnified in equal proportions, so the rectangular features (A, B, C, D, E) are also scaled to a certain scale. Then the Harr feature vectors are computed and the records are discriminated.

This cycle is calculated until the child window reaches a size that does not exceed the maximum size of the original image. Then, Mark all the recorded faces, because the face area may be duplicated in the windows of different scales, so you need to merge the area of the face that is detected by the overlap to become an area and mark it.

To sum up, is Harr feature algorithm, feel a bit like hog feature algorithm , are in the window there is something in the sliding calculation, and the window itself is sliding, just harr the window size is still changing.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Harr-like feature algorithm

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.