Snappy compression

/package-repositories “D:\vvvv\vl-libs” file located as you suggested above

looks legit, not sure what’s going on there.
so i created a nuget for vl.netmq. please try: nuget install vl.netmq -prerelease
hope that works.

For anyone followung this that is nuget install vl.IO.netmq -prerelease

oops, indeed. misspelled. does it work?

KinectDepthToSnappy.vl (41.8 KB)
It does, but I dont know how to turn it back into a mutable array for the decompression!

you simply use ToImage [MutableArray]. but be sure to feed it with the correct width, height and format, otherwise it will crash (this is what happened in the example i sent above).

i think the netmq should output the mutable array directly, i’ve already made an internal issue for this. if you get data from the net, that you have to process further, you almost always need an array instead of a spread.

as a workaround you can use FromSequence [MutableArray], this is another copy of the data but should work until the netmq lib got a design overhaul.

It comes out as a <spread<Spread> but flatten then from sequence seems to work, and I get an image locally! I’ll test on a network tomorrow…

that’s correct, but at least another two copies of the image that get thrown away every frame, try GetSlice with 0, the first spread should contain everything. I just remembered that there is an advanced node called GetInternalArray that kind of hacks the access to the spread data as a mutable array without a copy. you can use it if you only read that data…

Kinect_Network_Sender.vl (47.7 KB)
Ok, that all works :) according to Task manager 1 depth map is 80 Mbs, and the sender is running on a latte panda alpha which has an m3 7y30 cpu, which makes multiple networked kinects a possibility, there is a little latency, but not too much. Pretty pleased with that!
Thanks for the help @tonfilm and @joreg

2 Likes

horray, good to hear!

Heya @catweasel, trying this out ATM using latest gamma but I am getting this:

image

Any hints? (Same happens if I try it on latest beta)

Thanks in advance.

VL.Imaging.vl, I think its something VL internal? Maybe a devs question…

yeah I have a feeling something has changed on the dev side

Yes, the image interface changed a little bit. But it should be quite easy to fix. Just have a look into the category.

Image now has “Memory” from which you can retrieve the size and pointer…

Thanks @tonfilm, I did go the ReadOnlyMemory route but am getting an intermitent hiccup every few seconds on a 640x480 RGB video feed at 30FPS, I was hoping I was doing something wrong and the MarshallCopy was the right way. Will need to dig deeper I guess.

The memory should be disposed after usage… Maybe all the video frames pile up and then the garbage collector had to stop the program when things get out of hand.

You can usually spot that as oscillating memory usage in the task manager.

ah good shout @tonfilm, will have a look and report back!

@tonfilm looking at ReadOnlyMemory but I do not see any Dispose-like functionality.

This is what I am currently doing:

image

Any pointers?

You need to dispose the ImageData once you’ve read its content.