hog图片的可视化
from skimage.feature import hog image = mpimg.imread(rootPath + r'crop-delete-images/0.03 s.jpg') pixelsPerCell = 32 kwargs = dict(orientations=8, pixels_per_cell=(pixelsPerCell, pixelsPerCell), cells_per_block=(1, 1), transform_sqrt=True) normalised_blocks, hog_image =hog(image,visualize=True, **kwargs) from skimage import exposure hog_image_rescaled = exposure.rescale_intensity(hog_image, in_range=(0, 0.02)) final_img = image * hog_image_rescaled plt.imshow(hog_image) plt.imshow(hog_image_rescaled) plt.imshow(final_img)