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

ImageBuffer: prevent additional copy converting from RGBA to RGB #503

Merged
merged 2 commits into from
Oct 1, 2023

Conversation

jnewb1
Copy link
Contributor

@jnewb1 jnewb1 commented Sep 28, 2023

np.astype will perform a full copy of the array, which is very slow for large images (was taking 30ms for a 1920x1080 image). Our application requires grabbing these images in realtime, and this was taking significant portion of the time. You can avoid this copy if the array is contiguous. However, if the texture buffer is RGBA, the array won't be contiguous, so I disabled RGBA in the output texture. This improved the performance of grabbing images from the engine

If RGBA isn't used anywhere else, the frame_buffer_properties can go directly into ImageBuffer as I have it now. If not, perhaps it should go into BaseCamera or RGBCamera, or be based on the CamMask that you have selected

@QuanyiLi
Copy link
Member

QuanyiLi commented Oct 1, 2023

Thank you very much. All tests have passed. Merged

@QuanyiLi QuanyiLi merged commit e47db11 into metadriverse:main Oct 1, 2023
7 checks passed
@maxime-desroches maxime-desroches deleted the rgb-only branch August 27, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants