Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hog-features

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hog-features

Histogram of Oriented Gradients (HOG) features

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
498
decreased by-17.41%
Maintainers
3
Weekly downloads
 
Created
Source

HOG features (Histogram of oriented gradients)

build status npm download

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

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

'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

Keywords

FAQs

Package last updated on 23 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc