Image analysis with 688x520 images works, but same program produces nonsense for 1101x832 images
1 view (last 30 days)
Show older comments
Hi, I wrote a matlab program for the analysis of a folder full of images (all identical size and format). I load all images and then process them one after the other in a for loop. For 688x520 pxls images everything works well, but when I apply the program on 1101x832 pxls images, it returns different values than when I load every image individually (without the loop). Here is my code:
folder='D:\...';
%read in all images from folder
filePattern = fullfile(folder, '*.bmp');
bmpfiles=dir(filePattern);
numfiles=length(bmpfiles);
for i=1:numfiles
a{i}=importdata(bmpfiles(i).name);
end
for i=1:numfiles
% convert to gray scale
a_gray=rgb2gray(a{i});
% Rest of the image analysis
%...
%...
end;
5 Comments
Geoff Hayes
on 18 Dec 2014
Shan was a typo. If you are convinced that your code works for all single images, then you may need to post more of your code. Also, how do you call the processing on a single image? Do you gave a separate function for this?
Answers (1)
Thorsten
on 17 Dec 2014
Maybe there are some variables set from your first analysis. Use
clear
and rerun your second analysis.
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!