How can I create surface normal image?

Typically: "How do I... ", "How can I... " questions
Post Reply
Posts: 1
Joined: 30 Dec 2019, 18:33

How can I create surface normal image?

Post by seungback »


I am trying to create surface normal-depth image pairs.
Using a depth camera in V-rep, I could successfully create depth scenes.

Now, I'd like to create surface normal images with the same scene of the corresponding depth image, such as

My initial trial was using 'simHandleProximitySensor / sim.handleProximitySensor'.
According to documentation, I can get 'detectedSurfaceNormalVector', but It returns only single detected AND closest surface vector of surface from proximity sensor.
I'd like to access all pixel-wise surface normal vectors from the proximity sensor to create a surface normal image.

Is there any solution for getting all detected surface normal vectors?

Thank you for your help!

Site Admin
Posts: 8189
Joined: 14 Dec 2012, 00:25

Re: How can I create surface normal image?

Post by coppelia »


yes, you can do that. First, make sure that all shapes are detectable. Then, you'll have to use a ray-type proximity sensor, and have it scan over the vision sensor field of view. If your vision sensor is in orthogonal projection mode, this is quite trivial: simply set the vision sensor as parent of the proximity sensor. Then place the proximity sensor at its parent frame origin and with the same orientation as its parent (the vision sensor). Then translate the proximity sensor along its parent frame in the X and Y direction (the step sizes are computed from the vision sensor resolution and the orthogonal view size).
When your vision sensor is in perspective projection mode, the approach is similar, but you'll have to instead adjust the orientation of the proximity sensor during the scan process.


Post Reply