{"id":26784477,"url":"https://github.com/image-js/hog","last_synced_at":"2025-04-19T16:51:36.712Z","repository":{"id":22634569,"uuid":"96892164","full_name":"image-js/hog","owner":"image-js","description":"Histogram of oriented gradients feature descriptor","archived":false,"fork":false,"pushed_at":"2022-02-05T10:52:57.000Z","size":169,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-14T23:01:48.132Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/image-js.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-11T12:46:46.000Z","updated_at":"2020-10-10T13:53:51.000Z","dependencies_parsed_at":"2022-07-27T03:02:16.963Z","dependency_job_id":null,"html_url":"https://github.com/image-js/hog","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-js%2Fhog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-js%2Fhog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-js%2Fhog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-js%2Fhog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/image-js","download_url":"https://codeload.github.com/image-js/hog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246171460,"owners_count":20735001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-29T10:28:48.633Z","updated_at":"2025-03-29T10:28:49.349Z","avatar_url":"https://github.com/image-js.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HOG features (Histogram of oriented gradients)\r\n\r\n  [![build status][travis-image]][travis-url]\r\n  [![npm download][download-image]][download-url]\r\n\r\n## Principe\r\n\r\nThe main feature of this repository will compute the [HOG features](https://en.wikipedia.org/wiki/Histogram_of_oriented_gradients) 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](http://mccormickml.com/2013/05/09/hog-person-detector-tutorial/).\r\n\r\n## Installation\r\n\r\n```sh\r\nnpm install hog-features -S\r\n```\r\n\r\n## Usage\r\n\r\n### extractHOG(image[, options])\r\n\r\nGenerate a vector which corresponds to the HOG descriptor of an image.\r\nReturns an array of float.\r\n\r\n__arguments__\r\n\r\n* `image` - an Image\r\n* `options` - an optional object\r\n\r\n__options__\r\n\r\n* `cellSize`: length of cell in px (default: 4).\r\n* `blockSize`: length of block in number of cells (default: 2).\r\n* `blockStride`: number of cells to slide block window by (default: block-size / 2).\r\n* `bins`: bins per histogram (default: 6).\r\n* `norm`: norm block normalization method (default: \"L2\". Other possibilities : \"L1\" and \"L1-sqrt\").\r\n\r\n## Example\r\n\r\n```js\r\n'use strict';\r\n\r\nconst {Image} = require('image-js');\r\nconst hog = require('hog-features');\r\n\r\nconst file = __dirname + '/__test__/beachball.png';\r\n\r\nImage.load(file).then(function (image) {\r\n    var descriptor = hog.extractHOG(image);\r\n    console.log(descriptor);\r\n});\r\n```\r\n\r\n## Tutorial\r\n\r\nYou can find a tutorial where the HOG features is used with an SVM classifier to classify road signs. [Here is the tutorial](https://github.com/jajoe/tutorial-nodejs/tree/master/image-classification).\r\n\r\n## License\r\n\r\n[MIT](./LICENSE)\r\n\r\nInspired by [harthur implementation](https://github.com/harthur/hog-descriptor)\r\n\r\n[travis-image]: https://img.shields.io/travis/image-js/hog/master.svg?style=flat-square\r\n[travis-url]: https://travis-ci.org/image-js/hog\r\n[download-image]: https://img.shields.io/npm/dm/hog-features.svg?style=flat-square\r\n[download-url]: https://www.npmjs.com/package/hog-features\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimage-js%2Fhog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimage-js%2Fhog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimage-js%2Fhog/lists"}