image - 在 matlab 中加载多个图像 tiff 文件的最快方法是什么?

标签 image matlab

我有一个多图像 tiff 文件(例如 3000 帧)并且想将每个图像加载到 matlab 中(我现在使用的是 2010a)。但是我发现随着帧索引的增加,读取图像需要更长的时间。以下是我现在使用的代码

   for i=1:no_frame;
   IM=imread('movie.tif',i);
   IM=double(IM);
   Movie{i}=IM;    
   end 

还有其他方法可以更快吗?

最佳答案

TIFF-specific syntax list for IMREAD 'Info' 参数如下:

When reading images from a multi-image TIFF file, passing the output of imfinfo as the value of the 'Info' argument helps imread locate the images in the file more quickly.

结合preallocation of the cell array suggested by Jonas ,这应该会加快你的速度:

fileName = 'movie.tif';
tiffInfo = imfinfo(fileName);  %# Get the TIFF file information
no_frame = numel(tiffInfo);    %# Get the number of images in the file
Movie = cell(no_frame,1);      %# Preallocate the cell array
for iFrame = 1:no_frame
  Movie{iFrame} = double(imread(fileName,'Index',iFrame,'Info',tiffInfo));
end

关于image - 在 matlab 中加载多个图像 tiff 文件的最快方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6157606/

相关文章:

mysql - 将 perl 数组返回给 MATLAB

multithreading - MATLAB:多线程和多核之间的区别

python - 通过 Numpy 中的逻辑索引获取矩阵的网格

matlab - 如何使用 MATLAB 矩阵中的值作为索引来确定新矩阵中数据的位置?

java - 在 BufferedImage 上绘制 Image 对象以供以后使用

java - 从 JAX-RS servlet 动态创建图像

css - Internet Explorer 和 Border around Image IN iFrame

android - 位图上的水反射效果

matlab - Matlab中如何使用GPU的共享内存?

java - 尝试读取图像并出现空指针异常