## simVision problem

Typically: "How do I... ", "How can I... " questions
lyz
Posts: 30
Joined: 07 Mar 2019, 07:34

### simVision problem

Hi,
I am using CoppeliaSim API to publish kinect depth data. Previously, when I used vrep 3.6.2, image processing was done through the Image processing and triggering to output depth image in GUI. Equivalent to " Work image to output depth image" in Image processing and triggering in vrep. Because the image in vrep has an inverted relationship with the image displayed by rviz, I need to use vertical processing for the image and output depth image.
Since Image processing and triggering function in CoppeliaSim is written in code instead of GUI setting in vrep, the laser and vision model in vrep I built cannot be used, so I need to write image processing code instead, But I noticed that the function was missing: workImg to Depth image in CoppeliaSim.(http://www.coppeliarobotics.com/helpFil ... essing.htm)

Thank you in advance.

Sincerely,

lyz

coppelia
Site Admin
Posts: 7527
Joined: 14 Dec 2012, 00:25

### Re: simVision problem

Hello Lyz,

indeed, that was removed, since we believed that it doesn't really make sense to overwrite the depth buffer of a vision sensor.
In your case, a workaround would be to transform the depth map via sim.transformImage:

Code: Select all

    local depthBuff=sim.getVisionSensorDepthBuffer(inData.handle+sim.handleflag_codedstring)
sim.transformImage(depthBuff,inData.resolution,1+4)
-- here you could publish your depth buffer which has been flipped vertically

But in next revision or release, you'll find simVision.workImgToSensorDepthMap too.

Cheers

lyz
Posts: 30
Joined: 07 Mar 2019, 07:34

### Re: simVision problem

Okay, Many thanks! It really works.

coppelia
Site Admin
Posts: 7527
Joined: 14 Dec 2012, 00:25

### Re: simVision problem

Hello again,

rev3 of release V4.0.0 (available for download now) introduces the missing filter component simVision.workImgToSensorDepthMap

Cheers

lyz
Posts: 30
Joined: 07 Mar 2019, 07:34

### Re: simVision problem

Okay, thanks a lot!