summaryrefslogtreecommitdiffstats
path: root/data/face-detection-accuracy.py
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2012-02-16 20:01:38 -0800
committerThibaut Horel <thibaut.horel@gmail.com>2012-02-16 20:01:38 -0800
commitbd120ec757d0a8905e6a9bd2ebe8ebbf9d0c124d (patch)
tree87469a60e7aab7adcf2647b17bd8a7614e519c8b /data/face-detection-accuracy.py
parentea0d56250051f1e5d5db3e6b6fe3a38e8fc07177 (diff)
downloadkinect-bd120ec757d0a8905e6a9bd2ebe8ebbf9d0c124d.tar.gz
Plot of accuracy as a function of the distance. Will finish this at home.
Diffstat (limited to 'data/face-detection-accuracy.py')
-rwxr-xr-xdata/face-detection-accuracy.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/data/face-detection-accuracy.py b/data/face-detection-accuracy.py
new file mode 100755
index 0000000..ad43a2f
--- /dev/null
+++ b/data/face-detection-accuracy.py
@@ -0,0 +1,16 @@
+#!/usr/bin/python
+import matplotlib.pyplot as plt
+import matplotlib.mlab as ml
+import numpy as np
+import sys
+
+face_filename = sys.argv[1]
+data = ml.load(face_filename,delimiter=",",usecols=[3,4])
+distance_detected = [float(distance) for (distance,detected) in data if int(detected)>0]
+distance = [float(distance) for (distance,detected) in data]
+range = (min(distance),max(distance))
+hist_detected,bins = np.histogram(distance_detected,bins=30,range=range)
+hist,bins = np.histogram(distance, bins=30, range=range)
+result = hist_detected*1./hist
+plt.bar(bins[1:],result,width=np.diff(bins)[1])
+plt.show()