Kinect, Python Programing, and More
Paul Miller  [2 posts]
6 years
What I would like to do in the future is possible make, using the Microsoft Kinect, a sound playing device just be depth sensing a Roborealm. I am currently just conquering the big step of being able to set up the ability to detect the body, or possible better, a body part, that as it moves, to hit different key frequencies, not like a slide whistle, but possible implement a keyboard idea and develop farther from there.

Cropping: Is there a better way I can only take the COG from a designated region?

Python: When I would try to use the GetVariable function in Python ""cogX = GetVariable("COG_X")"", I get a ""name 'GetVariable' is not defined
I only have a slight knowledge in Python, not even sure about the other programs.

Exporting Text: Trying many different tactics to get the program to work, I tried just export the COG's coordinates to a .txt file then just using a Python program there, but I could not get the program to work due to my lack of skill
Here is my error filled attempt at that
import fileinput, winsound, sys, string;flup = open('plpp', 'r'); n=flup.readline();p=n.strip();o=p.split();[x,y]=o

if 0<x:
    if x<='100':
    elif x>'100':
        if x<='200':
        elif x>'200':
            if x<='300':
            elif x>'300':
                if x<='400':
If there is any way I could be using the Kinect better, please let me know.
I have also made some comments on each of my steps.


Anonymous 6 years

Cropping: Yes, see the Crop module


Note that you can use something like


in the start and end boxes (literal as typed above) as those fields are processed and interpreted [] signal it as an expression. See


Python: Try

cogX = rr.GetVariable("COG_X")

that's what that

import rr

is for. The rr object is needed to access all the internal RR functions.

Exporting Text: You could also try using the


module to surround a


module and get that to work right in RR ...

Your external python script seems right assuming that newlines got added into the file.


This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index