Changeset 138


Ignore:
Timestamp:
Jan 14, 2010, 4:14:48 PM (14 years ago)
Author:
(none)
Message:

PPPP - ica

Location:
proiecte/PPPP/ica
Files:
30 added
4 edited

Legend:

Unmodified
Added
Removed
  • proiecte/PPPP/ica/Arch1.m

    r94 r138  
    5858
    5959trainClass = [1:3]';
    60 testClass = [1 2 3]';
     60testClass = [1]';
    6161
    6262%We now compute percent correct:
  • proiecte/PPPP/ica/alignFs.m

    r94 r138  
    2121%TEETH_EYES = %Desired no. of pixels from teeth to eyes.
    2222
    23 XSIZE = 300; YSIZE = 200;     
     23XSIZE = 300; YSIZE = 150;     
    2424EYES = 50;
    2525TEETH_EYES = 80;
     
    6969      %crop a 200x200 window centered on left eye:
    7070      %Zero-pad to make sure window never falls outside of image.
    71       %W = 100; %Window radius
    72       W = 500;  %For bigger images (Gwen's params).
     71      W = 100; %Window radius
     72      %W = 500;  %For bigger images (Gwen's params).
    7373      padcols = zeros(size(tmp0,1),W); padrows = zeros(W,size(tmp0,2)+W);
    7474      padcols = uint8(padcols); padrows=uint8(padrows);
     
    9191      y = W - YSIZE*1/3;  %Face box
    9292      tmp3=imcrop(tmp2,[x,y,XSIZE,YSIZE]);
    93       figure(1); imshow(tmp3);
     93      %figure(1); imshow(tmp3);
    9494
    9595      %save
  • proiecte/PPPP/ica/align_Faces.m

    r94 r138  
    1919%TEETH_EYES = %Desired no. of pixels from teeth to eyes.
    2020
    21 XSIZE = 300; YSIZE = 200;     
     21XSIZE = 300; YSIZE = 150;     
    2222EYES = 50;
    2323TEETH_EYES = 80;
     
    6767      %crop a 200x200 window centered on left eye:
    6868      %Zero-pad to make sure window never falls outside of image.
    69       %W = 100; %Window radius
    70       W = 500;  %For bigger images (Gwen's params).
     69      W = 100; %Window radius
     70      %W = 500;  %For bigger images (Gwen's params).
    7171      padcols = zeros(size(tmp0,1),W); padrows = zeros(W,size(tmp0,2)+W);
    7272      padcols = uint8(padcols); padrows=uint8(padrows);
  • proiecte/PPPP/ica/nnClassFn.m

    r94 r138  
    1717
    1818
    19 function [testPerf,rankmat,rank] = nnclassFn(train,test,trainClass,answer);
     19function [testPerf] = nnclassFn(train,test,trainClass,answer);
    2020
    2121numTest = size(test,2);
     
    2929[Sdist,nearest] = sort(dists'); %cols of Sdist are distances in ascend order
    3030        %1st row of nearest is index of 1st closest training example
     31
     32disp(Sdist)
    3133
    3234%Create vector with nearest example, and vector with class label.
     
    4345
    4446%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 end
     47%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
    5254
    5355%For FERET test, want probeID (answer), then rank, then matched ID no.,
Note: See TracChangeset for help on using the changeset viewer.