xviz
xviz copied to clipboard
Converting data and live streaming
Hello. Can you help me to understand how I can convert my files to xviz? What do I really need to have? For example, I have jpeg photos from my stream, I also know a timestamp of each img. But it looks very difficult to do the same work as with kitti.
I can't understand if its enough to do what I want, maybe I need to add more information about my images. And do I need to use timestamp somewhere?
var img = new Uint8Array(msg.jpeg);
var timestamp = msg.timestamp;
const xb = xvizMetaBuilder;
xb.stream(channel_name)
.category('primitive')
.type('image');
xvizBuilder
.primitive("camera")
.image(img, 'png')
.dimensions(info.width, info.height);
Also, I want to get photos from my stream(I use ZeroCM for it) and send them to xviz without saving. Can I do it? I read a lot of issues and, as far as I understand, we need file .json with all timestamps. Is it true?
Then I saw that now we have XVIZ server for Python. Do you think it's easier to do my work using Python instead of JS?
Thank you for your attention.
@ElenaStrashko
If you are using python, you can create channel name for camera image
builder.stream("/camera/0").category(xviz_avs.CATEGORY.PRIMITIVE).type(xviz_avs.PRIMITIVE_TYPES.IMAGE)
Next you can stream it. Please note that img
must shouldn't be a numpy uint8 array. It should be bytes.
You can convert numpy to bytes simply using img = img.tobytes()
where img is WxHx3 uint8 array initially.
builder.primitive('/camera/0').image(img).dimensions(w, h)
You may find this example useful.