SURF matlab 檢測函數使用


1.這篇介紹SURF檢測blob的函數。

函數/Functions

函數名稱:detectSURFFeatures

功能:利用The Speeded-Up Robust Features(SURF)算法檢測blob特征

語法:points = detectSURFFeatures(I); 

            points = detectSURFFeatures(I,Name,Value); 

其中,其中,I為2-D灰度圖像,points為返回的SURF檢測算法檢測到的blob,Name必須為用單引號對包含的如下字符串名稱,Vaule為對應Name的值

 

Name&Value參數
Name Value
'MetricThreshold' 默認值為1000.0,取值較小時,返回更多檢測到的blob
'NumOctaves' 默認值為3,范圍為>=1的整數,表示所使用高斯濾波器的序列,越小時,所使用的高斯濾波器的序列的窗口大小越小,能夠檢測到的Blob的尺度越小,典型值為1-4
'NumScaleLevels' 默認值為4,范圍為>= 3的整數,表示對應NumOctaves取值的高斯濾波器的個數,典型值為3-6
'ROI' 默認為[1,1,size(I,1),size(1)],表示進行角點檢測的圖像區域
Octave&FilterSize
Octave FilterSize
1 9x9,15x15,21x21,27x27,...(相差為6)
2 15x15,27x27,39x39,51x51,...(相差為12)
3 27x27,51x51,75x75,99x99,...(相差為24)
4 ...(相差為48)

 

~~ surf的matlab程序如下

clc
%讀取圖像
I1= imread('info_surf01.jpg');  
I1=imresize(I1,0.6);  %imresize 將原來的圖像縮小原來的一般
I1=rgb2gray(I1);  %把RGB圖像變成灰度圖像
%figure
%imshow(I1)
I2= imread('info_surf03.jpg');  
I2=imresize(I2,0.6);  
I2=rgb2gray(I2);
%figure
%imshow(I2)

%尋找特征點  
points1 = detectSURFFeatures(I1,'MetricThreshold',100);  %讀取特征點
points2 = detectSURFFeatures(I2,'MetricThreshold',100);   

%Extract the features.計算描述向量  
[f1, vpts1] = extractFeatures(I1, points1);  
[f2, vpts2] = extractFeatures(I2, points2);  

%Retrieve the locations of matched points. The SURF feature vectors are already normalized.  
%進行匹配  
indexPairs = matchFeatures(f1, f2, 'Prenormalized', true) ;  
matched_pts1 = vpts1(indexPairs(:, 1)); %這個地方應該是對他進行取值吧 這個應該是啊吧他們做成一個數組
matched_pts2 = vpts2(indexPairs(:, 2));  
%顯示匹配
figure('name','匹配后的圖像'); showMatchedFeatures(I1,I2,matched_pts1,matched_pts2,'montage');  %總共找了39個特征點
legend('matched points 1','matched points 2');


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM