Changeset 138
- Timestamp:
- Jan 14, 2010, 4:14:48 PM (14 years ago)
- Location:
- proiecte/PPPP/ica
- Files:
-
- 30 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
proiecte/PPPP/ica/Arch1.m
r94 r138 58 58 59 59 trainClass = [1:3]'; 60 testClass = [1 2 3]';60 testClass = [1]'; 61 61 62 62 %We now compute percent correct: -
proiecte/PPPP/ica/alignFs.m
r94 r138 21 21 %TEETH_EYES = %Desired no. of pixels from teeth to eyes. 22 22 23 XSIZE = 300; YSIZE = 200;23 XSIZE = 300; YSIZE = 150; 24 24 EYES = 50; 25 25 TEETH_EYES = 80; … … 69 69 %crop a 200x200 window centered on left eye: 70 70 %Zero-pad to make sure window never falls outside of image. 71 %W = 100; %Window radius72 W = 500; %For bigger images (Gwen's params).71 W = 100; %Window radius 72 %W = 500; %For bigger images (Gwen's params). 73 73 padcols = zeros(size(tmp0,1),W); padrows = zeros(W,size(tmp0,2)+W); 74 74 padcols = uint8(padcols); padrows=uint8(padrows); … … 91 91 y = W - YSIZE*1/3; %Face box 92 92 tmp3=imcrop(tmp2,[x,y,XSIZE,YSIZE]); 93 figure(1); imshow(tmp3);93 %figure(1); imshow(tmp3); 94 94 95 95 %save -
proiecte/PPPP/ica/align_Faces.m
r94 r138 19 19 %TEETH_EYES = %Desired no. of pixels from teeth to eyes. 20 20 21 XSIZE = 300; YSIZE = 200;21 XSIZE = 300; YSIZE = 150; 22 22 EYES = 50; 23 23 TEETH_EYES = 80; … … 67 67 %crop a 200x200 window centered on left eye: 68 68 %Zero-pad to make sure window never falls outside of image. 69 %W = 100; %Window radius70 W = 500; %For bigger images (Gwen's params).69 W = 100; %Window radius 70 %W = 500; %For bigger images (Gwen's params). 71 71 padcols = zeros(size(tmp0,1),W); padrows = zeros(W,size(tmp0,2)+W); 72 72 padcols = uint8(padcols); padrows=uint8(padrows); -
proiecte/PPPP/ica/nnClassFn.m
r94 r138 17 17 18 18 19 function [testPerf ,rankmat,rank] = nnclassFn(train,test,trainClass,answer);19 function [testPerf] = nnclassFn(train,test,trainClass,answer); 20 20 21 21 numTest = size(test,2); … … 29 29 [Sdist,nearest] = sort(dists'); %cols of Sdist are distances in ascend order 30 30 %1st row of nearest is index of 1st closest training example 31 32 disp(Sdist) 31 33 32 34 %Create vector with nearest example, and vector with class label. … … 43 45 44 46 %get rank = %correct in top N: 45 cumtestPerf=0;46 for i = 1:3 47 rankmat(:,i) = trainClass(nearest(i,:)');48 correcti = find( (rankmat(:,i) - answer == 0));49 cumtestPerf = cumtestPerf + size(correcti,1) / size(answer,1);50 rank(i) = cumtestPerf;51 end47 %cumtestPerf=0; 48 %for i = 1 49 % rankmat(:,i) = trainClass(nearest(i,:)'); 50 % correcti = find( (rankmat(:,i) - answer == 0)); 51 % cumtestPerf = cumtestPerf + size(correcti,1) / size(answer,1); 52 % rank(i) = cumtestPerf; 53 %end 52 54 53 55 %For FERET test, want probeID (answer), then rank, then matched ID no.,
Note: See TracChangeset
for help on using the changeset viewer.