Thank you Wayne. Your code works perfectly for single image files.
However, how would I write a loop for this program?
I know that using the: dir(*'jpg') command selects? the images you want to work with.
I changed the names of the images using matlab:
images=dir('*jpg');
names={images.name};
for File=1:numel(names)
newname=sprintf('04%d.jpg',File);
movefile(names{File},newname);
end
If I were to put the following code:
I = imread('cameraman.tif');
I(I<66) = 0;
I(I>66) = 255;
What would I replace the cameraman.tif with in order to have this run in a loop?
Also how would I be able to save these new images because I would like to add these images together once all of the images are filtered?