getdata.m in pca_ann.rar
Sponsored links
function [data , targets , arity] = getdata(dir,to,po_emo_flag)
%------------------------------------------------------------
% [data , targets , arity] = getdata(dir,to,po_emo_flag)
%
%
% Returns data(images) in column-wise form accompanied by the
% corresponding target values.
% ->arity = number of columns in data(substantially: how many images)
% ->dir = directory
% ->to = a 1x2 vector that defines the maximum and minimum target values
% In order to have faster convergence when sigmoid function is used
% we prefer 0.9 or less instead of 1 in target values and 0.1 or
% more instead of 0.
% ->po_emo_flag = the kind of classification (0=pose, 1=emotion)
%
% Algorithm:
% Create data matrix with an image per column and based on the
% name of each image filename create the corresponding matrix
% with a target per column. Also return #of images as it might be useful
%
% ------------------/* Avraam Kasapis 2003 *\------------------
filenames = filevector(dir);
jlen = length(filenames);
%Read the size of the first image
[x y]= size(imread(filenames{1}));
data = zeros(x*y,jlen);
for i = 1:jlen
temp = imread(fil
...
...
... to be continued.
This is a preview. To get the complete source file,
please click here to download the whole source code package.