Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

HOG

calculate the HOG (Histogram of oriented gradients) for an image


Description

The function is a modification of the 'findHOGFeatures' function of the SimpleCV package [ please consult the COPYRIGHT file ] The function takes either an RGB (it will be converted to gray) or a gray image and returns a vector of the HOG descriptors. The main purpose of the function is to create a vector of features, which can be used in classification tasks.

Usage

HOG(image, cells = 3, orientations = 6)

Arguments

image

matrix or 3-dimensional array

cells

the number of divisions ( cells )

orientations

number of orientation bins

Details

This function takes either a matrix, a data frame or a 3-dimensional array and returns a vector with the HOG-descriptors (histogram of oriented gradients).

Value

a numeric vector

Examples

## Not run: 

path = system.file("tmp_images", "1.png", package = "OpenImageR")

image = readImage(path)

res = HOG(image, cells = 3, orientations = 6)

## End(Not run)

OpenImageR

An Image Processing Toolkit

v1.1.8
GPL-3
Authors
Lampros Mouselimis [aut, cre] (<https://orcid.org/0000-0002-8024-1546>), Sight Machine [cph] (findHOGFeatures function of the SimpleCV computer vision platform), Johannes Buchner [cph] (average_hash, dhash and phash functions of the ImageHash python library), Mohammad Haghighat [cph] (Gabor Feature Extraction), Radhakrishna Achanta [cph] (Author of the C++ code of the SLIC and SLICO algorithms (for commercial use please contact the author))
Initial release
2021-05-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.