utilities(matlab)

mat2imgcell

function Img = mat2imgcell(D, h, w, fmt)
N = size(D, 2);
Img = cell(N, 1);
for i = 1:N,
    Img{i} = reshape(D(:, i), h, w, (fmt=='gray')*1+(fmt=='color')*3)
end

你可能感兴趣的:(utilities(matlab))