Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

This proggram is for thresholding :

조회 수: 2 (최근 30일)
ATTAR Mehenni
ATTAR Mehenni 2018년 2월 24일
마감: MATLAB Answer Bot 2021년 8월 20일
[n,m]=size(a);
abin=zeros(n,m);
thresh = 90;
for i=1:n
for j=1:m
if (a(i,j)>thresh)
abin(i,j)=0;
else
abin(i,j)=1;
end
end
end
Why, in another example, did I find thresh = 0.1 ( 0 < thresh < 1 )? What's the difference? Thanks

답변 (1개)

Image Analyst
Image Analyst 2018년 2월 25일
I'll fix your formatting this time for you but for next time, read this link
The answer is because the other program wanted 0.1 for a threshold - because they were using a floating point image - and you decided to use 90 because you probably have a uint8 integer image. HOW you go the 90, I don't know, but you can do your whole program more simply with just 2 lines:
thresh = 90;
abin = a <= thresh;
Everything else you have is unnecessary or overly complicated.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by