Search code examples
matlabsurf

SURF feature extraction on a dense grid with MATLAB


I would like to use SURF (speed-up robust) features to implement a classification system based on a bag-of-visual-words approach. I have read some papers about the use of a dense grid to extract these features, but I can't find how to use it with MATLAB.

Does anybody know how to do SURF feature extraction on a dense grid with MATLAB?


Solution

  • [nRows, nCols] = size(grayImg);
    STEP = 10;
    colInd = (1 : STEP : nCols)';
    rowInd = (1 : STEP : nRows)';
    [A, B] = meshgrid(colInd, rowInd);
    densePoints = [A(:) B(:)];
    
    [featuresDense, validPointsDense] = extractFeatures(grayImg, densePoints, 'Method', 'SURF');
    figure, imshow(img)
    title('Dense SURF')
    hold on
    plot(validPointsDense)