Erroe message ..... " not assigned during call to "

조회 수: 1 (최근 30일)
Shivang Patel
Shivang Patel 2015년 2월 18일
댓글: Shivang Patel 2015년 2월 18일
I can't understand, Why this error ? not assigned during call to
Anyone can explain !
My main file.....
for i = 1:d
im = imgData(:,:,i);
bw = binary(im);
im = segmentation(bw);
imtool(im,[]);
end
segmentation.m fucntion code.....
function char = segmentation( bwIMG )
bwImg = bwareaopen(bwIMG,550); %%Remove all object containing fewer than 1 pixels
[label, n]=bwlabel(bwImg); %%Label connected components
if (n == 1)
[r,c] = find(label==n);
n1=bwImg(min(r):max(r),min(c):max(c));
char = imresize(n1,[40 30]);
end
end
Error message in command prompt...
  댓글 수: 2
Stephen23
Stephen23 2015년 2월 18일
Please give us the complete error message, as our mind-reading ability is not so well developed.
Shivang Patel
Shivang Patel 2015년 2월 18일
Sorry, Stephen... I forgot....
I upload a picture... for the error message... this error terminate the for loop in main file...

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

채택된 답변

Michael Haderlein
Michael Haderlein 2015년 2월 18일
Whenever n is not 1, char will not be assigned. What's the purpose of the (n == 1) condition? Possibly it's supposed to be a loop instead so it will assign values to char for every object in your image?
  댓글 수: 1
Shivang Patel
Shivang Patel 2015년 2월 18일
if in image only one object then, I m trying as per above code... And whenever more then one object will detected... i have other procedure... So for that I used if condition...

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by