Specific objects in vision sensor

Typically: "How do I... ", "How can I... " questions
Post Reply
dknetz
Posts: 8
Joined: 07 May 2014, 14:23

Specific objects in vision sensor

Post by dknetz » 16 Sep 2014, 15:43

Hi all,

I would like to get a ground truth image (for evaluating a segmentation algorithm) from a vision sensor in vrep that only contains specified objects. I can create such an image by grouping the objects but that also leads to a situation where all objects will move simultaneously. Is there a method to achieve such an image without grouping the objects?

Cheers,
Daniel

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

Re: Specific objects in vision sensor

Post by coppelia » 16 Sep 2014, 23:33

Hello Daniel,

you have several possibilities, depending on what you want to do exactly:
  • you can create a collection with all the objects that your vision sensor should see. In the vision sensor properties, then specify that collection in the Entity to render item.
  • you can download a beta version of release 3.1.3, and there you can specify several different rendering modes for your vision sensor. You can for instance render a scene and retrieve all the object handles of objects that are beeing seen, or you can render objects with auxiliary colors that you can code for your specific need. The user manual of the beta version can be found here.
Cheers

dknetz
Posts: 8
Joined: 07 May 2014, 14:23

Re: Specific objects in vision sensor

Post by dknetz » 17 Sep 2014, 12:27

Hi,

thanks a lot. I will test it as soon as I can!

Cheers,
Daniel

dknetz
Posts: 8
Joined: 07 May 2014, 14:23

Re: Specific objects in vision sensor

Post by dknetz » 17 Sep 2014, 15:25

Hi,

sorry for the double post.

I took option b and replaced my version with the beta V-REP. Actually, I can set the auxiliary color, but if the object is textured, the auxiliary color is mixed with the texture in the camera image. Is it possible to get a clean red or blue object despite texturing?

Cheers,
Daniel

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

Re: Specific objects in vision sensor

Post by coppelia » 18 Sep 2014, 03:38

Hello Daniel,

this is a bug, and will be corrected in next release (3.1.3), out within 2 weeks.

Thanks for pointing this out.

Cheers

schulz
Posts: 1
Joined: 19 Dec 2017, 14:04

Re: Specific objects in vision sensor

Post by schulz » 15 Jan 2018, 10:14

hi,

this is exactly what I was searching for, thanks for that post!
@coppelia: You mentioned the possibility of retrieving all the object handles seen by the vision sensor. Do you have a hint or an example for me how to do that exactly? I'm using V-Rep V3.4.0.

Thanks in advance.

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

Re: Specific objects in vision sensor

Post by coppelia » 15 Jan 2018, 18:42

Hello,

you will have to use a vision sensor with render mode: OpenGL, color coded handles. Then, you can read the image content of that vision sensor with simGetVisionSensorCharImage. Each pixel-triplet (RGB) codes the handle of the object it belongs to. If my memory serves me correctly, something like:

Code: Select all

objectHandle=R+G*256+B*256*256
Cheers

Post Reply