Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way of rendering an asset as invisible to the camera but visible to the bproc.writer.write_coco_annotations? #1066

Open
lolitsjoey opened this issue Feb 14, 2024 · 1 comment
Labels

Comments

@lolitsjoey
Copy link

Describe your feature request

I have an asset that I want to get the bounding box for but I want it to be invisible for the camera/shadows/etc. everything else?

I know I can get round this by rendering twice, once with the asset visible and once with it not, but I have thousands of frames that I only render for 1 sample each anyway (quality is not a focus) so this is effectively doubling my render time.

Cheers for any thoughts?

Describe a possible solution

No response

@lolitsjoey lolitsjoey added the enhancement New feature or request label Feb 14, 2024
@cornerfarmer
Copy link
Member

Hey @lolitsjoey,

sorry for the late response. You could perform some kind of raycasts and check which rays hit the object, similar to https://github.com/DLR-RM/BlenderProc/blob/main/blenderproc/python/camera/CameraValidation.py#L158. With that information you could calculate the bounding box.
Alternatively, you could also sample points on the object surface and project it into the camera plane via bproc.camera.project_points. However, this will not consider for the object being hidden behind other objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants