1. HOG features:
The Histogram of Oriented Gradient (HOG) feature is a feature descriptor used for object detection in computer vision and image processing. It consists of calculating and counting the gradient direction histogram of the local area of ​​the image. The Hog feature combined with the SVM classifier has been widely used in image recognition, especially in pedestrian detection. Need to be reminded that the HOG+SVM method for pedestrian detection was proposed by French researcher Dalal in the 2005 CVPR. However, although many pedestrian detection algorithms are constantly proposed, they are mainly based on the idea of ​​HOG+SVM.
(1) The main idea:
In an image, the appearance and shape of the local target can be well described by the gradient density distribution of the gradient or edge. (Essence: Gradient statistics, while gradients mainly exist at the edges).
(2) The specific implementation method is:
First divide the image into small connected areas, which we call cell units. A gradient or edge direction histogram of each pixel in the cell unit is then acquired. Finally, these histograms can be combined to form a feature descriptor.
(3) Improve performance:
These local histograms are contrast-normalized over a larger range of images (we call them intervals or blocks) by first calculating the histograms in this interval. The density in the medium is then normalized to each cell unit in the interval based on this density. Through this normalization, you can get better results for lighting changes and shadows.
(4) Advantages:
Compared to other feature description methods, HOG has many advantages. First, since the HOG operates on the local grid cells of the image, it maintains a good invariance to the geometric and optical deformation of the image, and these two deformations only occur in the larger spatial domain. Secondly, under the conditions of coarse spatial sampling, fine direction sampling and strong local optical normalization, as long as the pedestrian can generally maintain an upright posture, the pedestrian can be allowed to have some subtle body movements. These subtle movements can be It is ignored without affecting the detection effect. Therefore, the HOG feature is particularly suitable for human detection in images.
2. Implementation process of HOG feature extraction algorithm:
Probably the process:
The HOG feature extraction method is to put an image (the target or scan window you want to detect):
1) Grayscale (see the image as a three-dimensional image of x, y, z (grayscale));
2) Normalize (normalize) the color space of the input image by Gamma correction method; the purpose is to adjust the contrast of the image, reduce the influence of local shadow and illumination changes, and suppress noise interference;
3) Calculate the gradient (including size and direction) of each pixel of the image; mainly to capture the contour information while further weakening the interference of the illumination.
4) Divide the image into small cells (for example, 6*6 pixels/cell);
5) Statistics of the gradient histogram of each cell (the number of different gradients), the descriptor of each cell can be formed;
6) Each block is composed of one block (for example, 3*3 cells/block), and the feature descriptors of all cells in one block are connected in series to obtain the HOG feature descriptor of the block.
7) The HOG feature descriptor of all the blocks in the image image can be obtained by concatenating the HOG feature descriptor of the image (the target you want to detect). This is the final feature vector available for classification.
The detailed process of each step is as follows:
(1) Standardized gamma space and color space
In order to reduce the impact of lighting factors, the entire image needs to be normalized (normalized) first. In the texture intensity of the image, the local surface exposure contribution has a large proportion, so this compression process can effectively reduce the shadow and illumination variations of the image. Because the color information is not very effective, it is usually converted into a grayscale image first;
Gamma compression formula: For example, you can take Gamma=1/2;
(2) Calculate the image gradient
Calculate the gradient of the horizontal and vertical directions of the image, and calculate the gradient direction value of each pixel position accordingly. The derivation operation can not only capture contours, human figures and some texture information, but also further weaken the influence of illumination.
The gradient of the pixel points (x, y) in the image is:
The most common method is to first convolve the original image with the [-1,0,1] gradient operator to obtain the gradient component gradscalx in the x direction (horizontal direction, positive direction to the right), and then use [1 The 0, -1] T gradient operator performs a convolution operation on the original image to obtain a gradient component gradscaly in the y direction (vertical direction, with the upward direction being positive). Then use the above formula to calculate the gradient size and direction of the pixel.
(3) Construct a gradient direction histogram for each cell unit
The purpose of the third step is to provide a code for the partial image area while maintaining a weak sensitivity to the pose and appearance of the human object in the image.
We divide the image into several "cell cells", for example 6*6 pixels per cell. Suppose we use a histogram of 9 bins to count the gradient information of these 6*6 pixels. That is, the gradient direction of the cell is divided into nine direction blocks by 360 degrees, as shown in the figure: For example, if the gradient direction of the pixel is 20-40 degrees, the count of the second bin of the histogram is incremented by one, thus, for the cell Each pixel is weighted by a gradient direction in the histogram (mapped to a fixed angular range), and the gradient direction histogram of the cell is obtained, which is the 9-dimensional feature vector corresponding to the cell (because there are 9 bins) ).
The pixel gradient direction is used, so what about the gradient size? The gradient size is used as the weight of the projection. For example, the gradient direction of this pixel is 20-40 degrees, and then its gradient size is 2 (assumed ah), then the second bin of the histogram is not incremented, but added two (assumed).
The cell unit can be rectangular or radial.
(4) Combine cell units into large blocks, normalized gradient histograms within the block
Due to changes in local illumination and changes in foreground-background contrast, the gradient intensity varies widely. This requires normalization of the gradient strength. Normalization can further compress lighting, shadows, and edges.
The author's approach is to combine individual cell units into large, spatially connected blocks. In this way, the feature vectors of all cells in a block are concatenated to obtain the HOG feature of the block. These intervals overlap each other, which means that the characteristics of each cell appear multiple times in the last feature vector with different results. The block descriptor (vector) we will normalize is called the HOG descriptor.
The interval has two main geometric shapes - the rectangular interval (R-HOG) and the circular interval (C-HOG). The R-HOG interval is generally a square lattice that can be characterized by three parameters: the number of cell units in each interval, the number of pixels in each cell unit, and the number of histogram channels per cell.
For example, the optimal parameter settings for pedestrian detection are: 3 × 3 cells / interval, 6 × 6 pixels / cell, 9 histogram channels. Then the feature number of a piece is: 3*3*9;
(5) Collecting HOG features
The final step is to collect the HOG features from all overlapping blocks in the detection window and combine them into the final feature vector for classification.
(6) What is the HOG feature dimension of an image?
By the way, a summary: the process of Hog feature extraction proposed by Daal: the sample image is divided into cells of several pixels, and the gradient direction is equally divided into 9 bins, in which all pixels are in each cell. The gradient direction performs histogram statistics in each direction interval to obtain a 9-dimensional feature vector. Each adjacent 4 units form a block, and the feature vectors in one block are combined to obtain a 36-dimensional feature vector. The block scans the sample image with a scan step size of one unit. Finally, the characteristics of all the blocks are connected in series to obtain the characteristics of the human body. For example, for a 64*128 image, each 16*16 pixel constitutes a cell, and every 2*2 cells form a block. Since each cell has 9 features, there are 4*9= in each block. The 36 features, in steps of 8 pixels, will have 7 scan windows in the horizontal direction and 15 scan windows in the vertical direction. That is to say, 64*128 pictures have a total of 36*7*15=3780 features.
A TPU Screen Protector made of the super toughness of the honeycomb structure. Its unique ultra-soft properties allow it to cover the most complex curves and contours in a device.
The self-healing design of the Hydrogel Screen Protector can protect the display screen of the device from damage, leave no air bubbles, and maintain the sensitivity of the touch screen. Advanced anti-fingerprint and dust- and oleophobic overlays keep your screen smudge- and dirt-free. This overlay is also important in providing maximum touch sensitivity for improved high-speed glide and optimal touch response.
The optical transparency of the Hydrogel Film is more than 90%, showing you the most original screen color and bringing the most realistic visual experience.
If you want to know more about the product information of the Hydrogel Screen Protector for Huawei, please click the product details to view the parameters, model, picture, price and other information of the Huawei Screen Protector.
Whether you are a group or an individual, we will do our best to provide you with accurate and comprehensive information about Hydrogel Screen Protectors!
Screen Protector For Huawei,Hydrogel Film for Huawei,TPU Screen Protector for Huawei,Hydrogel Screen Protector for Huawei
Shenzhen Jianjiantong Technology Co., Ltd. , https://www.tpuscreenprotector.com