BlenderProc icon indicating copy to clipboard operation
BlenderProc copied to clipboard

How to get normal map with respect to world coordinate

Open eric-zqwang opened this issue 2 years ago • 3 comments

Describe the issue

I'm wondering how to get the normal map respect to world coordinates. Seems like the enable_normals_output() always get the normal map with respect to camera coordinates.

Minimal code example

No response

Files required to run the code

No response

Expected behavior

Want the normal map be consistent in different viewpoints.

BlenderProc version

2.5.0

eric-zqwang avatar Jul 29 '23 02:07 eric-zqwang

You can use the bproc.camera.get_camera_pose() cam2world transformation matrices to transform the normals from the camera to the world frame.

cornerfarmer avatar Jul 31 '23 11:07 cornerfarmer

Thanks for your help.

One more question is that in order to get normal map corresponding to camera coordinate, I put bproc.renderer.enable_normals_output() when I add camera pose. But I found that this slow down rendering speed when call bproc.renderer.enable_normals_output() multiple times.

Is there any way to solve it? Thanks!

eric-zqwang avatar Aug 01 '23 00:08 eric-zqwang

Why do you call bproc.renderer.enable_normals_output() multiple times? You should only call it once before the rendering

cornerfarmer avatar Sep 20 '23 10:09 cornerfarmer