MATLAB: DetectSURFFeatures shows error.

Computer Vision Toolboxdetectsurffeatures

Im Using Matlab 2013a version and having a problem when using command:
boxPoints = detectSURFFeatures(boxImage);
Got error
Error using detectSURFFeatures
Expected input number 1, I, to be two-dimensional.
Error in detectSURFFeatures>parseInputs (line 82)
validateattributes(I,{'logical','uint8', 'int16', 'uint16', ...
Error in detectSURFFeatures (line 71)
[Iu8 params] = parseInputs(I,varargin{:});
As I am beginner and trying to use Matlab for Image processing and seeking help from the example available on the following link: http://www.mathworks.com/help/vision/examples/object-detection-in-a-cluttered-scene-using-point-feature-matching.html#btt5qyu

Best Answer

The documentation for detectSURFFeatures states, in part (emphasis added):
"POINTS = detectSURFFeatures(I) returns a SURFPoints object, POINTS, containing information about SURF features detected in the 2-D grayscale input image I."
This indicates that it does not accept RGB images, which would be 3-D (rows-by-pages-by-3 for the 3 color pages.) Convert your image to grayscale before passing it into detectSURFFeatures.