We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to send kinect depth from one computer to create a point cloud on another. I have tried sending the data through OSC, but I'm not sure how to declare it on the receiving end as the depth data is sending as an int[].
This is not my entire code for each side, just what matters to my question to avoid confusion: (hello is what I am trying to send) This is the sender code.
int[] hello;
void draw() {
int[] depth = kinect.getRawDepth();
hello = depth;
}
void OscEvent(OscMessage theOscMessage) {
//create a message with a unique address pattern
OscMessage myOutGoingMessage = new OscMessage( playerAddressPattern );
myOutGoingMessage.add(hello); //send the depth data (as an int string)
osc.send( myOutGoingMessage, destination );
}
This is the applicable code from the receiver
int[] hello;//Declare the depth that is coming in from the kinect
int[] depth = hello; // the actual depth data coming from the remote kinect as the variable "hello"
void OscEvent (OscMessage theOscMessage) {
hello=theOscMessage.get(0).intvalue(); //the value being received is an int[], not an int as i have typed- how do i declare this?
}
So what might help me here is how would i declare that " hello=theOscMessage.get(0).intvalue();" as an int[]
(MacOS High Sierra, Processing 3.0.1)
Answers
You should have continue in your previous post: https://forum.processing.org/two/discussion/25137/how-can-i-stream-my-kinect-feed-from-one-computer-to-another-with-osc#latest
Anyways, I am not an expert on the oscP5 but I think you could try this below. First,send a smaller package between two computers in the same network. Then try increasing the size of the package. Not sure if you have to allow larger packages in your router settings. However, if you start with smaller packages, then you don't have to deal with this issue upfront. I just saw recently in another post that you could use spout, another library that sends textures. Maybe you should look into it as it might be doing some of the data handling for you.
My only question is that if, when you are sending the array package, if it is not being modified by the oscP5 object. I am hoping that the methods implemented in oscArgument would be reverting any changes and allow you to retrieve your raw data.
Kf
Sending an image 480 x 640 in ARGB mode: 4 byes per pixel produces the following error.
### [2017/11/24 22:43:3] ERROR @ UdpClient.send ioexception while sending packet. java.net.SocketException: The message is larger than the maximum supported by the underlying transport: Datagram send failed
The following post discusses about this limit: https://github.com/sojamo/oscp5/issues/6
Notice from the next reference: http://www.sojamo.de/libraries/oscP5/reference/index.html
Kf
Thanks for the replies! I was able to retrieve the depth values as simple digits instead of its weird 11 bit numbers that kinect uses but it does look like its too much data too send over OSC without crashing processing.
Anyhow, once again- Thanks anyway for the help though- much appreciated!