當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python skimage.feature.corner_fast用法及代碼示例

用法:

skimage.feature.corner_fast(image, n=12, threshold=0.15)

提取給定圖像的 FAST 角點。

參數

image(M, N) ndarray

輸入圖像。

nint 可選

圓圈上 16 個像素中的最小連續像素數,這些像素都應該比 testpixel 更亮或更暗。如果 Ic < Ip - 閾值,則圓上的點 c 相對於測試像素 p 更暗,如果 Ic > Ip + 閾值則更亮。也代表FAST-n角檢測器中的n。

threshold浮點數,可選

用於決定圓上的像素是否更亮、更暗或類似 w.r.t 的閾值。測試像素。當需要更多拐角時降低閾值,反之亦然。

返回

responsendarray

快速角響應圖像。

參考

1

Rosten, E., & Drummond, T. (2006, May). Machine learning for high-speed corner detection. In European conference on computer vision (pp. 430-443). Springer, Berlin, Heidelberg. DOI:10.1007/11744023_34 http://www.edwardrosten.com/work/rosten_2006_machine.pdf

2

Wikipedia, “Features from accelerated segment test”, https://en.wikipedia.org/wiki/Features_from_accelerated_segment_test

例子

>>> from skimage.feature import corner_fast, corner_peaks
>>> 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]])
>>> corner_peaks(corner_fast(square, 9), min_distance=1)
array([[3, 3],
       [3, 8],
       [8, 3],
       [8, 8]])

相關用法


注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.feature.corner_fast。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。