faceData2ds
Convert face data to a dataset of the standard format
Contents
Syntax
- DS=faceData2ds(faceData)
- DS=faceData2ds(faceData, faceNumPerPerson)
Description
DS=faceData2ds(faceData) converts a structure array faceData to a dataset of the standard format.
DS=faceData2ds(faceData, faceNumPerPerson) limits the face number per person.
Example
imageDir=[mltRoot, '/dataSet/att_faces(partial)']; opt=fileList('defaultOpt'); opt.extName='pgm'; opt.mode='recursive'; faceData=fileList(imageDir, opt); fprintf('Reading %d face images from %s...', length(faceData), imageDir); tic for i=1:length(faceData) % fprintf('%d/%d: file=%s\n', i, length(faceData), faceData(i).path); faceData(i).image=imread(faceData(i).path); end fprintf(' ===> %.2f sec\n', toc); DS=faceData2ds(faceData); fprintf('Display DS...\n'); disp(DS);
Reading 100 face images from D:\users\jang\matlab\toolbox\machineLearning/dataSet/att_faces(partial)... ===> 0.12 sec Display DS... input: [10304×100 double] outputName: {'s1' 's10' 's2' 's3' 's4' 's5' 's6' 's7' 's8' 's9'} output: [1×100 double] annotation: {1×100 cell}