📄 data2im.m
字号:
%DATA2IM Convert PRTools dataset to image%% IM = data2im(A)%% An image, or a set of images stored in the objects or features% of the dataset A are retrieved and returned as a 3D matrix IM.%% See datasets, im2obj, im2feat% Copyright: R.P.W. Duin, duin@ph.tn.tudelft.nl% Faculty of Applied Physics, Delft University of Technology% P.O. Box 5046, 2600 GA Delft, The Netherlandsfunction im = data2im(a)if ~isa(a,'dataset') error('Input should be dataset')endas = struct(a);[m,k] = size(a);[y,x] = dataimsize(a);if isfeatim(a) im = zeros(y,x,k); for j=1:k % walk around Matlab bug aa = +subsref(a,struct('type',{'()'},'subs',{{':' [j]}})); im(:,:,j) = reshape(aa,y,x); endelseif isobjim(a) im = zeros(y,x,m); for j=1:m % walk around Matlab bug aa = +subsref(a,struct('type',{'()'},'subs',{{[j] ':'}})); im(:,:,j) = reshape(aa,y,x); endelse error('No regular image stored')end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -