Hi Alex,
This error comes from a wrong formatting of the truth and track inputs to the object function evaluate().
I am sure you have already read its documentation, but let me try and clarify. Both of these inputs must be an array of structs, and not a single struct with multidimensional data as you have it.
Currently your Tr_ped2_test7 is a scalar struct, and its field Time is a vector of length, say N. Instead you need to have N struct and each will have a field Time which is a scalar value.
And if that is still not clear, I believe this code should convert your current variables to the appropriate format, but of course I would recommend updating your script to construct the variables in this format to being with.
numTracks = length(Tr_ped2_test7.Time);
trackFormat = struct('Time',0,'BoundingBox',[0 0 0 0], 'TrackID',0, 'ClassID',0);
tracks = repmat(trackFormat, 1, numTracks); % tracks is an array of structs
for i=1:numTracks
tracks(i) = struct('Time',Tr_ped2_test7.Time(i),...
'TrackID',Tr_ped2_test7.TrackID(i), ...
'BoundingBox', Tr_ped2_test7.BoundingBox(i,:),...
'ClassID', -1);
end
numTruths = length(GT_ped2_test7.Time);
truthFormat = struct('Time',0,'BoundingBox',[0 0 0 0], 'TruthID',0, 'ClassID',0);
truths = repmat(truthFormat, 1, numTracks); % truths is an array of structs
for i=1:numTruths
truths(i) = struct('Time',GT_ped2_test7.Time(i),...
'TruthID',GT_ped2_test7.TruthID(i), ...
'BoundingBox', GT_ped2_test7.BoundingBox(i,:),...
'ClassID', -1);
end
% Evaluate with correctly formatted inputs
MOTCLEAR = evaluate(tcm, tracks, truths)