Mismatch of RGB image and depth image

Typically: "How do I... ", "How can I... " questions
Post Reply
Uio96
Posts: 15
Joined: 09 May 2019, 20:08

Mismatch of RGB image and depth image

Post by Uio96 » 20 Nov 2019, 17:16

Hi there,

Recently, I met a wired problem of mismatch of RGB image and depth image. E.g. I first run my simulation and then when my objects have not FULLY stopped there, I just pause the simulation (to save time). I find that in some cases, a mismatch of RGB image and depth image will occur. I guess the depth image buffer is different from the RGB one, but I do not know the mechanism is behind it.

Does anybody have a good way to deal with this issue? OR I have to wait until all my objects stop moving. My current thought is to set every object static during the simulation so the depth image buffer could be consistent with the RGB one. But I'm not sure if it could be done.

Thanks a lot.

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

Re: Mismatch of RGB image and depth image

Post by coppelia » 21 Nov 2019, 06:43

Hello,

depth and RGB images are acquired at the same time. So you probably are not reading the depth matp and RGB image at the same time. How are you doing this? Inside of a threaded child script?

Cheers

Uio96
Posts: 15
Joined: 09 May 2019, 20:08

Re: Mismatch of RGB image and depth image

Post by Uio96 » 21 Nov 2019, 17:32

Thanks for the reply. In fact, I do not use the Lua script but use the python remote API instead. I do not think it will make a difference if the depth and RGB images are acquired at the same time.

I used function like:
vrep.simxGetVisionSensorImage
vrep.simxGetVisionSensorDepthBuffer

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

Re: Mismatch of RGB image and depth image

Post by coppelia » 27 Nov 2019, 14:15

Sorry about the delay, very busy with the new release...

Yes, this is probably what is happening. If you are using the streaming mode, this shouldn't be the case however.

An alternative would be to acquire both data from within CoppeliaSim, in a script function. Then call that script function from your remote API python client with simxCallScriptFunction.

Cheers

Uio96
Posts: 15
Joined: 09 May 2019, 20:08

Re: Mismatch of RGB image and depth image

Post by Uio96 » 28 Nov 2019, 22:34

Got you. Thank you so much. I figured out another way to solve my problem indirectly.

Post Reply