hog-features

Histogram of Oriented Gradients (HOG) features

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
hog-features
911.0.05 years ago6 years agoMinified + gzip package size for hog-features in KB

Readme

HOG features (Histogram of oriented gradients)
!build statustravis-imagetravis-url !npm downloaddownload-imagedownload-url

Principe

The main feature of this repository will compute the HOG features of an image. The HOG features (called HOG descriptor too) are useful for image recognition and image detection. You can find a good tutorial about HOG features here.

Installation

```sh npm install hog-features -S ```

Usage

extractHOG(image, options)

Generate a vector which corresponds to the HOG descriptor of an image. Returns an array of float. arguments
  • image - an Image
  • options - an optional object
options
  • cellSize: length of cell in px (default: 4).
  • blockSize: length of block in number of cells (default: 2).
  • blockStride: number of cells to slide block window by (default: block-size / 2).
  • bins: bins per histogram (default: 6).
  • norm: norm block normalization method (default: "L2". Other possibilities : "L1" and "L1-sqrt").

Example

```js 'use strict'; const {Image} = require('image-js'); const hog = require('hog-features'); const file = dirname + '/test/beachball.png'; Image.load(file).then(function (image) {
var descriptor = hog.extractHOG(image);
console.log(descriptor);
}); ```

Tutorial

You can find a tutorial where the HOG features is used with an SVM classifier to classify road signs. Here is the tutorial
.

License

MIT Inspired by harthur implementation