point cloud to osc

hey i’m looking for a way to package the pointcloud values from the kinect and stream them via osc.
i’d like to know where to get the x, y, z values out of the kinect top, how to simplify the amount of say 100, and how to convert those to osc values, packing options etc?

1 Like

The kinect pointcloud TOP is 1920x1080 pixels (which would mean ~6 million channels over OSC for R, G, and B), so you’ll need to reduce the resolution first with a Resolution TOP or Crop TOP.

Then use a TOP to Chop to get a graph of all the pixel values.
Add a Shuffle Chop set to “Split all Samples” to get a separate channel for every pixels’s R, G and B value.

Here’s a demo using a 256x256 Ramp TOP as input, which is reduced to a 5x5 TOP, which makes 75 OSC channels in the end. Depending on the app that will do the receiving, you’ll maybe need to do additional sorting of the channels before you send it over OSC.
TOP-to-OSC.toe (4.76 KB)

great - got my head round this no probs! now i need to prefix a name to all outgoing osc messages to be picked up in the machine learning software - wekinator…
wekinator.JPG

You can use the Rename Chop for this. Place it before your Osc Out Chop.

To add a prefix to all your channels you can use these values:

From: *
To: /wek/*

yeah cool, nothing coming out of TD tho - using osc-monitor to listen

Turn off your firewall

makes no difference. i did try with one of the processing to wekinator examples. it reads everything coming out of that ok…

wekinator can see if the port is open or not (like it isn’t when OSC-monitor is listening) but no data flowing. i put an lfo on the phase of the ramp for stuff to happen…

This should be quite easy to solve. I can guarantee you that the OSC Out Chop really works :wink: , so either something is blocking the traffic, or it is send to the wrong place.

  • Double check the address & port in your sending & receiving application.
  • double check any firewall or other antivirussoftware which blocks ports (but you said you did that already)

Also place a OSC IN Chop in your network next to the OSC Out, to see if you can receive the network traffic ok.

hmmm ok i had to do a load of other stuff this week (life!) but it did read itself…
not sure how these other programs are reading it but i don’t think they’re expecting anything silly like osc bundles…

here’s the link to code that works… the leap motion for processing
wekinator.org/examples/

i’ll try and break open the code and read it into something useful like puredata when i get a chance…

I’m also have same problem: Wekinator doesn’t recive OSC from TD, but recive from some of the other apps.
So, to discover more, I’ve used a OSCIn DAT unstead of CHOP and recieve dat both from OSCOut CHOP and from app that works, and here it is:

So, Wekkinator understands OSC in format like this: /wek/inputs ,ff 186 472
where all values goes in one row, while TouchDesigner sends every channel in new row:

/wek/inputs1 ,f 186 /wek/inputs2 ,f 472

I didn’t figure out yet how to make TD sends OSC in single-row format. Can anyone help?

How are you sending? Python should allow you to do that…

op().sendOSC(‘/wek/inputs’,[186,472])

I’m not good with Python. I’ve tried ChopExec with

def valueChange(channel, sampleIndex, val, prev): chans = op('chans')[0,0] fs = op('fs')[0,0] vals = [',', fs, chans] op('oscout1').sendOSC('/wek/inputs', vals) return
And result is like /wek/inputs “,” “fff” "0.19109 -0.09557334 -0.05238229

What I need is /wek/inputs ,fff 0.19109 -0.09557334 -0.05238229 or
/wek/inputs ,letter “f” repeats as many time as number of channels values from all channels of CHOP as floats

sendOSC actually builds those data type tags (the ‘f’s) for you, so just sendOSC(’/wek/inputs’, chans) should do it, if chans is the list of data you want to send.

To see exactly what you’re sending, set up an oscInDAT to listen to your out and be sure to have the Include Type Tag set to True.

Thank you. After some changes I finally made it works, so I end up with component adaptive to CHOP with any number of chanels.
In case if someone else need it, here it is:

WekinatorOSC.tox (4.67 KB)

PS: Unfortunately, it works really slow if you have more than 50-100 chanels, don’t know what to do with it

This works brilliantly, thanks a lot!

Does anyone know how I can activate the dynamic time warping in Wekinator from within Touch?
If I got this figured out it would help me a lot with this project I’m working on!

Thanks in advance.

Hey exsstas,
thanks for sharing your Wekinator OSC network.
Today I had a look at it, and changed few things.

It’s still a resource hogger, but now it seems a bit more efficient and faster.

I’m sure there’s a better way of building this altogether, but at the moment I can send out a larger amount of channels with this V2 if you want to try it out.
WekinatorOSC_V2.toe (6.6 KB)