Permalink
Browse files

Refactor depth to z conversion in Gaming zone

  • Loading branch information...
1 parent 8de9b0d commit f1c6833aa652dc31bdec13e8dce44c742d5ce07e @dblanchet committed Mar 14, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 kinect_gui.py
View
@@ -499,13 +499,16 @@ def draw(self, ctx):
ctx.set_source_rgb(0.0, 0.7, 0.0)
for foot in self._feet:
x, _, d = foot[0]
- z = 450 - self._kinect.depth_to_cm(d)
+ z = self.depth_to_pixel(d)
ctx.move_to(x, z)
for x, _, d in foot[1:]:
- z = 450 - self._kinect.depth_to_cm(d)
+ z = self.depth_to_pixel(d)
ctx.line_to(x, z)
ctx.stroke()
+ def depth_to_pixel(self, d):
+ return int(450 - self._kinect.depth_to_cm(d))
+
class KinectTestWindow(gtk.Window):

0 comments on commit f1c6833

Please sign in to comment.