feat(image_projection_based_fusion): add cache for camera projection #9635
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a caching feature for calculating raw image projections (unrectifyPoint).
This PR must merged with autowarefoundation/autoware_launch#1275
It introduces the CameraProjection class to handle the related processes. The cache is computed based on specific grid centers, and the projected points are represented using these grid centers. These grid centers are determined by
approximation_grid_width_size
andapproximation_grid_height_size
.For example, when approximation_grid_*_size is set to 1.0 pixel, the grid centers will be created as shown in the following image:
Note that edge pixels ((0, *), (w, *), (*, 0), (*, h)) will be rounded to fall outside the image bounds.
When using caching, memory consumption is calculated as:
ceil(image_width / grid_size_w) * ceil(image_height / grid_size_h) * (4 * 2) * roi_numbers [bytes]
Here, 4 * 2 represents the bytes for two float values.
For example, for an image with dimensions 1440 × 1080, a grid size of 1 pixel, and caching enabled for 6 cameras, the memory consumption is:
(1440 / 1.0) * (1080 / 1.0) * 4 * 2 * 6 / (1024 * 1024) ≈ 71.2 MiB (theoretical).
other changes
point_project_to_unrectified_image
param[add speed comparison figure]
Related links
Parent Issue:
How was this PR tested?
Notes for reviewers
None.
Interface changes
None.
Effects on system behavior
None.