Hello,
I have bmp images in image folder on my computer.I named it from 1.bmp to 100.bmp .All of them size is 576*768
I read one by one these hundered images.I select rectangular region from all hundred images.Rectangular region's pixel coordinates is changing from 182 to 281 vertically and changing 426 to 639 horizontally.I save graphics which represent pixel values exchange between images in all pixel coordinates in the rectangular region to another file
My m file is below:
pixvalue=zeros(100);
j=1 ;% will represent pixel coordinate sequence
% find pizel coordinates in rectangular region
for y=182:281
for x=426:639
for i=1:100
% read images
s = sprintf('C:\\images\\%d.bmp', i);
A = imread(s);
A=double(A);
pixvalue(i)= A(y,x);
end
s2=sprintf('%d.plot', j);
f=figure('visible','off'),
plot(pixvalue);
xlabel('images');
ylabel('pixvalue');
title(s2);
s3=sprintf('C:\\registration\\%d.bmp', j);
%% save figures as 8 bit bitmap to file
print(f,'-dbmp256',s3);
j=j+1;
end
end
Unfortunately this code have been working vey vey slow!! How can I accelerate it?
Best Regards...