使用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()

效果图:

猜你喜欢

转载自blog.csdn.net/mago2015/article/details/85320347