adding multiple images together from a for loop
조회 수: 5 (최근 30일)
이전 댓글 표시
I am trying to adding multiple images together into one in a for loop, but seem to only display the last image. This is what I've tried. Someone please assist me.
E = [];
for i = 1:4
str = int2str(i);
str = strcat('\',str,'.jpg');
str = strcat('C:\Users\ASUSA55V\Documents\MATLAB\images\ur3', str);
im = imread(str);
im = imresize(im,[64 70]);
E = im;
E = E+E(i);
end
imshow(E);
Thanks
댓글 수: 0
채택된 답변
David Sanchez
2013년 7월 19일
Try this out:
E = [];
for i = 1:4
str = int2str(i);
str = strcat('\',str,'.jpg');
str = strcat('C:\Users\ASUSA55V\Documents\MATLAB\images\ur3', str);
im = imread(str);
im = imresize(im,[64 70]);
E = E + im;
end
imshow(E);
댓글 수: 3
David Sanchez
2013년 7월 19일
By the way, what do you want to do? When adding images like that, you will not save the information of the images, you'll add them up and you will end with a very white image.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!