用法:
class skimage.feature.SIFT(upsampling=2, n_octaves=8, n_scales=3, sigma_min=1.6, sigma_in=0.5, c_dog=0.013333333333333334, c_edge=10, n_bins=36, lambda_ori=1.5, c_max=0.8, lambda_descr=6, n_hist=4, n_ori=8)
基礎:
skimage.feature.util.FeatureDetector
,skimage.feature.util.DescriptorExtractor
SIFT 特征檢測和說明符提取。
- upsampling:int 可選
在特征檢測之前,圖像被放大 1 倍(無放大)、2 或 4。方法:Bi-cubic 插值。
- n_octaves:int 可選
最大八度音階數。每增加一個八度,圖像大小減半,sigma 加倍。八度音階的數量將根據需要減少,以在最小比例下沿每個維度保持至少 12 個像素。
- n_scales:int 可選
每個八度音階的最大音階數。
- sigma_min:浮點數,可選
種子圖像的模糊級別。如果啟用了上采樣 sigma_min 按因子 1/上采樣進行縮放
- sigma_in:浮點數,可選
輸入圖像的假定模糊級別。
- c_dog:浮點數,可選
DoG中丟棄低對比度極值的閾值它的最終值取決於n_scales的關係:final_c_dog = (2^(1/n_scales)-1) /(2^(1/3)-1) * c_dog
- c_edge:浮點數,可選
丟棄位於邊的極值的閾值。如果 H 是極值的 Hessian,則其 “edgeness” 由 tr(H)²/det(H) 說明。如果邊度高於 (c_edge + 1)²/c_edge,則丟棄極值。
- n_bins:int 可選
直方圖中說明關鍵點周圍梯度方向的 bin 數量。
- lambda_ori:浮點數,可選
用於查找關鍵點參考方向的窗口的寬度為 6 * lambda_ori * sigma,並由 2 * lambda_ori * sigma 的標準差加權。
- c_max:浮點數,可選
方向直方圖中的次峰被接受為方向的閾值
- lambda_descr:浮點數,可選
用於定義關鍵點說明符的窗口具有 2 * lambda_descr * sigma * (n_hist+1)/n_hist 的寬度,並由 lambda_descr * sigma 的標準差加權。
- n_hist:int 可選
用於定義關鍵點說明符的窗口由 n_hist * n_hist 直方圖組成。
- n_ori:int 可選
說明符補丁的直方圖中的 bin 數量。
參數:
注意:
SIFT 算法由 David Lowe [1]、[2] 開發,後來獲得了不列顛哥倫比亞大學的專利。由於該專利於 2020 年到期,因此可以免費使用。此處的實現緊跟 [3] 中的詳細說明,包括使用相同的默認參數。
參考:
- 1
D.G. Lowe. “Object recognition from local scale-invariant features”, Proceedings of the Seventh IEEE International Conference on Computer Vision, 1999, vol.2, pp. 1150-1157. DOI:10.1109/ICCV.1999.790410
- 2
D.G. Lowe. “Distinctive Image Features from Scale-Invariant Keypoints”, International Journal of Computer Vision, 2004, vol. 60, pp. 91-110. DOI:10.1023/B:VISI.0000029664.99615.94
- 3
I. R. Otero and M. Delbracio. “Anatomy of the SIFT Method”, Image Processing On Line, 4 (2014), pp. 370-396. DOI:10.5201/ipol.2014.82
例子:
>>> from skimage.feature import SIFT, match_descriptors >>> from skimage.data import camera >>> from skimage.transform import rotate >>> img1 = camera() >>> img2 = rotate(camera(), 90) >>> detector_extractor1 = SIFT() >>> detector_extractor2 = SIFT() >>> detector_extractor1.detect_and_extract(img1) >>> detector_extractor2.detect_and_extract(img2) >>> matches = match_descriptors(detector_extractor1.descriptors, ... detector_extractor2.descriptors, ... max_ratio=0.6) >>> matches[10:15] array([[ 10, 412], [ 11, 417], [ 12, 407], [ 13, 411], [ 14, 406]]) >>> detector_extractor1.keypoints[matches[10:15, 0]] array([[ 95, 214], [ 97, 211], [ 97, 218], [102, 215], [104, 218]]) >>> detector_extractor2.keypoints[matches[10:15, 1]] array([[297, 95], [301, 97], [294, 97], [297, 102], [293, 104]])
- delta_min:浮點數
第一個八度的采樣距離。它的最終值為 1/上采樣。
- float_dtype:類型
圖像的數據類型。
- scalespace_sigmas:(n_octaves, n_scales + 3) 數組
所有八度音階中所有音階的 sigma 值。
- keypoints:(N, 2) 數組
關鍵點坐標為
(row, col)
。- positions:(N, 2) 數組
Subpixel-precision 關鍵點坐標為
(row, col)
。- sigmas:(N, ) 數組
關鍵點的相應 sigma(模糊)值。
- scales:(N, ) 數組
關鍵點的相應比例。
- orientations:(N, ) 數組
每個關鍵點周圍的漸變方向。
- octaves:(N, ) 數組
關鍵點的對應八度。
- descriptors:(N, n_hist*n_hist*n_ori) 數組
關鍵點的說明符。
屬性:
相關用法
- 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.structure_tensor_eigvals用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.feature.SIFT。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。