HOG 特征的提取--基于scikit-image

2017-04-12  本文已影响0人  vola_lei

简介

HOG 特征, histogram of oriented gradient, 梯度方向直方图特征, 作为提取基于梯度的特征, HOG 采用了统计的方式(直方图)进行提取. 其基本思路是将图像局部的梯度统计特征拼接起来作为总特征. 局部特征在这里指的是将图像划分为多个Block, 每个Block内的特征进行联合以形成最终的特征. 具体来说:

demo of hog feature extraction

实现

基于python的scikit-image库提供了HOG特征提取的接口:

from skimage import feature as ft
features = ft.hog(image,  # input image
                  orientations=ori,  # number of bins
                  pixels_per_cell=ppc, # pixel per cell
                  cells_per_block=cpb, # cells per blcok
                  block_norm = 'L1', #  block norm : str {‘L1’, ‘L1-sqrt’, ‘L2’, ‘L2-Hys’}, optional
                  transform_sqrt = True, # power law compression (also known as gamma correction)
                  feature_vector=True, # flatten the final vectors
                  visualise=False) # return HOG map

参数说明:

[作者原文] Dalal, N and Triggs, B, Histograms of Oriented Gradients for Human Detection, IEEE Computer Society Conference on Computer Vision and Pattern Recognition 2005 San Diego, CA, USA,https://lear.inrialpes.fr/people/triggs/pubs/Dalal-cvpr05.pdf, DOI:10.1109/CVPR.2005.177

上一篇 下一篇

猜你喜欢

热点阅读