cl;
Par = Parameter_Value;
Par = Image_Intiail_Data(Par);
%% Kalman filter Intialization
TrackList = multiple_PDAF_Init_Track(Par);
%TrackList.coalesence = zeros(Par.TrackNum,Par.TrackNum);
%%
Options.upright=true;
Options.tresh=0.0001;
for k=2:Par.nframes,
Par.k=k;
I2=imread(Par.s_frames{k});
% Get the Key Points
if(Par.FAST)
Ipts22=FAST_SURF(I2,Options);
else
Ipts22=OpenSurf(I2,Options);
end
% select some of the features in the 2*bounding box
% the variagle is the current Data
[Ipts2 DataList] = selec_some_features(Ipts22,Par);
% select descriptors in the bounding box
% Put the landmark descriptors in a matrix
D2 = reshape([Ipts2.descriptor],64,[]);
TrackList = Feature_Track_Association(TrackList,DataList,Par);
TrackList = Track_Update(TrackList,DataList,Ipts2,Par);
multiple_PDAF_Show(TrackList,DataList,Par,Ipts2);
Par = BoundingBox_Update(TrackList,Par);
% pause;
if(k<10)
saveas(gca, [Par.sav_path '\00' num2str(k) '.jpg' ]);
elseif(k<100)
saveas(gca, [Par.sav_path '\0' num2str(k) '.jpg' ]);
else
saveas(gca, [Par.sav_path '\' num2str(k) '.jpg' ]);
end
for i=1:Par.TrackNum,
Trajectory(:,i,k)=TrackList.TrackObj{i}.x([1,3]);
end
end