Posts

Showing posts from April, 2018

關於 object identification algorithm (1): HOG

HOG, histogram of orientation gradient, 傳統影像處理上在做 image processing/object identification/object classification 最常見的名詞, 是由 Dalal 與 Triggs 在 CVPR 2005 的發表 Histogram of Oriented Gradients for Human Detection , 主要是證明一個物件局部外觀可以透過其邊界方向分布 (或稱方向梯度)有效描述 (local object appearance can be effectively described by distribution of edge direction or orientated gradients)。網路上介紹這算法的文章太多,這裡僅是整理一下個人的認知。 skimage.feature.hog(image, orientations=9, pixels_per_cell=(8, 8), cells_per_block=(3, 3), block_norm=None, visualize=False, visualise=None, transform_sqrt=False, feature_vector=True, multichannel=None) 以上 scikit-iamge 的 hog descripter 用法,從參數上理解是   image : input image   orientations : 指的是 HOG 算法中的梯度/方向, 即 histogram 中的 bins, 9 表示將 180分成 [20,40,60,80,100,120,140,160,180].   pixels_per_cell : 定義作 convolution 時的最小單位 cell 所包含的 pixel 數, 預設[8x8] = 64   cells_per_block : 定義 block 內作 normalization 時所包含的最小單位 cell數, 預設[3x3] = 9   block_norm : 指的是針對normalization 時作 L1 或 L2. 接著是影像處理常見的步驟: 1. preprocessi