Indexing cannot yield multiple results

조회 수: 1 (최근 30일)
bkshn
bkshn 2015년 2월 19일
댓글: Guillaume 2015년 2월 19일
Hello I use size function on image 466*700*3 unit8 .
[xm ym zm]=size(Main);
but I see this error
Indexing cannot yield multiple results.
Could you help me?
Thanks

답변 (2개)

dpb
dpb 2015년 2월 19일
Clearly Main must be something other than a 3D array at this time or you've aliased size or somesuch.
What does
whos Main
return? If that doesn't clarify things, then
which size
and/or
clear size
and try again.

Image Analyst
Image Analyst 2015년 2월 19일
In addition to dpb's suggestions, which will probably fix it. You got the names wrong. The first dimension returned by size() is the y dimension (rows), not the x dimension. Thinking that the order x,y is the same as row,column is a very common error. So use one of these calls
[rows, columns, numberOfColorChannels] = size(yourImage);
[ySize, xSize, zSize] = size(yourImage);
but NOT the way you did it.
  댓글 수: 2
dpb
dpb 2015년 2월 19일
In addition to dpb's suggestions, ... You got the names wrong.
Good catch, didn't even notice that--dpb
Guillaume
Guillaume 2015년 2월 19일
Maybe a bit pedantic, but it all depends on your coordinate system. The OP could very well have a coordinate system where x is pointing down and y pointing right.
Probably not.
It's actually a bit of an issue that matlab's documentation (particularly regionprops) doesn't actually specify which coordinate system is in use.

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

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by