MATLAB Answers


help me solve this error detectSURFFeatures

Asked by india king on 12 Mar 2016
Latest activity Edited by Dima Lisin
on 13 Mar 2016
i am having following sample code: I = imread('box.jpg'); points = detectSURFFeatures(I);
imshow(I); hold on;
i am getting this error:
Error using detectSURFFeatures
Expected input number 1, I, to be two-dimensional.
Error in detectSURFFeatures>parseInputs (line 130) validateattributes(I,{'logical', 'uint8', 'int16', 'uint16', ...
Error in detectSURFFeatures (line 81) [Iu8, params] = parseInputs(I,varargin{:});
Error in Untitled3 (line 2) points = detectSURFFeatures(I); pls help me solve this.


Sign in to comment.


No tags entered yet.

2 Answers

Answer by Dima Lisin
on 12 Mar 2016
Edited by Dima Lisin
on 12 Mar 2016
 Accepted Answer

detectSURFFeatures only works on grayscale images. Use rgb2gray to convert I to grayscsle.


the image is already in grayscale
thank you.It worked. although the image was in grayscale i had to convert it once againg using rgb2gray fn and the code works now.
It is about the size. The image may look gray, but if its size is MxNx3, it is still RGB, as far as function is concerned.

Sign in to comment.

Answer by Anand
on 12 Mar 2016

What does class(I) return? If it does not return one of the following, your image is not of the right type:
'logical', 'uint8', 'int16', 'uint16', 'single', 'double'

  1 Comment

it returns uint8.
Should i check for any additional installed packages?

Sign in to comment.