用法:
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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。