2015-04-28 34 views

回答

2

MATLAB的內置函數corner具有各種功能。

我已經在這裏拍攝的樣本圖像

enter image description here

im = rgb2gray(imread('http://i.stack.imgur.com/xZTWm.jpg')); 

%// fixing the corners detected indirectly by specifying quality level. 
C = corner(im,'QualityLevel',0.2); 

Cno = size(C,1); 

輸出:

>> Cno 

Cno = 

4 

或者你可以解決沒有角的直接:

rgbIm = imread('http://i.stack.imgur.com/xZTWm.jpg'); 
im = rgb2gray(rgbIm); 
C = corner(im,3); %// specifying maximum no. of corners 

Cno = size(C,1); 

figure; 
imshow(rgbIm); 
hold on 
scatter(C(:,1),C(:,2),50,'filled'); 
hold off 

輸出:

>> Cno 

Cno = 

3 

enter image description here

+0

好吧好吧......那是相當有幫助.... –

+0

想知道ü沒有通過質量水平 –

+0

@bksumedha放大圖片的意思。角落檢測使用不同的算法來檢測角落。如果你降低質量水平,你會得到更多的角落。同樣,當你增加數值時,你的角落數量就會減少。玩一些改變這些值的圖像..你會得到它。 –