当前位置:网站首页>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:
边栏推荐
- 缺陷检测(图像处理部分)
- Leetcode brushing questions - 22. Bracket generation
- 【七夕如何根据情侣倾听的音乐进行薅羊毛】背景音乐是否会影响情侣对酒的选择
- XMjs跨域问题解决
- tcp中的三次握手与四次挥手
- 迁移学习——Joint Geometrical and Statistical Alignment for Visual Domain Adaptation
- Knowledge Points for Network Planning Designers' Morning Questions in November 2021 (Part 2)
- source program in assembly language
- SAP ERP和ORACLE ERP的区别是哪些?
- 【TA-霜狼_may-《百人计划》】图形4.3 实时阴影介绍
猜你喜欢
金仓数据库 KingbaseES V8 GIS数据迁移方案(3. 基于ArcGIS平台的数据迁移到KES)
MySQL3
行业现状?互联网公司为什么宁愿花20k招人,也不愿涨薪留住老员工~
MySQL learning
Leetcode刷题——22. 括号生成
新唐NUC980使用记录:在用户应用中使用GPIO
开篇-开启全新的.NET现代应用开发体验
Utilities Activity Recommendation | Kuaishou StreamLake Brand Launch Conference, witness together on August 10!
[How to smash wool according to the music the couple listens to during the Qixi Festival] Does the background music affect the couple's choice of wine?
随机推荐
Why is this problem reported when installing oracle11
[Redis] Redis installation under Linux
第十一章 开关级建模
ORA-00604 ORA-02429
[parameters of PyQT5 binding functions]
source program in assembly language
【MySQL系列】- LIKE查询 以%开头一定会让索引失效吗
XMjs跨域问题解决
优化Feed流遭遇拦路虎,是谁帮百度打破了“内存墙”?
使用OpenVINO实现飞桨版PGNet推理程序
pytorch的使用:卷积神经网络模块
蓝牙Mesh系统开发四 ble mesh网关节点管理
【Redis】Linux下Redis安装
一文看懂推荐系统:召回06:双塔模型——模型结构、训练方法,召回模型是后期融合特征,排序模型是前期融合特征
英特尔 XDC 2022 精彩回顾:共建开放生态,释放“基建”潜能
DDOS攻击真的是无解吗?不!
Are testing jobs so hard to find?I am 32 this year and I have been unemployed for 2 months. What should an older test engineer do next to support his family?
hypervisor相关的知识点
CMS建站流程
SAP ERP和ORACLE ERP的区别是哪些?