Page 1 of 1

Save image from Vision Sensor into .png or .npy

Posted: 24 Jul 2021, 23:26
by zhy149
Hello Coppelia,

I'd like to retrieve the image from a vision sensor in the scene and save it into some formats (I may need to look at it later, but these images are for training purposes use mostly). So, I'd like to know how to achieve this both using Python Remote API and in Lua Scripts (using getVisionSensorImage gives me a 1d array(table), so I don't know how to deal with this in Lua and save it into what format is proper).
Thanks a lot!

Re: Save image from Vision Sensor into .png or .npy

Posted: 24 Jul 2021, 23:30
by zhy149
Also, what should I do if I want the image to be saved as a gray scale value?
Thank you!

Re: Save image from Vision Sensor into .png or .npy

Posted: 26 Jul 2021, 10:43
by fferri
sim.getVisionSensorImage gives you the binary image data.

Use sim.saveImage to save the image data to various formats.