How to combine multiple images with different size as one?
Show older comments
Dear All, while the title seems very common, I cannot figure it out yet. My problems is as following: I should read multiple images from net (e.g. using imread()) in a loop, and after doing some modification on each image(e.g. using insertText()), display them together as a single image. For instance,
n = length(LinkNames);
for ci=1:n
I=imread(LinkNames{ci});
I=insertText(I,[10,10], 'Something');
IT(:,:,:,ci)=I;
end
montage(IT)
This works if all images are the same size, unless montage produces a common error, because simply it fails to when images are not the same size (apart from the error in IT). Apparently, there are various ways ranging from subimage, subplot, or user defined functions such as, imdisp. But this is not satisfactory, because subplot and subimage generate some margins and the final single image is not very neat. Another way, is to save images with print(); in this way all images (originally with different size) will be saved with same size. However, print demands the images to be displayed (which again is not favorable sometimes, because user may not want to share each figure with others). Therefore, i will deeply appreciate if anyone could assist me with this problem.
Thanks in advance.
Accepted Answer
More Answers (0)
Categories
Find more on Image Arithmetic 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!