Dear all,
I have 21 RGB microscopic images located in one folder. I want to apply the Otsu thresholding to each image in the folder (each image has different Otsu thresholding value).
How to make a "for loop" applied to the 21 images?
I tried this code but it finds the threshold value of the first image and applies it to all 21 images.
Any idea?
Meshoo
*****************************************************************
files = dir('*.tif');
for k = 1:(numel(files));
thresh = []; image = imread(files(k).name); thresh = graythresh(image); newImage = im2bw(image, thresh); imwrite(newImage, ['NewImage\', files(k).name,]);
end
Best Answer