A Take on H.O.G Feature | Wavelabs
Veltris
MENU
  • Company
      • AboutusAbout Us
      • __CSR_mainCSR
      • LeadershipLeadership
      • __Life at Veltris-mainLife at Veltris
      • ChannelPartnerships
      • Contact usContact Us
      • veltrisPressroom
      • EventsEvents
  • AI Services
    • Digital-CloudAI-Augmented Engineering
    • Data-AIAI Readiness & Data
      Modernization
    • __Connectivity & Industry X.0_1 (1)AI Monetization
    • __Product Lifecyle & Managed Services_1Product Lifecycle &
      Managed Services
  • Industries
    • HealthcareHealthcare
      • __Health TechHealthTech & MedTech Platforms
      • __Dental CareDental & Multi-Unit Retail Health
      • __Pharmacy Benefit Management (PBM)Pharmacy Benefit Management (PBM)
    • Hi TechTechnology
      • __Technology Products & PlatformsSoftware / XTech / AI Platforms
      • __Communications Service ProvidersSecure Networking & Infrastructure
    • Diversified-IndustrialsIndustrials
      • __Autonomous Vehicles and LogisticsLogistics & Mobility Tech
      • __Engineering and ConstructionEngineering & Construction Tech
  • Insights
    • BlogsBlogs
    • White papersWhitepapers
    • Glossary-svgAI Guides and Innovations
    • CasestudiesClient Case Studies
  • Careers
  • Vertical AI Platform
    (VeltrisOne™)
Get My AI Readiness Score
Veltris
Get My AI Readiness Score
  • Company
    • About Us
    • Leadership
    • Partnerships
    • Pressroom
    • Events
    • CSR
    • Life at Veltris
  • Services
    • AI-Augmented Engineering
    • AI Readiness
    • AI Monetization
    • Product Lifecycle & Managed Services
  • Industries
    • Healthcare
      • Healthtech Platforms
      • Dental & Multi-Unit Retail Health
      • Pharmacy Benefit Management (PBM)
    • Technology
      • Software / XTech / AI Platforms
      • Secure Networking & Infrastructure
    • Industrials
      • Logistics & Mobility Tech
      • Engineering & Construction Tech
  • Insights
    • Blogs
    • Whitepapers
    • AI Guides and Innovations
    • Client Case Studies
  • Careers
  • Get My AI Readiness Score
Blogs

A Take on H.O.G Feature Descriptor

January 7, 2020 | Team Veltris
  • Blogs
  • Data & AI
  • Technology, Communications & Media

Face recognition is one of the most sought-after technologies in the field of machine learning. There are two phases in such a system: Face Detection followed by Face Recognition.

Initially, the faces are detected using a Haar Cascade Classifier on an image in conjunction with the cropping of the cardinal section of the face. A geometric face model is formed with the detection of eyes performed using the Haar Cascade Classifier, while nose detection has been used as a reaffirmation mechanism along with the eyes.

Later, HOG features are extracted from large numbers of facial images to be used as part of the recognition mechanism. These HOG features are then labeled together for a face/user and a Support Vector Machine(SVM) model is trained to predict faces that are fed into the system.

The H.O.G(Histogram of Oriented Gradients) is a feature descriptor used in computer vision for image processing for the purpose of object detection. This got traction after Navneet Dalal and Bill Triggs published a paper called Histograms of Oriented Gradients for Human Detection in 2005. This was powerful and state of the art way of doing object detection before the deep learning era. HOGs are widely known for their use in pedestrian detection.

Intuition

Before knowing how H.O.G works let us know what are gradients in this context. Take the following image for example:

When you step from left to right pixel by pixel, you will find that after some steps, there is a sudden change in the pixel value i.e, from a black lower pixel number to a white higher pixel number. This sudden change in the color is called a gradient and going from a darker tone to a lighter tone is called a positive gradient and vice versa. Going from left to right gives us the horizontal gradient and as expected going from top to down gives a vertical gradient.

How the H.O.G works

HOG works with something called a block which is similar to a sliding window. A block is considered as a pixel grid in which gradients are constituted from the magnitude and direction of change in the intensities of the pixel within the block.

Things to note: HOG works on grayscale images.

1 — So the first step would be to convert an RGB image to grayscale.

2 — To get a closer look, let’s focus on one such grid of size 8*8. Look at the following picture.

In the block of 64 pixels, for each pixel, horizontal and vertical gradients are calculated. Like in the above picture, horizontal and vertical gradients are calculated as :

Horizontal Gradient: 120 –70 = 50

Vertical Gradient : 100 –50 = 50

3 — Once we get the gradients we try to calculate something called gradient magnitude and gradient angle for each of 64 pixels.

Now with those 64 gradient vectors, we try to compress them to 9 vectors, trying to retain the maximum structure. To do this we try to plot a histogram of magnitudes and angles. Here x-axis is angles and they are binned into 9 bins each with a size of 20 degrees.

Note: Creating 9 bins is decided by the authors of the HOG paper. So it’s pretty much constant everywhere.

The above results are for one 8*8 grid and we compressed the representation to 9 vectors.

4 — When we slide that 8*8 grid along the whole image and try to interpret the histogram results we get something like below.

5 — And by plotting the HOG features we will find that the structure of the object or face is well maintained, losing all the insignificant features.

And such input can be leveraged by any Machine Learning algorithm to do the classification or regression.

It’s a very powerful technique being used still today and object detection can be achieved without the use of heavy architectures from DL.

The best place to get HOG detection functionality is from the library Dlib.

Now that you know an old handy tool to represent an image in a compressed format and still maintains the structure of it, you can incorporate this in many computer vision use cases.

FOUND THIS USEFUL? SHARE WITH

Related Articles

What is Vertical AI Orchestration?
VeltrisOne™: The Vertical AI Orchestration Platform, Explained
Why Only 5–7% of Enterprises Successfully Scale AI, And How to Be One of Them
Real-Time Private Equity: How Vertical AI Accelerates Value Creation
Why AI Agents Are the Future of Healthcare Revenue Performance
Why Critical Infrastructure Requires Vertical AI to Scale Responsibly
Veltris
Company
  • About Us
  • Leadership
  • Partnerships
  • Pressroom
  • Events
  • CSR
  • Life at Veltris
  • Careers
  • Contact Us
Services
  • AI-Augmented Engineering
  • AI Readiness & Data Modernization
  • AI Monetization
  • Product Lifecycle & Managed Services
Industries
  • Healthcare
  • Technology
  • Industrials
Insights
  • Blogs
  • Whitepapers
  • AI Guides and Innovations
  • Client Case Studies
Copyright © 2026 Veltris. All Rights Reserved.
Cookie Policy | Disclaimer | Privacy Policy | Sitemap
Veltris
  • About Us
  • Leadership
  • Pressroom
  • Events
  • CSR
  • Life at Veltris
  • Careers
  • Contact Us
  • AI-Augmented Engineering
  • AI Readiness & Data Modernization
  • AI Monetization
  • Product Lifecycle & Managed Services
  • Healthcare
  • Technology
  • Industrials
  • Blogs
  • Whitepapers
  • AI Guides and Innovations
  • Client Case Studies
Copyright © 2026 Veltris. All Rights Reserved.
Cookie Policy | Disclaimer | Privacy Policy | Sitemap