1. 程式人生 > >使用skimage提取影象hog特徵

使用skimage提取影象hog特徵

使用skimage提取影象hog特徵

from skimage.feature import hog
from skimage import io
from PIL import Image
import cv2


img = cv2.cvtColor(cv2.imread('../img/test.jpg'), cv2.COLOR_BGR2GRAY)
print img.shape
normalised_blocks, hog_image = hog(img, orientations=9, pixels_per_cell=(8, 8), cells_per_block=(8, 8), block_norm='L2-Hys',visualize=True)
io.imshow(hog_image)
io.show()

效果圖: