0001 function [] = topTrackStats( filestring )
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 if nargin < 1
0018 error('Must specify a filestring, e.g. ''mat/*-top-track.mat'' or ''mat/20080806-1511-r4-top-track.avi''.');
0019 endnn
0020 end
0021
0022
0023 files = dir(filestring);
0024
0025
0026 d = strfind(filestring,'/');
0027 directory = filestring(1:d(end));
0028
0029
0030 for f = 1:length(files)
0031
0032
0033 d = strfind(files(f).name,'/');
0034 if ~isempty(d)
0035 files(f).name = files(f).name(d(end)+1:end);
0036 end
0037
0038
0039 prefix = strtok(files(f).name,'.');
0040
0041
0042 if exist([directory,prefix,'.mat'],'file')
0043
0044 disp(['Creating top marker statistics for ',directory,prefix,'.mat . . .']);
0045
0046
0047 load([directory,prefix,'.mat'],'top');
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 e = [];
0061 for i = [1 4 5 6 8 9]
0062 x{i} = top.trackF{i}.state';
0063 E = diff(diff(x{i}));
0064 e(i,:) = sqrt(diag(E'*E))';
0065 end
0066
0067
0068
0069 dx = [];
0070 for i = [1 4 5 6 8 9]
0071 x{i} = top.trackF{i}.traj;
0072 dx = [dx; diff(x{i})];
0073 end
0074 dx(find(isnan(dx))) = [];
0075
0076 figure;
0077 subplot(2,1,1);
0078 qqplot(real(dx));
0079 title('Good X coordinate QQPlot');
0080 subplot(2,1,2);
0081 qqplot(imag(dx));
0082 title('Good Y coordinate QQPlot');
0083
0084 disp(['std_x = ',num2str(std(real(dx))),', std_y = ',num2str(std(imag(dx)))]);
0085
0086 keyboard
0087
0088
0089 dx = [];
0090 for i = 1:length(top.trackF)
0091 x{i} = top.trackF{i}.traj;
0092 dx = [dx; diff(x{i})];
0093 end
0094 dx(find(isnan(dx))) = [];
0095
0096 figure;
0097 subplot(2,1,1);
0098 qqplot(real(dx));
0099 title('X coordinate QQPlot');
0100 subplot(2,1,2);
0101 qqplot(imag(dx));
0102 title('Y coordinate QQPlot');
0103
0104 disp(['std_x = ',num2str(std(real(dx))),', std_y = ',num2str(std(imag(dx)))]);
0105
0106 keyboard
0107
0108
0109 end
0110
0111 end