Resolve "Merge doesn't delete already merged person from further evaluation"
requested to merge 274-merge-doesn-t-delete-already-merged-person-from-further-evaluation into master
There was an error, where a person, who was already deleted because they were merged with another, still got evaluated. During this evaluation, the person which got the index of the deleted one got processed, or a segmentation fault happened, when the deleted person was the last one.
This is fixed by setting mStatus
to not only signal not being tracked, but also, already being merged away.
Steps to reproduce
This happens with trajectories, where:
- The lower index is the traj that survives the merge
- Both trajecories where already trackd at that frame
- Both trajectories get retracked
(Note: The 3rd one could be annoying in using merge
, since without retracking, no merging occurs; could be resolved with #261 )
So how to achieve that?
- Use complete trajectory vs a fake one in the middle of the video (e.g. real Frame 0 - 300, fake 150 - 160)
- Track both points without merge for a while and go back to the middle of the tracked trajectories
- Set the retack below quality to 100 and use the color marker
One also probably needs to comment out the logic which disabled retracking if inefficient in Tracker::calcPrevFeaturePoints
:
/*
* For retracking to occur, every point in the path from the last
* recognized point to this point should have been tracked with higher qual.
* This should eliminate cases in which wrong points are tracked confidently
* and replace better ones, under the assumption we only get to a wrong point
* due to a low-quality tracking earlier.
*/
bool applyReTrack = reTrack;
// if(reTrack)
// {
// int dir = (frame - prevFrame); // direction of tracking - forward/backwards
// dir /= std::abs(dir); // theoretically possible to omit MAX_STEP_TRACK frames
// constexpr int minQualReco = 90;
// for(int j = 0; person.trackPointExist(frame + j * dir) &&
// person.trackPointAt(frame + j * dir).qual() < minQualReco;
// ++j)
// {
// if(person.trackPointAt(frame + j * dir).qual() < reQual)
// {
// applyReTrack = false;
// break;
// }
// }
// }
if(person.trackPointExist(frame) && !applyReTrack)
{
continue;
}
Closes #274 (closed)