用法:
skimage.feature.graycoprops(P, prop='contrast')
計算 GLCM 的紋理屬性。
計算灰度共現矩陣的一個特征,作為矩陣的一個緊湊的總結。屬性計算如下:
‘contrast’:
‘dissimilarity’:
‘homogeneity’:
'ASM':
‘energy’:
- ‘correlation’:
在計算紋理屬性之前,每個 GLCM 都被歸一化為總和為 1。
- P:ndarray
輸入數組。 P 是要為其計算指定屬性的灰度共現直方圖。值 P[i,j,d,theta] 是灰度 j 在距離 d 處和與灰度 i 成角度 theta 處出現的次數。
- prop:{‘contrast’, ‘dissimilarity’, ‘homogeneity’, ‘energy’, ‘correlation’, ‘ASM’},可選
要計算的 GLCM 的屬性。默認值為‘contrast’。
- results:二維數組
二維數組。 results[d, a] 是屬性‘prop’,用於第 d 距離和第 a 角。
參數:
返回:
參考:
- 1
M. Hall-Beyer, 2007. GLCM Texture: A Tutorial v. 1.0 through 3.0. The GLCM Tutorial Home Page, https://prism.ucalgary.ca/handle/1880/51900 DOI:10.11575/PRISM/33280
例子:
計算距離 [1, 2] 和角度 [0 度, 90 度] 的 GLCM 的對比度
>>> image = np.array([[0, 0, 1, 1], ... [0, 0, 1, 1], ... [0, 2, 2, 2], ... [2, 2, 3, 3]], dtype=np.uint8) >>> g = graycomatrix(image, [1, 2], [0, np.pi/2], levels=4, ... normed=True, symmetric=True) >>> contrast = graycoprops(g, 'contrast') >>> contrast array([[0.58333333, 1. ], [1.25 , 2.75 ]])
相關用法
- Python skimage.feature.graycomatrix用法及代碼示例
- Python skimage.feature.blob_doh用法及代碼示例
- Python skimage.feature.blob_dog用法及代碼示例
- 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用法及代碼示例
- Python skimage.feature.structure_tensor_eigvals用法及代碼示例
- Python skimage.feature.blob_log用法及代碼示例
- Python skimage.feature.shape_index用法及代碼示例
- Python skimage.feature.corner_peaks用法及代碼示例
- Python skimage.feature.corner_moravec用法及代碼示例
- Python skimage.feature.structure_tensor_eigenvalues用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.feature.graycoprops。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。