Skip to main content
. 2021 Oct 8;21(19):6691. doi: 10.3390/s21196691
Algorithm 1: HOG feature extraction.

Input: Image dataset with RGB colors.

Step 1: Compute the gradient of each pixel of the image, number of orientation bins used was 9.

Step 2: Divide the images into cells, 8 × 8 pixels form a cell, and compute gradient histograms of each cell.

Step 3: 2 × 2 cells form a block, and normalize gradient histograms across blocks.

Step 4: The feature descriptors of all blocks are then flattened into a feature vector.

Output: HOG features.