在我之前的问题中,我在Matlab中询问了Blind Deconvolution.
现在我有一个新的问题,我知道如何imread和imwrite作品,但我不知道你在哪里的函数调用从图像文件?换句话说,我在哪里存储图像以便使用它imread?
正如Adam建议你可以将Matlab工作目录更改为图像的位置,或者我倾向于让用户选择要读取的文件uigetfile
>> [fn,pn]=uigetfile({'*.TIFF,*.jpg,*.bmp','Image files'}, 'Select an image');
>> I = imread(fullfile(pn,fn));
Run Code Online (Sandbox Code Playgroud)
或者如果您知道要读取的图像的目录,则可以将其存储在变量中,然后您可以使用该目录中的图像列表 dir
>> imageDir = 'c:\path\to\my\images';
>> imageList = dir(fullfile(imageDir,'*.tif')); % store all files with extension tif
% in a structure array imageList
Run Code Online (Sandbox Code Playgroud)
从那里你可以循环imageList并处理找到的每个图像.最后,您可以使用uigetdir询问用户包含图像集的目录.