首页 > 文章列表 > python如何使用skimage包提取图像

python如何使用skimage包提取图像

Python skimage包
479 2022-08-07

说明

1、skimage.feature.hog()用于提取图像的hog特征。返回特征及特征图像。hog:方向梯度直方图

使用注意

参数 pixels_per_cell 与 cells_per_block 的表示方式与OpenCV中类似,采用 (宽度,高度) ,而非numpy的格式 (行数,列数).

cell尺寸的倍数只能比block小,不能比之大,否则就会越界,返回空列表。

2、函数使用中参数设置错误,不会报错,只会返回一个空列表。

实例

from skimage.feature import hog
 
...
 
normalised_blocks, hog_image = hog(img, orientations=9, pixels_per_cell=(8, 8), cells_per_block=(8, 8),block_norm='L2-Hys', visualize=True)

本文教程操作环境:windows7系统、Python 3.9.1,DELL G3电脑。