DLR-RM / BlenderProc

A procedural Blender pipeline for photorealistic training image generation
GNU General Public License v3.0
2.65k stars 438 forks source link

Segmentation mask of reflection #1121

Open cs-mshah opened 1 week ago

cs-mshah commented 1 week ago

Describe the issue

I have an interesting use case: I have a mirror and an object in front of it. I am able to get the rendering and segmentation mask of the scene. But I also want the segmentation mask of the reflection of the object in the mirror. How should I achieve this using blenderproc?

Minimal code example

No response

Files required to run the code

No response

Expected behavior

An additional data key called "reflection" would be beneficial after calling the blenderproc render function. This should contain the mask of the reflection that would be visible in the mirror of the object in front of it.

BlenderProc version

v2.7

cornerfarmer commented 6 days ago

Hey @cs-mshah,

interesting question. This definitely does not work out of the box. You could try to do it similar to how the old segmap renderer worked (https://github.com/DLR-RM/BlenderProc/blob/main/blenderproc/python/renderer/SegMapRendererUtility.py):

However, I am not fully sure this works. It might be that due to the mirror you get blur or not uniform coloring of the object of interest