-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
34 lines (25 loc) · 646 Bytes
/
test.py
File metadata and controls
34 lines (25 loc) · 646 Bytes
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
31
32
33
34
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" Alexandre Coninx
Imperial College London, 21/05/2014
"""
import numpy as np
from nite2 import *
import time
# Test code -- print head coordinates of users
NiTE.initialize()
tracker = UserTracker()
tracker.create()
while(True):
f = tracker.readFrame()
for uid in f.getUsers():
user = f.getUserById(uid)
if user.isNew():
print("New user id %d !" % uid)
tracker.startSkeletonTracking(uid)
else:
if user.isVisible():
head = user.getSkeleton().getJoint(JointType.JOINT_HEAD)
print("User {} : {}".format(uid, head.getPosition()))
tracker.destroy()
NiTE.shutdown()