最近也注意一些圖像拼接方面的文章,很多很多,尤其是全景圖拼接的,實際上類似佳能相機附加的軟件,好多具備全景圖拼接,多幅圖像自動軟件實現拼接,構成(合成)一幅全景圖像(風景)。 Sift算法,我略知一二,無法仔細描述(剛也貼了2個最近的資料)。 ?????當就尺度空間(scale space),我想,其在計算機視覺(ComputerVision)\圖像的多分辨率分析(尤其近年來小波的多分辨率分析)是常見的概念。 人類視覺捕捉景物的時候,先粗略(rough),后細節(fine)的習慣,被研究圖像視覺的采用。2點采樣使用的情況,則整體圖像被不斷的1/2邊長劃分,不同的圖像(矩陣)構成了不同分辨率的尺度空間(我們理解為不同層面的矩陣),尺度,Scale,這里就代表不同的空間比例。 ??????我注意到David Lowe關于Sfit算法,2004年發表在Int. Journal of ComputerVision的經典論文中,對尺度空間(scal space)是這樣定義的 : ?? It has been shown byKoenderink (1984) and Lindeberg (1994) that under a varietyof reasonable assumptions the only possible scale-space kernel is theGaussian function.Therefore, the scale space of an image is defined as a function, L(x; y;delta) that is produced from the convolution of a variable-scaleGaussian, G(x; y; delta), with an input image, I(x;y): 因此 ,一個圖像的尺度空間,L(x,y,delta) ,定義為原始圖像I(x,y)與一個可變尺度的2維高斯函數G(x,y,delta) 卷積運算。 ???關于圖象處理中的空間域卷積運算,可以參考經典的圖像處理教材(比如 美國 岡薩雷斯的圖象處理,第二版,或者其Matlab版,都有如何在離散空間進行運算的例子和說明) ??? 注:原文中delta為希臘字母,這里無法表示,用delta代替。 Sift算法中,提到了尺度空間,請問什么是尺度和尺度空間呢? ?? 在上述理解的基礎上,尺度 就是受delta這個參數控制的表示。 而不同的L(x,y,delta)就構成了尺度空間( Space,我理解,由于描述圖像的時候,一般用連續函數比較好描述公式,所以,采用空間集合 ,空間的概念正規一些),實際上,具體計算的時候,即使連續的高斯函數,都要被離散為(一般為奇數大小)(2*k+1)*(2*k+1)矩陣,來和數字圖像進行卷積運算。 1、 SIFT 算法提出及其改進 SIFT算法由D.G.Lowe 1999年提出,2004年完善總結。代表性文獻 [1]David G. Lowe, "Object recognition from localscale-invariant features,"International Conference onComputer Vision, Corfu, Greece (September 1999),pp.1150-1157. [2] David G. Lowe, "Distinctive image features fromscale-invariant keypoints,"International Journal ofComputer Vision, 60, 2 (2004), pp. 91-110. 具體的MATLAB代碼在 http://www.cs.ubc.ca/~lowe/keypoints/可以下載。 Rob Hess 基于GSL和Opencv編寫了C語言程序。具體的代碼可以在 http://web.engr.oregonstate.edu/~hess/index.html中下載,可以在VC++.net環境中運行,在調試時要注意對GSL和Opencv的正確配置。 后來Y.Ke將其描述子部分用PCA代替直方圖的方式,對其進行改進。 [3] Y. Ke and R. Sukthankar. PCA-SIFT: A MoreDistinctive Representation for Local ImageDescriptors.Computer Vision and Pattern Recognition, 2004 Yanke’s homepage: http://www.andrew.cmu.edu/user/yke/ 2、 SIFT算法主要思想 SIFT算法是一種提取局部特征的算法,在尺度空間尋找極值點,提取位置,尺度,旋轉不變量。 3、 SIFT算法的主要特點: a)SIFT特征是圖像的局部特征,其對旋轉、尺度縮放、亮度變化保持不變性,對視角變化、仿射變換、噪聲也保持一定程度的穩定性。 b)獨特性(Distinctiveness)好,信息量豐富,適用于在海量特征數據庫中進行快速、準確的匹配[23]。 c) 多量性,即使少數的幾個物體也可以產生大量SIFT特征向量。 d) 高速性,經優化的SIFT匹配算法甚至可以達到實時的要求。 e) 可擴展性,可以很方便的與其他形式的特征向量進行聯合。 4、SIFT算法步驟: 1)檢測尺度空間極值點 2)精確定位極值點 3)為每個關鍵點指定方向參數 4)關鍵點描述子的生成 SIFT算法的介紹參見:SIFT算法學習小記 ????前面有朋友問到Sift特征點的提取方法,這里簡單做個介紹。 ?????作為一種匹配能力較強的局部描述算子,SIFT算法的實現相當復雜,但從軟件開發的角度來說,只要會使用其中幾個比較重要的函數就行了。這里要感謝DavidLowe這個大牛,不但提供了一種強悍的特征匹配算法,還給出了C++的實現代碼,后來有人用C#實現了這個算法,需要的朋友可到網上自行下載。 ??????? ????關鍵函數一: ?? int sift_features(IplImage* img, struct feature** feat ) ??這個函數就是用來提取圖像中的特征向量。參數img為一個指向IplImage數據類型的指針,用來表示需要進行特征提取的圖像。IplImage是opencv庫定義的圖像基本類型(關于opencv是一個著名的圖像處理類庫,詳細的介紹可以參見http://www.opencv.org.cn)。參數feat是一個數組指針,用來存儲圖像的特征向量。函數調用成功將返回特征向量的數目,否則返回-1. ? ?? 關鍵函數二: ?? int _sift_features(IplImage* img, struct feature** feat, int intvls,double sigma,double contr_thr, int curv_thr, int img_dbl, int descr_width, intdescr_hist_bins ) ????這個函數是函數一的重載,作用是一樣的,實際上函數一只不過是使用默認參數調用了函數二,核心的代碼都是在函數二中實現的。下面將詳細介紹一下其他的幾個參數。 ?? intvls:每個尺度空間的采樣間隔數,默認值為3. ?? sigma: 高斯平滑的數量,默認值1.6. ??contr_thr:判定特征點是否穩定,取值(0,1),默認為0.04,這個值越大,被剔除的特征點就越多。 ??curv_thr:判定特征點是否邊緣點,默認為6. ??img_dbl:在建立尺度空間前如果圖像被放大了1倍則取值為1,否則為0. ??descr_width:計算特征描述符時鄰域子塊的寬度,默認為4. ????descr_hist_bins:計算特征描述符時將特征點鄰域進行投影的方向數,默認為8,分別是0,45,90,135,180,215,270,315共8個方向。 ?????如果只是做特征提取,上面這個函數就足夠了,不同圖像之間的匹配都是建立在這個基礎上的,如果你有足夠強的編程能力即使不懂這個算法也能夠編寫出像樣的程序來,因為下面的比較說白了都是數據結構的比較,跟算法已經沒有太多關系了。如果想要深入了解算法,還是認真的看論文和代碼吧。 、ubc:DAVID LOWE---SIFT算法的創始人,兩篇巨經典經典的文章 http://www.cs.ubc.ca/~lowe/ 2、cmu:YanKe---PCASIFT,總結的SIFT方面的文章SO全,巨經典 http://www.andrew.cmu.edu/user/yke/ 3、ubc:MBROWN---SIFT算法用于圖像拼接的經典應用autopano-sift,包括一個SIFTLIB庫 http://www.cs.ubc.ca/~mbrown/autostitch/autostitch.html http://www.cs.ubc.ca/~mbrown/panorama/panorama.html 4、toronto:Jepson---Matlab SIFT tutorial, 超級超級超級經典~ http://www.cs.toronto.edu/~jepson 5、ucla:Vedaldi---加州大學一個博士生編的SIFT,Matlab、C的都有,但沒用過 http://www.cs.ucla.edu/~vedaldi/ 6、一個小的拼接軟件ptasmblr http://www.tawbaware.com/ptasmblr.htm 幾個關于sift的算法鏈接網址,以后要養成這種隨時保存資料的好習慣!否則后面不知道又要花多少時間去找,最重要的是影響心情。 SIFT?關鍵點檢測和匹配算法,這個算法在圖像匹配方面具有很好的性能。 比原有的harris點匹配方式具有各高的佩準準確度,只是算法速度較慢 SIFT?Keypoint?Detector This?page?provides?access?to?a?demo?version?of?David?Lowe's?SIFT?keypoint?detector?in?the?form?of?compiled?binaries?that?can?run?under?Linux?or?Windows.?The?demo?software?uses?PGM?format?for?image?input.?It?can?output?keypoints?and?all?information?needed?for?matching?them?to?a?file?in?a?simple?ASCII?format.?A?Matlab?program?and?sample?C?code?are?provided?that?can?read?the?keypoints?and?match?them?between?images.? ?The?image?on?the?right?shows?an?example?of?matching?produced?by?the?demo?software.?Features?are?extracted?from?each?of?the?two?images,?and?lines?are?drawn?between?features?that?have?close?matches.?In?this?example,?many?matches?are?found?and?only?a?small?fraction?are?incorrect.? This?software?is?provided?for?research?purposes?only,?and?a?license?must?be?obtained?from?the?University?of?British?Columbia?for?commercial?applications.?See?the?LICENSE?file?provided?with?the?software.? The?program?can?be?accessed?from?the?following?link?in?the?form?of?a?zip?file?containing?the?compiled?binaries?and?demo?code.?To?unpack,?use?"unzip?siftDemoV4.zip"?from?Linux?or?an?unzip?utility?in?Windows.?The?code?comes?with?a?file?README?giving?full?details.? SIFT?demo?program?(Version?4,?July?2005)? Release?history Version?4?(July?2005)?There?is?now?a?Windows?binary?as?well?as?one?for?Linux.?The?Matlab?scripts?have?been?improved?and?include?code?for?matching?keypoints?between?images.?Version?3?(August?2004)?This?fixes?a?bug?in?the?displayed?orientation?of?arrows?drawn?for?each?keypoint?when?using?the?"-display"?option.?This?affects?only?arrow?display?and?not?the?keypoint?features?themselves?(thanks?to?Yannik?Fournier,?Tom?Stepleton,?and?Rob?Sim?for?identifying?the?bug).?In?addition,?a?Matlab?program?is?now?provided?for?running?the?binary?and?loading?the?keypoints?into?Matlab?when?running?under?Linux?(thanks?to?D.?Alvaro?and?J.J.?Guerrero?for?the?Matlab?program).?Version?2?(September?2003)?Fixes?a?bug?in?Version?1?of?the?sample?code?for?doing?matching?(not?the?keypoints?themselves)?that?incorrectly?declared?"unsigned?char"?as?"char"?(thanks?to?Yongqin?Xiao?and?Suresh?Lodha?for?their?assistance?in?reporting?this?bug).?This?new?version?now?finds?more?correct?matches.?The?new?version?also?contains?more?test?data?and?raises?the?matching?threshold.?Version?1?(June?2003)?Initial?demo?release.? Related?papers The?most?complete?and?up-to-date?reference?for?the?SIFT?feature?detector?is?given?in?the?following?journal?paper:? David?G.?Lowe,?"Distinctive?image?features?from?scale-invariant?keypoints,"?International?Journal?of?Computer?Vision,?60,?2?(2004),?pp.?91-110.?[PDF]? The?SIFT?approach?to?invariant?keypoint?detection?was?first?described?in?the?following?ICCV?1999?conference?paper,?which?also?gives?some?more?information?on?the?applications?to?object?recognition:? David?G.?Lowe,?"Object?recognition?from?local?scale-invariant?features,"?International?Conference?on?Computer?Vision,?Corfu,?Greece?(September?1999),?pp.?1150-1157.?[PDF];? The?following?paper?gives?methods?for?performing?3D?object?recognition?by?interpolating?between?2D?views.?It?also?provides?a?probabilistic?model?for?verification?of?recognition.? David?G.?Lowe,?"Local?feature?view?clustering?for?3D?object?recognition,"?IEEE?Conference?on?Computer?Vision?and?Pattern?Recognition,?Kauai,?Hawaii?(December?2001),?pp.?682-688.?[PDF];? Patents Method?and?apparatus?for?identifying?scale?invariant?features?in?an?image?and?use?of?same?for?locating?an?object?in?an?image?David?G.?Lowe,?US?Patent?6,711,293?(March?23,?2004).?Provisional?application?filed?March?8,?1999.?Asignee:?The?University?of?British? |