help me solve this error detectSURFFeatures

조회 수: 4 (최근 30일)
india king
india king 2016년 3월 12일
편집: Dima Lisin 2016년 3월 13일
i am having following sample code: I = imread('box.jpg'); points = detectSURFFeatures(I);
imshow(I); hold on;
plot(points.selectStrongest(10));
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.

채택된 답변

Dima Lisin
Dima Lisin 2016년 3월 12일
편집: Dima Lisin 2016년 3월 12일
detectSURFFeatures only works on grayscale images. Use rgb2gray to convert I to grayscsle.
  댓글 수: 3
india king
india king 2016년 3월 13일
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.
Dima Lisin
Dima Lisin 2016년 3월 13일
편집: Dima Lisin 2016년 3월 13일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Anand
Anand 2016년 3월 12일
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
india king
india king 2016년 3월 12일
it returns uint8.
Should i check for any additional installed packages?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by