完整搜尋頁面 →

SIFT:先讓局部特徵可重複偵測,再進行比對

選讀・IP 12・特徵擷取 的論文導讀(第 2/2 篇)。引用編號對應本頁底部的參考文獻。

導覽:本頁與本系列: 導覽:本頁與本系列

挑戰

尺度、方向或照明改變時,直接比對原始影像區塊容易失敗。Lowe 的 IJCV 2004 論文 [6] 結合可重複的關鍵點偵測、具辨識力的局部描述子與匹配策略。貢獻在整個流程,不只是向量長度。先讀影像梯度與高斯尺度空間,再區分「偵測相同物理位置」和「辨識其局部外觀」。

方法

局部梯度箭頭在空間網格中聚合成方向直方圖,形成關鍵點描述子。
原論文圖 7 — 圖中簡化為 2×2 網格;實驗使用 4×4 網格、每格八個方向區間,共 128 個描述子元素。箭頭長度摘要加權梯度資訊,不是邊緣有無的二元標記。

來源:Lowe [6],IJCV 2004 作者稿,PDF 第 15 頁、圖 7。原始 PDF。

偵測位置與尺度。 建立高斯平滑影像,再計算相鄰尺度的差:

L(x,σ)=(Gσ∗I)(x),D(x,σ)=L(x,kσ)−L(x,σ).L(x,\sigma)=(G_\sigma*I)(x),\qquad D(x,\sigma)=L(x,k\sigma)-L(x,\sigma).

II 是輸入影像,xx 是空間位置,GσG_\sigma 是尺度為 σ\sigma 的高斯核,∗* 是卷積,LL 是平滑影像,DD 是高斯差分響應,k>1k>1 是相鄰尺度比。在空間與尺度鄰點中搜尋極值,細化位置,並排除低對比候選與沿邊緣不穩定的響應。排除邊緣響應是為了處理沿稜線定位不準,不代表所有靠近邊緣的特徵都不能用。

先指定方向,再描述。 局部梯度直方圖給出主要方向;強烈的次要方向可在相同位置與尺度產生額外關鍵點。描述子的空間座標與梯度都改以該方向為基準。圖 7 接著把加權梯度大小聚合到空間網格與方向區間,並以插值降低對區間邊界的敏感度。描述子先正規化、截斷過大元素,再次正規化。這些步驟降低對比與主導梯度的影響,不代表對任意照明變化都不變。

匹配時檢查歧義。 令 d1,d2d_1,d_2 是到最近與次近候選的描述子距離。只接受夠小的 d1/d2d_1/d_2,可排除含糊匹配:第一名很近,但第二名也幾乎一樣近時,證據便較弱。此比值不是匹配正確的機率。原論文的辨識流程還會把相容匹配分組並驗證姿態;描述子本身不能建立幾何一致性。

結果

圖 11 支持距離比測試。在該實驗中,排除大於 0.8 的比值,可移除 90% 錯誤匹配,同時捨棄 不到 5% 的正確匹配。設定包含隨機尺度/方向改變、30 度深度旋轉、2% 影像雜訊與 40,000 個關鍵點的資料庫。這些是特定條件下的原論文結果,不是所有影像對或最近鄰實作的保證錯誤率。

圖 3–6 與圖 9 分開檢查受控變換下的偵測重複性、方向穩定度與最終匹配。比較百分比前,先核對分母與變換設定:成功偵測和正確匹配是不同事件。

消融與設計證據

圖 8 在 50 度視角改變與 4% 雜訊下,調整描述子網格寬度及方向區間數。選定的 4×4×84\times4\times8 表徵,在辨識力與形變敏感度間取得取捨;單純增加維度不一定有幫助。尺度取樣實驗也區分更多偵測點,以及能重複偵測、正確匹配的點。這些研究解釋設計選擇,不是證明一組通用參數。

結論

SIFT 先建立局部座標系,再比較外觀。當影像有足夠紋理與重疊內容時,它是可解釋的基準;描述子匹配後仍須檢查幾何驗證。本章 RANSAC 補充資料 [21] 說明另一種排除幾何不一致對應點的方法;這不代表原始 SIFT 辨識流程,與所有現代 SIFT 加 RANSAC 實作完全相同。

限制與問題

重複圖樣仍可能含糊,無紋理區域可能缺少關鍵點,劇烈視角改變也可能超出尺度與旋轉正規化能處理的形變。遮擋會移除共同資訊。匹配數更多不一定代表配準更好;應檢查空間分布、一致性與失敗案例。學習式替代方法可能改變這些取捨,但比較時必須共用偵測、匹配與幾何評估流程。

