forked from amrut-prabhu/table-tennis-ball-trajectory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
remove_tracking_results.py
30 lines (24 loc) · 1.03 KB
/
remove_tracking_results.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os;
removedCsvCount = 0;
removedPngCount = 0;
removedAviCount = 0;
# Remove all the files generated by the MATLAB code for tracking the table tennis ball
for camNum in [1, 2, 3]:
resultDir = os.path.join('.', 'Videos', 'CAM' + str(camNum));
for file in os.listdir(resultDir):
pathToResult = os.path.join(resultDir, file);
if file.endswith(".csv"):
# Remove the csv file containing tracking coordinates results of a video
os.remove(pathToResult)
removedCsvCount += 1
if file.endswith(".png"):
# Remove the png file containing the averaged background of a video
os.remove(pathToResult)
removedPngCount += 1
if file.endswith(".avi"):
# Remove the png file containing the averaged background of a video
os.remove(pathToResult)
removedAviCount += 1
print("Removed ", removedCsvCount, " csv files");
print("Removed ", removedPngCount, " png files");
print("Removed ", removedAviCount, " avi files");