用法:
skimage.feature.corner_orientations(image, corners, mask)
計算角的方向。
角的方向是使用一階中心矩計算的,即質心方法。角方向是使用一階中心矩計算的從角坐標到角周圍局部鄰域中的強度質心的向量的角度。
- image:(M, N) 數組
輸入灰度圖像。
- corners:(K, 2) 數組
角坐標為
(row, col)
。- mask:二維數組
定義用於計算中心矩的角的局部鄰域的掩碼。
- orientations:(K, 1) 數組
[-pi, pi] 範圍內的角的方向。
參數:
返回:
參考:
- 1
Ethan Rublee, Vincent Rabaud, Kurt Konolige and Gary Bradski “ORB : An efficient alternative to SIFT and SURF” http://www.vision.cs.chubu.ac.jp/CV-R/pdf/Rublee_iccv2011.pdf
- 2
Paul L. Rosin, “Measuring Corner Properties” http://users.cs.cf.ac.uk/Paul.Rosin/corner2.pdf
例子:
>>> from skimage.morphology import octagon >>> from skimage.feature import (corner_fast, corner_peaks, ... corner_orientations) >>> square = np.zeros((12, 12)) >>> square[3:9, 3:9] = 1 >>> square.astype(int) array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]) >>> corners = corner_peaks(corner_fast(square, 9), min_distance=1) >>> corners array([[3, 3], [3, 8], [8, 3], [8, 8]]) >>> orientations = corner_orientations(square, corners, octagon(3, 2)) >>> np.rad2deg(orientations) array([ 45., 135., -45., -135.])
相關用法
- Python skimage.feature.corner_subpix用法及代碼示例
- Python skimage.feature.corner_foerstner用法及代碼示例
- Python skimage.feature.corner_harris用法及代碼示例
- Python skimage.feature.corner_fast用法及代碼示例
- Python skimage.feature.corner_peaks用法及代碼示例
- Python skimage.feature.corner_moravec用法及代碼示例
- Python skimage.feature.corner_shi_tomasi用法及代碼示例
- Python skimage.feature.canny用法及代碼示例
- Python skimage.feature.graycomatrix用法及代碼示例
- Python skimage.feature.blob_doh用法及代碼示例
- Python skimage.feature.blob_dog用法及代碼示例
- Python skimage.feature.graycoprops用法及代碼示例
- Python skimage.feature.structure_tensor用法及代碼示例
- Python skimage.feature.hessian_matrix用法及代碼示例
- Python skimage.feature.ORB用法及代碼示例
- Python skimage.feature.peak_local_max用法及代碼示例
- Python skimage.feature.CENSURE用法及代碼示例
- Python skimage.feature.hessian_matrix_eigvals用法及代碼示例
- Python skimage.feature.haar_like_feature_coord用法及代碼示例
- Python skimage.feature.BRIEF用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.feature.corner_orientations。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。