Repository navigation
Preprocessing
Given videos we need to extract frames, this is done via ffmpeg. Source: frame extraction using ffmpeg
ffmpeg -i inputfile.avi -f image2 %3d.ppm
Run /preprocessing/creating frames/main.m specifying folder with videos and the folder where the frames should be created.
- detect head in each of the first 10 frames. Number of detections per frames can be bigger than 1.
- filter detections
- track each detection using TLD famework.
- assign to each detection it's own weight and a label, if tracked detection coincide with the current one merge their label and add 1 to their weight.
- best trajectory is chosen as the one having the highest weight.
- track the best trajectory until the beginning and until the end to get full trajectory.
All files are in the folder:
cd /home/ibogun2010/Code/interaction-recognition/preprocessing/head detection/face-release1.0-basic
This detects heads (step 1)
detectFaces.m. This should return a cell array headDetectedTrajectories.
Filtering and further post-processing are in the directory cd /home/ibogun2010/Code/OpenTLD/TrackingHeads. Run filterDetectionsWhichOvelapTooMuch.m to delete static detections and the ones which are below the torso point ( script uses output from the previous step, for convenience the data is saved in headDetectionsAllLowThreshold.mat file). Result is the cell array filteredAllDetections . This finishes step 2.
Run main.m to finish steps 3 and 4. This will give indices of the 'good' detections. Using good detections
we can initialize the tracker and track it both directions. trackingProcessedDetections.m is doing just that, it takes detections using output of the main.m ( detections[good indices] ) and tracks it both direction.
Some trajectories might contain NaN, so we post-process them using postProcessTrajectories.m to get clean trajectories.
Firstly, cd /home/ibogun2010/Code/interaction-recognition/object. This will calculate objectPosition array which contains approximate localization of the object in the video. Then run prepareLocalizationPairs to get arrays 'object' and 'objAbsent'.
To get respective position run calculateImageDifferences this will also plot the results.
Finally run finalizeLocalization.m to get final objects.