Rev | Line | |
---|
[138] | 1 | %function C = loadFaceMat(imgdir); |
---|
| 2 | % |
---|
| 3 | %Loads a directory of images into the rows of C. |
---|
| 4 | %imgdir is a string with the path to the directory containing the images. |
---|
| 5 | %For example: |
---|
| 6 | %imgdir = 'C:\Documents and Settings\Marian Bartlett\My Documents\TestDir\AlignedFaceImages\' |
---|
| 7 | |
---|
| 8 | function C = loadFs(imgDir); |
---|
| 9 | |
---|
| 10 | cd (imgDir) |
---|
| 11 | r = dir; |
---|
| 12 | |
---|
| 13 | C = []; |
---|
| 14 | for i = 3:(size(r,1)) |
---|
| 15 | t = r(i).name; |
---|
| 16 | I=imread(t); |
---|
| 17 | tmp=mat2gray(double(I)); |
---|
| 18 | tmp = reshape(tmp,1,size(tmp,1)*size(tmp,2)); |
---|
| 19 | C = [C;tmp]; |
---|
| 20 | end |
---|
| 21 | |
---|
Note: See
TracBrowser
for help on using the repository browser.