Hi...I got some issue here,i get "undefined function or variable matlab 'sout'. The first class assignment to a local variable determine its class"

I keep trying to solve but still can't. Some buddy can help me solve this? I appreciate your advice !

 채택된 답변

t0 = 60;
imgmin = 0;
imgmax = 0;
imgmin = min(img(:));
imgmax = max(img(:));
th = t0 + (imgmin + imgmax)./2;
sout = zeros(size(img));
sout = img > th;

추가 답변 (1개)

Replace the whole function contents with this:
t0 = 60;
threshold = t0 + (max(img(:)) + min(img(:))) / 2;
sout = img > threshold;

댓글 수: 1

thanks for your reply, but it still no work. It come out the threshold variable issue.

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

카테고리

도움말 센터File Exchange에서 Printing and Saving에 대해 자세히 알아보기

제품

질문:

2016년 5월 23일

댓글:

2016년 5월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by