Effacer les filtres
Effacer les filtres

Best way to vary the threshold value of a greyscale image

3 vues (au cours des 30 derniers jours)
Adam Kelly
Adam Kelly le 7 Nov 2019
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

Réponses (1)

KALYAN ACHARJYA
KALYAN ACHARJYA le 8 Nov 2019
Modifié(e) : KALYAN ACHARJYA le 8 Nov 2019
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

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by