当前位置:网站首页>HOG feature study notes
HOG feature study notes
2022-08-05 01:52:00 【Wsyoneself】
- The foregoing knowledge:
- Feature descriptors simplify image representation by extracting useful information about the image and discarding irrelevant information
- Determine what features are useful according to the task: detect lane lines on the road: edge detection, edge information is useful, color information is useless
- Definition:
- Orientation gradient histogram, which can be used to represent the object characteristics of the image, so that such objects can be detected.
- is a feature descriptor similar to canny edge detector sift (scale invariant and feature transform), used in cv and image processing for object detection
- Essential: Count the gradient directions that occur in local parts of the image.Use the magnitude and angle of the gradient to compute features (generate histogram)
- HOG descriptor concerns the structure or shape of an object
HOG feature descriptor converts a 3-channel color image into a feature vector of a certain length
In the HOG feature descriptor, the distribution of gradient directions, that is, the histogram of gradient directions, is regarded as a feature.
The angle (the derivative of x and y) of the image, the gradients around the edges and corners (regions of sudden intensity) are large and contain more information about the shape of the object.
Using the image gradient, you can only focus on the corner information to outline the appearance of a person
- HOG is often used in conjunction with svm to train high-precision target classifiers.HOG (similar to sift) + SVM workflow:
- Preprocess the input image:
- Cut
- Scale to fixed size
- Grayscale processing (optional, for color images, the gradients are calculated relative to the three-channel color values, and the largest gradient value is taken as the gradient of the pixel)
- Gamma correction (the output image is a power function of the input image, the exponent is γ, the larger the γ, the darker the image): adjust the image contrast (reduce the influence of lighting (uneven lighting, partial shadows) on the image), so thatThe image is closer to what the human eye sees
- Calculate the gradient value of each pixel point (calculated according to the 3X3 area), and get the magnitude matrix and angle matrix:
- For each pixel, compute the horizontal and vertical gradients (the same result can be obtained using the sobel operator with a kernel size of 1)
- Calculate the total gradient strength value and gradient direction (absolute value, so the range is [0-180])
- Form gradient histogram:
- Calculated in an 8X8 cell, there are a total of 8X8X2=128 values (2 includes the gradient strength and gradient direction), and the gradient histogram is formed through statistics, 128 values will become 9 values (here9 is only because it is assumed that 0-180 is divided into 9 bins to count the pixel points m, the histogram of 9 columns, the angle range of each column is 20 degrees), while reducing the amount of calculation, it is also suitable for lighting and other environments.Changes are more robust.
- When the gradient direction tends to 0 degrees and 160 degrees, it indicates that the gradient direction of these points is upward or downward, indicating that there is a relatively obvious lateral edge at this position of the image.
- Normalize blocks
- Each value of the vector is divided by the modulo length of the vector
- Specifically:
- A region of 8X8 is regarded as a cell, and 2X2 cells are used as a group, which is called a block.Since each cell has 9 values (because the 8X8X2 step of building the histogram has become 9 values (bin)), 2X2 cells have 36 values, hog gets the block by sliding the window.
- Normalize the gradient histogram of the block. It can be seen from the above that a block has 4 histograms. The 4 histograms are spliced into a vector of length 36, and then the entire vector is normalized >
- Sliding window, the sliding step is 8 pixels (that is, a cell), and the window size is 2X2. Each time it slides, a feature vector with a length of 36 is obtained.
- Reason: Reduce the impact of lighting (the gradient of the image is sensitive to the overall lighting, but it is hoped that the feature descriptor will not be affected by lighting changes. So the histogram needs to be normalized. Because of the fold change of the original pixel, the normalizationThe result is the same after unification.)
- Calculate HOG feature vector: splicing the feature vector calculated by sliding on the entire image to obtain the feature descriptor of the entire image
- Collect HOG feature (a row of high-dimensional vector) and put it in svm for supervised learning.
- All practice brings out true knowledge and shows the result of practice:
- Preprocess the input image:
边栏推荐
- Day Fourteen & Postman
- 亚马逊云科技 + 英特尔 + 中科创达为行业客户构建 AIoT 平台
- 新来个技术总监,把DDD落地的那叫一个高级,服气
- 工具类总结
- 迅睿cms网站搬迁换了服务器后网站不能正常显示
- 第十一章 开关级建模
- 迁移学习——Joint Geometrical and Statistical Alignment for Visual Domain Adaptation
- DDOS攻击真的是无解吗?不!
- pytorch的使用:卷积神经网络模块
- "Configuration" is a double-edged sword, it will take you to understand various configuration methods
猜你喜欢
如何发现一个有价值的 GameFi?
行业现状?互联网公司为什么宁愿花20k招人,也不愿涨薪留住老员工~
【Word】Word公式导出PDF后出现井号括号#()错误
MySQL3
测试工作这么难找吗?今年32,失业2个月,大龄测试工程师接下来该拿什么养家?
day14--postman interface test
Leetcode刷题——22. 括号生成
Understand the recommendation system in one article: Recall 06: Two-tower model - model structure, training method, the recall model is a late fusion feature, and the sorting model is an early fusion
【Unity入门计划】2D游戏中遮挡问题的处理方法&伪透视
(十七)51单片机——AD/DA转换
随机推荐
GCC: paths to header and library files
The use of pytorch: temperature prediction using neural networks
新来个技术总监,把DDD落地的那叫一个高级,服气
【PyQT5 绑定函数的传参】
基于OpenVINO工具套件简单实现YOLOv7预训练模型的部署
pytorch的使用:使用神经网络进行气温预测
oracle将restful接口封装到视图中
DDOS攻击真的是无解吗?不!
source program in assembly language
如何看待自己的羞愧感
亚马逊云科技携手中科创达为行业客户构建AIoT平台
跨域解决方案
亚马逊云科技 + 英特尔 + 中科创达为行业客户构建 AIoT 平台
记录谷歌gn编译时碰到的一个错误“I could not find a “.gn“ file ...”
如何发现一个有价值的 GameFi?
张驰咨询:揭晓六西格玛管理(6 Sigma)长盛不衰的秘密
XMjs跨域问题解决
手把手基于YOLOv5定制实现FacePose之《YOLO结构解读、YOLO数据格式转换、YOLO过程修改》
快速批量修改VOC格式数据集标签的文件名,即快速批量修改.xml文件名
hypervisor相关的知识点