參考文獻

  1. R. C. Gonzalez and R. E. Woods, Digital Image Processing, 4th ed., Pearson, 2018, Ch. 12. publisher page
  2. M.-K. Hu, “Visual pattern recognition by moment invariants,” IRE Transactions on Information Theory, vol. 8, no. 2, pp. 179–187, 1962. doi
  3. R. M. Haralick, K. Shanmugam, and I. Dinstein, “Textural features for image classification,” IEEE Transactions on Systems, Man, and Cybernetics, vol. SMC-3, no. 6, pp. 610–621, 1973. doi
  4. C. Harris and M. Stephens, “A combined corner and edge detector,” in Proc. Alvey Vision Conference, pp. 23.1–23.6, 1988. doi
  5. J. Matas, O. Chum, M. Urban, and T. Pajdla, “Robust wide-baseline stereo from maximally stable extremal regions,” Image and Vision Computing, vol. 22, no. 10, pp. 761–767, 2004. doi
  6. D. G. Lowe, “Distinctive image features from scale-invariant keypoints,” International Journal of Computer Vision, vol. 60, no. 2, pp. 91–110, 2004. doi
  7. H. Bay, A. Ess, T. Tuytelaars, and L. Van Gool, “Speeded-up robust features (SURF),” Computer Vision and Image Understanding, vol. 110, no. 3, pp. 346–359, 2008. doi
  8. E. Rublee, V. Rabaud, K. Konolige, and G. Bradski, “ORB: An efficient alternative to SIFT or SURF,” in Proc. IEEE International Conference on Computer Vision (ICCV), pp. 2564–2571, 2011. doi
  9. D. Zhang and G. Lu, “Review of shape representation and description techniques,” Pattern Recognition, vol. 37, no. 1, pp. 1–19, 2004. doi
  10. T. Tuytelaars and K. Mikolajczyk, “Local invariant feature detectors: A survey,” Foundations and Trends in Computer Graphics and Vision, vol. 3, no. 3, pp. 177–280, 2008. doi
  11. L. Liu, J. Chen, P. Fieguth, G. Zhao, R. Chellappa, and M. Pietikäinen, “From BoW to CNN: Two decades of texture representation for texture classification,” International Journal of Computer Vision, vol. 127, pp. 74–109, 2019. arXiv
  12. J. Ma, X. Jiang, A. Fan, J. Jiang, and J. Yan, “Image matching from handcrafted to deep features: A survey,” International Journal of Computer Vision, vol. 129, pp. 23–79, 2021. doi
  13. Y. Jin, D. Mishkin, A. Mishchuk, J. Matas, P. Fua, K. M. Yi, and E. Trulls, “Image matching across wide baselines: From paper to practice,” International Journal of Computer Vision, 2021. doi · arXiv
  14. D. DeTone, T. Malisiewicz, and A. Rabinovich, “SuperPoint: Self-supervised interest point detection and description,” arXiv:1712.07629, 2017. arXiv
  15. P.-E. Sarlin, D. DeTone, T. Malisiewicz, and A. Rabinovich, “SuperGlue: Learning feature matching with graph neural networks,” arXiv:1911.11763, 2019. arXiv
  16. M. J. Tyszkiewicz, P. Fua, and E. Trulls, “DISK: Learning local features with policy gradient,” arXiv:2006.13566, 2020. arXiv
  17. J. Sun, Z. Shen, Y. Wang, H. Bao, and X. Zhou, “LoFTR: Detector-free local feature matching with Transformers,” arXiv:2104.00680, 2021. arXiv
  18. P. Lindenberger, P.-E. Sarlin, and M. Pollefeys, “LightGlue: Local feature matching at light speed,” arXiv:2306.13643, 2023. arXiv
  19. M. Oquab, T. Darcet, T. Moutakanni, et al., “DINOv2: Learning robust visual features without supervision,” arXiv:2304.07193, 2023. arXiv
  20. J. Edstedt, Q. Sun, G. Bökman, M. Wadenbäck, and M. Felsberg, “RoMa: Robust dense feature matching,” in Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2024. arXiv
  21. M. A. Fischler and R. C. Bolles, “Random sample consensus: A paradigm for model fitting with applications to image analysis and automated cartography,” Communications of the ACM, vol. 24, no. 6, pp. 381–395, 1981. doi
  22. scikit-image contributors, “skimage.measure.ransac,” scikit-image 0.26 documentation (API reference). docs