Classic CV algorithm _Haar

Haar features Principle

Haar features into three categories: an edge characteristic, linear characteristic, the central feature and diagonal features, combined into a feature template. White and black rectangles within the feature template, and the template is defined featureWhite rectangular pixels and black rectangular pixels and subtract. Haar feature values reflect changes in a gray image . Some of the features of the face can be simply described by a rectangle, such as eye color depth than the cheeks, nose color deeper than the both sides of the nose, the mouth than the surrounding dark color. However, only some simple rectangular feature pattern configuration, such as the edges more sensitive, to a particular segment can only be described (horizontal, vertical, diagonal) structure.

Here Insert Picture Description

For the FIG. A, B and D such features, wherein the value is calculated as: v = Sum White - Sum black, and for C is calculated as follows: v = Sum White - 2 * Sum black. The reason why the black area pixel is multiplied by 2, is to make the same number of two kinds of the rectangular region of pixels.

By varying the size and position of the feature template can be exhaustive in a large number of image sub-window feature. Wherein the template of FIG referred to as "proto." Proto expanded image sub-window (translational stretching) obtained characteristic referred to as " rectangular features ", the rectangular feature value is called the " characteristic value ."

Feature rectangle may be located anywhere in the image, the size can be arbitrarily changed, the rectangle feature is a function of a rectangular template category, and the rectangle size rectangle positions of these three factors. So the change type, size and position, such that the detection window contains a very small number of rectangular features, such as: 24 * 24 pixels within the detection window size may be characterized in a number of rectangular reach 160,000. So there are two problems to be solved:

  1. How to quickly calculate so many features? - integral image.
  2. What are the characteristics of a rectangular classifier classified the most effective? - If trained by AdaBoost algorithm.
Published 95 original articles · won praise 37 · views 3399

Guess you like

Origin blog.csdn.net/Rocky6688/article/details/104004010