필터 지우기
필터 지우기

subsindex not defined for values of class vision.EdgeDetector

조회 수: 3 (최근 30일)
Michael
Michael 2012년 7월 30일
댓글: Mateusz Duraj 2019년 1월 11일
New to Matlab...I'm using the computer vision system toolbox to do some edge detection and I then need to convert the Matlab code to C.
I'm trying to follow the example here
Here is my code
hEdge = vision.EdgeDetector('Method','Sobel','EdgeThinning',true);
Iedges = step(hEdge,Image); %Image is a 1274x159 grayscale image.
When I run this I get the error "Function 'subsindex' is not defined for values of class 'vision.EdgeDetector'."
Interestingly if I change my code to
Iedges = hEdge.step(Image);
it works fine. The problem is that I need to convert this code to C using Matlab coder and if I leave the code in this form I get the error
"Dot notation for methods on System objects is not supported for code generation. Pass the object as the first argument to the method instead."
So it seems that in order to be able to compile this code with Matlab Coder I must use the first notation where I pass the argument to the method (as is done in the example I linked). But then I get the subsindex error. Has anybody seen this? Thanks

채택된 답변

Michael
Michael 2012년 7월 30일
Newb mistake here..in my script I had a variable with the name of step. I rename that variable and everything is fine...oops.
  댓글 수: 2
Sean de Wolski
Sean de Wolski 2012년 7월 30일
Please accept this answer to mark the question closed.
Mateusz Duraj
Mateusz Duraj 2019년 1월 11일
OMG, seriously, such solution helped me. I also had "step" variable in my code and wondered why it does not work. I probably wouldn't even think about it. Thank you so much!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by