MATLAB: Problem with Result Mismatch when image call

diabetic rethinopathyimage callimage processingImage Processing Toolbox

Dear All;
I have written a code for some algo implementation. When I checked the code by giving individual input images, results values are fine. But when I call one by one all 40 images using for loop (as below), results values are different, only 1 image results are same in both approaches.
path_directory='Drive Segmentation Result'; % 'Folder name' tifffiles=dir([path_directory '/*.tif']); for k=5:5 filename=[path_directory '/' tifffiles(k).name]; k1=imread(filename);
direct individual result check one by one providing the complete path directory- I have verified that the call the images are working fine, but strange

Best Answer

Sounds like you're not initializing or resetting some variables at the beginning of each loop iteration.