Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在MATLAB中处理多幅图像_Matlab_Image Processing_Video Processing_Image Segmentation - Fatal编程技术网

在MATLAB中处理多幅图像

在MATLAB中处理多幅图像,matlab,image-processing,video-processing,image-segmentation,Matlab,Image Processing,Video Processing,Image Segmentation,我正在对文件夹中的一系列图像(大约100幅)执行一些图像分割/处理。这些图像实际上是从视频中分离出来的帧 所以无论我在做什么都是有效的,但是处理所有的图像需要很长时间。有没有其他方法可以加快这个过程 这是如何做到的: (1) 在单元阵列中加载图像 (2) 检查单元阵列,取出每个图像并将其发送到相应的函数 (3) 显示返回的文件 谢谢 我就是这样做的: A = size(handles.sortedImage_depth); tic for k = 1: A(1,1) handles.dept

我正在对文件夹中的一系列图像(大约100幅)执行一些图像分割/处理。这些图像实际上是从视频中分离出来的帧

所以无论我在做什么都是有效的,但是处理所有的图像需要很长时间。有没有其他方法可以加快这个过程

这是如何做到的: (1) 在单元阵列中加载图像 (2) 检查单元阵列,取出每个图像并将其发送到相应的函数 (3) 显示返回的文件

谢谢

我就是这样做的:

A = size(handles.sortedImage_depth);
tic

for k = 1: A(1,1)

handles.depth_img =       imread(fullfile(handles.myFolderdepth,handles.sortedImage_depth{k})); %loads one depth image

handles.color_img = imread(fullfile(handles.myFoldercolor,handles.sortedImage_color{k})); %loads one color image

[unRGB, unDepth] = undistort(handles.color_img,handles.depth_img);%undistorts the depth n color
[mapped_depth] = depth_mapping(unDepth); %Maps the depth images to a bigger Resolution
handles.depth_mapped{k} = mapped_depth; %saves the resulting images in a cell array

[coordinates] = segmentation(handles,unRGB); %performs image segmentation on RGB

handles.allcoordinates = coordinates;
EE{k} = handles.allcoordinates;
end
EE
toc

如果不知道在每个图像上操作的函数的详细信息,很难说,但是您可以将代码转换为GPU处理(通常更快)。要了解如何将MATLAB代码转换为基于GPU的代码,以下是一些有用的链接:

(告诉MATLAB尝试GPU处理的文件格式)


我能想到的唯一优化方法(使用您提供的信息)是加载每个图像,对其进行处理,然后加载下一个图像,覆盖当前图像。这样,您就不需要将所有图像都保存在内存中,如果它们需要大量内存(磁盘分页),这可能会降低速度。我还想补充一点,使用常规数组而不是单元数组可能会有所帮助。如果看不到你的代码,就很难比它更精确。你的代码与你的描述不匹配。它一次加载一个或两个图像,而不是像您在问题中写的那样一次加载所有图像使用
配置文件运行代码并检查结果。对不起,我的错这是我一小时前做的最后一次更改。我尝试了不同的事情,花的时间也差不多。