Process Depth Image taken from a perspective vision sensor

Typically: "How do I... ", "How can I... " questions
Post Reply
zhy149
Posts: 132
Joined: 14 Apr 2021, 20:18

Process Depth Image taken from a perspective vision sensor

Post by zhy149 »

Hello Coppelia,

I've taken an image from the top view to a table, and there are some cubes on the table. I want to get a pure 2d image only with their top faces appearing in the image, but with a perspective vision sensor their side faces appear as well (I need to use a perspective vision sensor). I don't know if I should use depth image segmentation or something else to deal with this case. Also, I've tried the simxGetVisionsensorDepthBuffer function, but it seems my buffer is empty. Could you give me some suggestions?
Thank you very much!

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: Process Depth Image taken from a perspective vision sensor

Post by fferri »

Perhaps depth info is disabled in the object properties of the vision sensor? Or objects are not renderable?

zhy149
Posts: 132
Joined: 14 Apr 2021, 20:18

Re: Process Depth Image taken from a perspective vision sensor

Post by zhy149 »

fferri wrote: 29 Jul 2021, 15:41 Perhaps depth info is disabled in the object properties of the vision sensor? Or objects are not renderable?
Hi fferri,

Thank you! I changed the mode to blocking and now it works, is this normal? Another question is that for my image 512*512, the buffer length is also 512*512, this makes sense. But I don't quite understand what this buffer means, is it one row by one row stacking all the pixels mapped depth to this buffer list? The value is between 0 and 1 so it should be a ratio, what does this ratio mean?
Thank you very much!

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: Process Depth Image taken from a perspective vision sensor

Post by fferri »

Exactly, the buffer is the sequence of pixels read row by row.

Values are normalized between 0...1, however (from sim.getVisionSensorDepthBuffer documentation):
sensorHandle: handle of the vision sensor. Can be combined with sim.handleflag_depthbuffermeters (simply add sim.handleflag_depthbuffermeters to sensorHandle), if you wish to retrieve values in meters.

Post Reply