SUMMARY feature detection and matching is not added on the book:: white recording feature detection HOG

. For a principle understanding of HOG features
Reference: https:? //Bbs.csdn.net/topics/391911195 page = 1
core idea of HOG is a partial shape of the object can be detected as described light intensity distribution or the edge gradient direction . By the whole image into small connection area (called cells), each cell generating a gradient histogram or an edge direction in the pixel cell in the direction, these compositions may be expressed histograms (the detection target object) described child. To improve the accuracy of the light, the image of the local histogram can be calculated in a larger area (referred to as a block) as a measure of the intensity contrast is normalized, then this value (measure) normalization of all cells in the block. This normalized a process of irradiating a better finished / shadow invariance.
Compared with other descriptors, HOG descriptors holding the obtained geometrical and optical invariance transformation (unless the object to change direction). HOG descriptors therefore particularly suitable for detecting human.
Popular talk:
the HOG feature extraction method is one image:
grayscale (image treated as a x, y, z (gradation) of the three-dimensional image)
is divided into small cells (2 2)
calculated for each cell in each the pixel gradient (i.e., orientation)
statistics of each cell of the gradient histogram (the number of different gradients), each cell of the descriptor can be formed
and then applied with the difference between the small talk Hog, SIFT and PCA-SIFT is:
Hog not rotated and scale invariance, a small amount of calculation; and each SIFT feature vectors 128 need to be described dimensions, and therefore relatively large amount of calculation.
So how pedestrian detection application HOG it?
Scale-invariant for solving the problem: The picture will be different scales scale, equivalent to the template zoom scale of different scales.
Rotation-invariant for solving the problem: the establishment of a stencil in different directions (usually take 15
7) match.
In general, an image at different scales is a template (15 * 7) matching in different directions, each point describes a gradient form 8 direction.

Two .API introduction
https://www.cnblogs.com/long5683/p/9735903.html

The maximum effect of the three .HOG
Hog + SVM pedestrian detection
https://blog.csdn.net/andylanzhiyong/article/details/84678447

#include <iostream>
#include "opencv2/opencv.hpp" 
using namespace cv;
using namespace std; 

int main(int argc, char** argv) 
{
	Mat src = imread("E:\\pictures\\38.jpg"); 
 	if (src.empty()) 
 	{
 		cout << "图片读取错误!" << endl;  
  		return -1; 
 	}
 	HOGDescriptor hog = HOGDescriptor(); 
 	hog.setSVMDetector(hog.getDefaultPeopleDetector());  
 	vector<Rect> foundLocations; 
 	hog.detectMultiScale(src, foundLocations, 0, Size(8, 8), Size(32, 32), 1.05, 2); 
 	Mat result = src.clone(); 
 	for (size_t t = 0; t < foundLocations.size(); t++)
 	{
 		//将找到的行人用矩形框表现出来
 		rectangle(result, foundLocations[t], Scalar(0, 0, 255), 2, 8, 0);
 	}
 	imshow("HOG SVM Detector Demo", result);  
 	waitKey(); 
 	return 0;
}

Output Figure:
Here Insert Picture Description

Published 25 original articles · won praise 0 · Views 456

Guess you like

Origin blog.csdn.net/qq_45445740/article/details/103515413