Best way to vary the threshold value of a greyscale image

조회 수: 4 (최근 30일)
Adam Kelly
Adam Kelly 2019년 11월 7일
편집: KALYAN ACHARJYA 2019년 11월 8일
I have a question to vary the threshold value of a greyscale image. I was thinking of using a for loop so I can vary values from 0.1 to 1 but not sure how to start the loop. Any help would be great

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 11월 8일
편집: KALYAN ACHARJYA 2019년 11월 8일
Let say im is the gray image, assumed you are try to convert gray to binary
% Define all threshold values here, you would like to attempt
th_values=[ ?, ?,...........];
data=cell(1,length(th_values))
for i=1:length(th_values);
data{i}=im2bw(im,th(i));
end
Later call any data{1},data{2},.....compare the results

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by