HOG ( scikit-image )

from skimage import io, color
from skimage.feature import hog
import matplotlib.pyplot as plt

path = 'C:/Users/liky/Desktop/Face/westbrook.jpg'
image = io.imread(path)
image = color.rgb2gray(image)

arr, hog_image = hog(image, visualise=True, orientations=9, block_norm='L2-Hys')

plt.subplot(1, 2, 1)
plt.imshow(image, cmap=plt.cm.gray)
plt.subplot(1, 2, 2)
plt.imshow(hog_image, cmap=plt.cm.gray)
plt.show()

发布了55 篇原创文章 · 获赞 22 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/li_k_y/article/details/87032977