最近也注意一些圖像拼接方面的文章,很多很多,尤其是全景圖拼接的,實(shí)際上類似佳能相機(jī)附加的軟件,好多具備全景圖拼接,多幅圖像自動(dòng)軟件實(shí)現(xiàn)拼接,構(gòu)成(合成)一幅全景圖像(風(fēng)景)。 Sift算法,我略知一二,無(wú)法仔細(xì)描述(剛也貼了2個(gè)最近的資料)。 ?????當(dāng)就尺度空間(scale space),我想,其在計(jì)算機(jī)視覺(jué)(ComputerVision)\圖像的多分辨率分析(尤其近年來(lái)小波的多分辨率分析)是常見(jiàn)的概念。 人類視覺(jué)捕捉景物的時(shí)候,先粗略(rough),后細(xì)節(jié)(fine)的習(xí)慣,被研究圖像視覺(jué)的采用。2點(diǎn)采樣使用的情況,則整體圖像被不斷的1/2邊長(zhǎng)劃分,不同的圖像(矩陣)構(gòu)成了不同分辨率的尺度空間(我們理解為不同層面的矩陣),尺度,Scale,這里就代表不同的空間比例。 ??????我注意到David Lowe關(guān)于Sfit算法,2004年發(fā)表在Int. Journal of ComputerVision的經(jīng)典論文中,對(duì)尺度空間(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): 因此 ,一個(gè)圖像的尺度空間,L(x,y,delta) ,定義為原始圖像I(x,y)與一個(gè)可變尺度的2維高斯函數(shù)G(x,y,delta) 卷積運(yùn)算。 ???關(guān)于圖象處理中的空間域卷積運(yùn)算,可以參考經(jīng)典的圖像處理教材(比如 美國(guó) 岡薩雷斯的圖象處理,第二版,或者其Matlab版,都有如何在離散空間進(jìn)行運(yùn)算的例子和說(shuō)明) ??? 注:原文中delta為希臘字母,這里無(wú)法表示,用delta代替。 Sift算法中,提到了尺度空間,請(qǐng)問(wèn)什么是尺度和尺度空間呢? ?? 在上述理解的基礎(chǔ)上,尺度 就是受delta這個(gè)參數(shù)控制的表示。 而不同的L(x,y,delta)就構(gòu)成了尺度空間( Space,我理解,由于描述圖像的時(shí)候,一般用連續(xù)函數(shù)比較好描述公式,所以,采用空間集合 ,空間的概念正規(guī)一些),實(shí)際上,具體計(jì)算的時(shí)候,即使連續(xù)的高斯函數(shù),都要被離散為(一般為奇數(shù)大小)(2*k+1)*(2*k+1)矩陣,來(lái)和數(shù)字圖像進(jìn)行卷積運(yùn)算。 1、 SIFT 算法提出及其改進(jìn) SIFT算法由D.G.Lowe 1999年提出,2004年完善總結(jié)。代表性文獻(xiàn) [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編寫(xiě)了C語(yǔ)言程序。具體的代碼可以在 http://web.engr.oregonstate.edu/~hess/index.html中下載,可以在VC++.net環(huán)境中運(yùn)行,在調(diào)試時(shí)要注意對(duì)GSL和Opencv的正確配置。 后來(lái)Y.Ke將其描述子部分用PCA代替直方圖的方式,對(duì)其進(jìn)行改進(jìn)。 [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算法是一種提取局部特征的算法,在尺度空間尋找極值點(diǎn),提取位置,尺度,旋轉(zhuǎn)不變量。 3、 SIFT算法的主要特點(diǎn): a)SIFT特征是圖像的局部特征,其對(duì)旋轉(zhuǎn)、尺度縮放、亮度變化保持不變性,對(duì)視角變化、仿射變換、噪聲也保持一定程度的穩(wěn)定性。 b)獨(dú)特性(Distinctiveness)好,信息量豐富,適用于在海量特征數(shù)據(jù)庫(kù)中進(jìn)行快速、準(zhǔn)確的匹配[23]。 c) 多量性,即使少數(shù)的幾個(gè)物體也可以產(chǎn)生大量SIFT特征向量。 d) 高速性,經(jīng)優(yōu)化的SIFT匹配算法甚至可以達(dá)到實(shí)時(shí)的要求。 e) 可擴(kuò)展性,可以很方便的與其他形式的特征向量進(jìn)行聯(lián)合。 4、SIFT算法步驟: 1)檢測(cè)尺度空間極值點(diǎn) 2)精確定位極值點(diǎn) 3)為每個(gè)關(guān)鍵點(diǎn)指定方向參數(shù) 4)關(guān)鍵點(diǎn)描述子的生成 SIFT算法的介紹參見(jiàn):SIFT算法學(xué)習(xí)小記 ????前面有朋友問(wèn)到Sift特征點(diǎn)的提取方法,這里簡(jiǎn)單做個(gè)介紹。 ?????作為一種匹配能力較強(qiáng)的局部描述算子,SIFT算法的實(shí)現(xiàn)相當(dāng)復(fù)雜,但從軟件開(kāi)發(fā)的角度來(lái)說(shuō),只要會(huì)使用其中幾個(gè)比較重要的函數(shù)就行了。這里要感謝DavidLowe這個(gè)大牛,不但提供了一種強(qiáng)悍的特征匹配算法,還給出了C++的實(shí)現(xiàn)代碼,后來(lái)有人用C#實(shí)現(xiàn)了這個(gè)算法,需要的朋友可到網(wǎng)上自行下載。 ??????? ????關(guān)鍵函數(shù)一: ?? int sift_features(IplImage* img, struct feature** feat ) ??這個(gè)函數(shù)就是用來(lái)提取圖像中的特征向量。參數(shù)img為一個(gè)指向IplImage數(shù)據(jù)類型的指針,用來(lái)表示需要進(jìn)行特征提取的圖像。IplImage是opencv庫(kù)定義的圖像基本類型(關(guān)于opencv是一個(gè)著名的圖像處理類庫(kù),詳細(xì)的介紹可以參見(jiàn)http://www.opencv.org.cn)。參數(shù)feat是一個(gè)數(shù)組指針,用來(lái)存儲(chǔ)圖像的特征向量。函數(shù)調(diào)用成功將返回特征向量的數(shù)目,否則返回-1. ? ?? 關(guān)鍵函數(shù)二: ?? 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 ) ????這個(gè)函數(shù)是函數(shù)一的重載,作用是一樣的,實(shí)際上函數(shù)一只不過(guò)是使用默認(rèn)參數(shù)調(diào)用了函數(shù)二,核心的代碼都是在函數(shù)二中實(shí)現(xiàn)的。下面將詳細(xì)介紹一下其他的幾個(gè)參數(shù)。 ?? intvls:每個(gè)尺度空間的采樣間隔數(shù),默認(rèn)值為3. ?? sigma: 高斯平滑的數(shù)量,默認(rèn)值1.6. ??contr_thr:判定特征點(diǎn)是否穩(wěn)定,取值(0,1),默認(rèn)為0.04,這個(gè)值越大,被剔除的特征點(diǎn)就越多。 ??curv_thr:判定特征點(diǎn)是否邊緣點(diǎn),默認(rèn)為6. ??img_dbl:在建立尺度空間前如果圖像被放大了1倍則取值為1,否則為0. ??descr_width:計(jì)算特征描述符時(shí)鄰域子塊的寬度,默認(rèn)為4. ????descr_hist_bins:計(jì)算特征描述符時(shí)將特征點(diǎn)鄰域進(jìn)行投影的方向數(shù),默認(rèn)為8,分別是0,45,90,135,180,215,270,315共8個(gè)方向。 ?????如果只是做特征提取,上面這個(gè)函數(shù)就足夠了,不同圖像之間的匹配都是建立在這個(gè)基礎(chǔ)上的,如果你有足夠強(qiáng)的編程能力即使不懂這個(gè)算法也能夠編寫(xiě)出像樣的程序來(lái),因?yàn)橄旅娴谋容^說(shuō)白了都是數(shù)據(jù)結(jié)構(gòu)的比較,跟算法已經(jīng)沒(méi)有太多關(guān)系了。如果想要深入了解算法,還是認(rèn)真的看論文和代碼吧。 、ubc:DAVID LOWE---SIFT算法的創(chuàng)始人,兩篇巨經(jīng)典經(jīng)典的文章 http://www.cs.ubc.ca/~lowe/ 2、cmu:YanKe---PCASIFT,總結(jié)的SIFT方面的文章SO全,巨經(jīng)典 http://www.andrew.cmu.edu/user/yke/ 3、ubc:MBROWN---SIFT算法用于圖像拼接的經(jīng)典應(yīng)用autopano-sift,包括一個(gè)SIFTLIB庫(kù) http://www.cs.ubc.ca/~mbrown/autostitch/autostitch.html http://www.cs.ubc.ca/~mbrown/panorama/panorama.html 4、toronto:Jepson---Matlab SIFT tutorial, 超級(jí)超級(jí)超級(jí)經(jīng)典~ http://www.cs.toronto.edu/~jepson 5、ucla:Vedaldi---加州大學(xué)一個(gè)博士生編的SIFT,Matlab、C的都有,但沒(méi)用過(guò) http://www.cs.ucla.edu/~vedaldi/ 6、一個(gè)小的拼接軟件ptasmblr http://www.tawbaware.com/ptasmblr.htm 幾個(gè)關(guān)于sift的算法鏈接網(wǎng)址,以后要養(yǎng)成這種隨時(shí)保存資料的好習(xí)慣!否則后面不知道又要花多少時(shí)間去找,最重要的是影響心情。 SIFT?關(guān)鍵點(diǎn)檢測(cè)和匹配算法,這個(gè)算法在圖像匹配方面具有很好的性能。 比原有的harris點(diǎn)匹配方式具有各高的佩準(zhǔn)準(zhǔn)確度,只是算法速度較慢 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? |