Hog principle and OPENCV realization

Source: Internet
Author: User

The direction gradient histogram (histogram of oriented Gradient, HOG) was proposed in 2005, is a commonly used feature extraction method, HOG+SVM in pedestrian detection has excellent results. The principle of hog feature extraction algorithm

In an image, the direction density distribution of gradient or edge can well describe the characteristics of the local target region, and hog uses this idea to make statistics on the gradient information and produce the final feature description. In hog, a picture is divided into the following:
(image), detection window (win), image block (block)--cell cell (cell)

The flowchart is as follows:

For the above flowchart, there are a few points to note:
1. Color and gamma normalization in order to reduce the impact of light factors, the entire image needs to be normalized (normalized) first. In the texture intensity of the image, the proportion of local surface exposure contribution is larger, so the compression processing can effectively reduce the shadow and illumination changes in the image.
2. The gradient of the image is calculated for each pixel, then the direction gradient histogram is constructed in the cell, and the contrast normalization operation is performed in the block.
3. Due to the sliding nature of the window and the sliding line of the block, the window and the block will overlap in varying degrees (determined by the step), at which time the cells within the block will appear multiple times, which means that each cell unit output is used for the final descriptor. calculation of Digital image gradients:

In the case of a two-tuple continuous function, the Set function z=f (x, y) has a first-order continuous partial derivative in the planar area D, and a vector can be set for each point P (x, y) ⊆d p (x, v) ⊆d p\left (Y-\right) \subseteq D.
∂f∂xi+∂f∂yj∂f∂x I +∂f∂y J \frac{\partial f}{\partial x}i+\frac{\partial f}{\partial y}j
This vector is called function z=f (x, y) z = The gradient of f (x, y) z=f\left (x,y\right) at point P (x, Y) p (×, R) p\left (y \right) is recorded as GRADF (x, y) G R a D F ft (x, y \right).
for digital image images, the equivalent of a two-dimensional discrete function gradient, as follows:
G (x, y) =dx (x, y) +dy (x, y) dx (x, y) =i (x+1,y) −I (x, y) dy (x, y) =i (x,y+1) </

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.