accelerate imread on large images

7 次查看(过去 30 天)
mat
mat 2018-4-26
评论: mat 2018-4-30
hi
is there a way to accelerate imread on large (> 2GB) images?
thanks a lot,
mat
  3 个评论
Ameer Hamza
Ameer Hamza 2018-4-28
Is 2GB size of a single image, or several images together make up 2GB?
mat
mat 2018-4-29
hello Ameer,
just 1 image.
thanks again,
mat

请先登录,再进行评论。

回答(2 个)

Walter Roberson
Walter Roberson 2018-4-29
Not in general.
If the images are TIFF images, then you could get more flexibility about how you read by using the Tiff() class. This will not necessarily reduce total time to read an image, but if it turned out that you only needed part of the image then it would permit you to read it in pieces if it was stored the right way.
If you are using blockproc() then there is an option to process a file instead of a matrix. blockproc() will take advantage of any facilities offered by the type of image to read only a section at a time. In practice this probably means special handling for TIFF but not for much else -- though in theory it might also be able to handle some JPEG images in sections.
  4 个评论
mat
mat 2018-4-30
hi walter, unfortunately i don't have the said toolbox but i really appreciate all your comments !! thanks !
Walter Roberson
Walter Roberson 2018-4-30
You can get an estimate for how long the decoding takes by using timeit() on imread and subtract off timeit of fileread() of the tiff. fileread is not necessarily the fastest possible way to read but it is relatively low overhead.
Just be sure to repeat the tests to account for the fact that the OS might be reading the file into cache, so the first access might be slow.

请先登录,再进行评论。


mat
mat 2018-4-30
timed both on a 4.8gb rgb tiff file. imread - 75sec fileread - 0.3sec !! - resulting in a much smaller size vector ofcourse a lot of decoding and formatting going on..
if only i could efficiently reconstruct the tiff file from the this fileread character vector..

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by