用法:
skimage.feature.structure_tensor(image, sigma=1, mode='constant', cval=0, order=None)
使用平方差之和計算結構張量。
(二維)結構張量 A 定義為:
A = [Arr Arc] [Arc Acc]
它通過圖像中每個像素周圍的局部窗口中的平方差的加權和來近似。這個公式可以擴展到更多的維度(參見[1])。
- image:ndarray
輸入圖像。
- sigma:float 或 array-like of float,可選
用於高斯核的標準偏差,用作平方差的局部求和的加權函數。如果 sigma 是可迭代的,它的長度必須等於image.ndim,並且每個元素都用於沿其各自軸應用的高斯核。
- mode:{‘constant’, ‘reflect’, ‘wrap’, ‘nearest’, ‘mirror’},可選
如何處理圖像邊界之外的值。
- cval:浮點數,可選
與模式‘constant’(圖像邊界外的值)結合使用。
- order:{‘rc’, ‘xy’},可選
注意:僅適用於 2D。更高的維度必須始終使用‘rc’ 順序。此參數允許在梯度計算中使用圖像軸的反向或正向順序。 ‘rc’ 表示最初使用第一個軸(Arr、Arc、Acc),而 ‘xy’ 表示最初使用最後一個軸(Axx、Axy、Ayy)。
- A_elems:ndarray 列表
Upper-diagonal 輸入圖像中每個像素的結構張量元素。
參數:
返回:
參考:
例子:
>>> from skimage.feature import structure_tensor >>> square = np.zeros((5, 5)) >>> square[2, 2] = 1 >>> Arr, Arc, Acc = structure_tensor(square, sigma=0.1, order='rc') >>> Acc array([[0., 0., 0., 0., 0.], [0., 1., 0., 1., 0.], [0., 4., 0., 4., 0.], [0., 1., 0., 1., 0.], [0., 0., 0., 0., 0.]])
相關用法
- Python skimage.feature.structure_tensor_eigvals用法及代碼示例
- Python skimage.feature.structure_tensor_eigenvalues用法及代碼示例
- Python skimage.feature.shape_index用法及代碼示例
- 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.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用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.feature.structure_tensor。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。