2016-12-21 37 views
0

我使用的是detectMSERFeatures函數的Matlab 2014b版本,用於獲取圖像的特徵,但是這個函數給出錯誤,請大家幫忙。Error使用Matlab的detectMSERFeatures函數

代碼:

colorImage = imread('handicapSign.jpg'); 
    I = rgb2gray(colorImage); 

    % Detect MSER regions. 
    [mserRegions, mserConnComp] = detectMSERFeatures(I, ... 
     'RegionAreaRange',[200 8000],'ThresholdDelta',4); 

    figure 
    imshow(I) 

錯誤:

Error using detectMSERFeatures 
Too many output arguments, please help. 
+1

'which('detectMSERFeatures')'產生了什麼?有可能你的路徑上有一個名爲'detectMSERFeatures.m'的文件,這個文件掩蓋了MATLAB自己的功能。 – Suever

+0

你正在使用哪個版本的MATLAB?我認爲第二個輸出參數是在16a中引入的。 – Navan

+0

我正在使用R2014b Matlab版本。 @Navan –

回答

1

detectMSERFeatures返回第二輸出MSER區域在從16A開始連接的組件結構。在此之前,它只返回一個輸出regions,它是一個MSERRegions對象。您需要更新代碼才能從detectMSERFeatures獲取一個輸出。根據您在detectMSERFeatures之後需要執行的操作,可以使用extractFeatures函數從detectMSERFeatures的輸出中提取特徵向量。例如,查看R2014b的文檔。

+0

這實際上是我的問題,我怎樣在2014b版本中得到這兩個輸出'mserRegions&mserConnComp'。請回答這個問題。 –

+0

@RaeesKhan,使用'conComp = bwconncomp(I)' – user1449456