Memory Usage with Tiff whilst montaging
Show older comments
I have a bout 260 tiff images 94MB each), that I have been montaging. I have used the follwoign tor educe their size. I do shrink them as well so each is viewed at about 10%.
IM1 = impyramid(IM, 'reduce');
although I have a really fast PC (16GB ram), its slows down drastically and takes forever. Previously I was only montaging 50 image, not 260.
Are there anymore tips where I can reduce the memory usage. I do not need the full resolution of the tiffs as Im only looking for large scale variations. Thanks Jason
2 Comments
Geoff Hayes
on 31 Oct 2014
Jason - it would be helpful to show more of your code especially that which is relevant to your problem. Do you read each image from file, one at a time, then reduce it, then do something else? You mention how you were previously montaging 50 images (which presumably was acceptable in terms of processing time).
Also, quantify what you mean by its slows down drastically and takes forever. Does that mean five minutes, fifty minutes, or ..?
Jason
on 1 Nov 2014
Answers (1)
Image Analyst
on 1 Nov 2014
0 votes
The montage function always stitches images together at full resolution, so frequently you will run out of memory if you have more than a few images. I have a request in to the Mathworks for a option where you can subsample or specify an output size. You can submit a request for enhancement to the Mathworks and hopefully this will appear in a future release.
4 Comments
Jason
on 1 Nov 2014
Image Analyst
on 1 Nov 2014
I don't see any reason for it to slow down. You are clearing the axes, and that is the usual culprit, so that's good. I don't see any other reason why it would slow down as the images go on. You might try imresize() instead of impyramid() and see if that helps reduce the time.
Geoff Hayes
on 1 Nov 2014
I seem to recall there being a similar question about performance when you try to update dozens of subplots in a figure - the performance degrades as the code updates subsequent subplots, which is similar to the behaviour that Jason has observed. And if there are 13*20=260 of them, then that could explain the poor performance.
Image Analyst
on 1 Nov 2014
Unless he needs axes (tick marks) and/or annotation (text, arrows, etc.) that is unique for each image, he might be better off just creating a big image canvass (a giant image almost the size of the screen) and just pasting small thumbnail images in using normal indexing methods. I attach a demo for that.
Categories
Find more on Images in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!