HOG Algorithm Implementation


HOG (Histograms of Oriented Gradients) Algorithm is an algorithm aiming to realize object segmentation (edge detection) on images before CNN models are widely used.


Navneet Dalal and Bill Triggs, Histograms of Oriented Gradients, CVPR 2005

Getting Started

  1. Clone this repository
git clone https://github.com/LeoTheBestCoder/HOG_implementation.git
  1. Install related libraries

pip install opencv-python
pip install numpy
pip install matplotlib
  1. Put your input image under same directory and modify line 10 in image.py (include filename extension)
IMAGE_NAME = 'amumu.jpg'
  1. Run the script
python3 image.py


  • Input Image
  • Segmentation Result


View Github