Home > vis > motion_vs_temp_diff.m

motion_vs_temp_diff

PURPOSE ^

SYNOPSIS ^

function motion_vs_temp_diff(experiment,SS)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function motion_vs_temp_diff(experiment,SS)
0002 
0003 P = initParam('wbc');
0004 % Loop each folder
0005 for seq = 1: length(experiment(exp).sequence)
0006     
0007     trackIds = unique(SS(f).Rich.tracksGT(:,1));
0008     nTracksPerSeq = length(trackIds);
0009     speedsMatrixPerSeq = NaN*ones(nTracksPerSeq, P.MAX_POSITION_PER_TRACK);
0010     speedsMatrixPerSeq(:,1:3) = [f*ones(nTracksPerSeq,1) trackIds 3*zeros(nTracksPerSeq,1)];
0011     
0012     for t = 1: size(speedsMatrixPerSeq,1)
0013         id = speedsMatrixPerSeq(t,2);
0014         gtPos = SS(f).Rich.tracksGT(SS(f).Rich.tracksGT(:,1)==id,[3,4]);
0015         for po = 1: size(gtPos,1)-1
0016             col = speedsMatrixPerSeq(t,3)+4;
0017             speedsMatrixPerSeq(t,col) = sqrt( (gtPos(po+1,1)-gtPos(po,1))^2 + ...
0018                 (gtPos(po+1,2) - gtPos(po,2))^2 );
0019             speedsMatrixPerSeq(t,3) = speedsMatrixPerSeq(t,3)+1;
0020         end
0021     end
0022     
0023     % Loop each sub sequence
0024     for s = 1: size(P.IFOLDERS(seq).Ra,1)
0025         % Loop through each frame in a sub sequence
0026         frStart = P.IFOLDERS(seq).Ra(s,1);
0027         frEnd   = P.IFOLDERS(seq).Ra(s,2);
0028         for fr = frStart: frEnd
0029             % get detection and ground truth positions
0030             dtPositions = wbc.experiment(exp).sequence(seq).frames(wbc.experiment(exp).sequence(seq).frames(:,1)==fr,3:4);
0031             gtPositions = round(SS(seq).GT.tracksGT(SS(seq).GT.tracksGT(:,2)==fr,3:4));
0032             [tpIndex fnIndex fpIndex] = ...
0033                 classify_detection_positions( dtPositions, gtPositions, P.MATCH_DISTANCE);
0034             
0035             % Get classified positions
0036             tpPositions = dtPositions(tpIndex,:);
0037             fnPositions = gtPositions(fnIndex,:);
0038             fpPositions = dtPositions(fpIndex,:);
0039             
0040         end
0041     end
0042     
0043 end

Generated on Thu 17-Mar-2011 14:45:51 by m2html © 2005