用法:
skimage.feature.draw_haar_like_feature(image, r, c, width, height, feature_coord, color_positive_block=(1.0, 0.0, 0.0), color_negative_block=(0.0, 1.0, 0.0), alpha=0.5, max_n_features=None, random_state=None)
Haar-like 特征的可视化。
- image:(M, N) ndarray
需要计算特征的积分图像的区域。
- r:int
检测窗口左上角的Row-coordinate。
- c:int
检测窗口左上角的Column-coordinate。
- width:int
检测窗口的宽度。
- height:int
检测窗口的高度。
- feature_coord:元组列表的 ndarray 或无,可选
要提取的坐标数组。当您只想重新计算特征的子集时,这很有用。在这种情况下feature_type需要是一个包含每个特征类型的数组,由返回skimage.feature.haar_like_feature_coord.默认情况下,计算所有坐标。
- color_positive_block:3 个浮点数的元组
指定正块颜色的浮点数。对应的值定义了 (R, G, B) 值。默认值为红色 (1, 0, 0)。
- color_negative_block:3 个浮点数的元组
为负块指定颜色的浮点数对应的值定义(R,G,B)值。默认值为蓝色 (0, 1, 0)。
- alpha:浮点数
[0, 1] 范围内的值,用于指定可视化的不透明度。 1 - 完全透明,0 - 不透明。
- max_n_features:int 默认=无
要返回的最大特征数。默认情况下,返回所有函数。
- random_state:{无,int
numpy.random.Generator
如果random_state是没有的
numpy.random.Generator
使用单例。如果random_state是一个int 一个新的Generator
使用实例,播种random_state.如果random_state已经是一个Generator
实例然后使用该实例。当生成一组小于可用特征总数的特征时使用随机状态。
- features:(M, N), ndarray
将添加不同函数的图像。
参数:
返回:
例子:
>>> import numpy as np >>> from skimage.feature import haar_like_feature_coord >>> from skimage.feature import draw_haar_like_feature >>> feature_coord, _ = haar_like_feature_coord(2, 2, 'type-4') >>> image = draw_haar_like_feature(np.zeros((2, 2)), ... 0, 0, 2, 2, ... feature_coord, ... max_n_features=1) >>> image array([[[0. , 0.5, 0. ], [0.5, 0. , 0. ]], [[0.5, 0. , 0. ], [0. , 0.5, 0. ]]])
相关用法
- Python skimage.feature.graycomatrix用法及代码示例
- Python skimage.feature.blob_doh用法及代码示例
- Python skimage.feature.blob_dog用法及代码示例
- Python skimage.feature.graycoprops用法及代码示例
- Python skimage.feature.corner_orientations用法及代码示例
- Python skimage.feature.structure_tensor用法及代码示例
- Python skimage.feature.hessian_matrix用法及代码示例
- Python skimage.feature.ORB用法及代码示例
- Python skimage.feature.corner_subpix用法及代码示例
- Python skimage.feature.canny用法及代码示例
- Python skimage.feature.peak_local_max用法及代码示例
- Python skimage.feature.CENSURE用法及代码示例
- Python skimage.feature.hessian_matrix_eigvals用法及代码示例
- Python skimage.feature.corner_foerstner用法及代码示例
- Python skimage.feature.haar_like_feature_coord用法及代码示例
- Python skimage.feature.corner_harris用法及代码示例
- Python skimage.feature.corner_fast用法及代码示例
- Python skimage.feature.BRIEF用法及代码示例
- Python skimage.feature.haar_like_feature用法及代码示例
- Python skimage.feature.SIFT用法及代码示例
注:本文由纯净天空筛选整理自scikit-image.org大神的英文原创作品 skimage.feature.draw_haar_like_feature。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。