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

fix(autoware_image_projection_based_fusion): detected object roi box projection fix #9519

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

technolojin
Copy link
Contributor

@technolojin technolojin commented Nov 28, 2024

Description

  1. eliminate misuse of std::numeric_limits<double>::min()
  2. fix roi range up to the image edges

Related links

Parent Issue:

How was this PR tested?

Screenshot from 2024-12-02 15-09-33

Screenshot from 2024-12-02 15-17-24

Objects at the edges are fused without issue.

Notes for reviewers

It will be merged after #9505 is merged and the build issue is resolved.

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions bot added component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test labels Nov 28, 2024
Copy link

github-actions bot commented Nov 28, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@technolojin technolojin force-pushed the fix/image-proj-fus/roi-range-fix branch from fe461df to 3d9f51c Compare November 29, 2024 08:39
@technolojin technolojin self-assigned this Nov 29, 2024
@technolojin technolojin marked this pull request as ready for review November 29, 2024 08:41
max_y = std::min(max_y, image_height - 1);
const uint32_t idx_min_x = std::floor(std::max(min_x, 0.0));
const uint32_t idx_min_y = std::floor(std::max(min_y, 0.0));
const uint32_t idx_max_x = std::ceil(std::min(max_x, image_width));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we subtract 1 from image_width? Isn't width the value of size that doesn't account for zero-based indexing?

Copy link
Contributor Author

@technolojin technolojin Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The roi boundary is the coordinate of image in pixel, not index.
If we think 1 by 1 pixel image and 1 by 1 ROI, min is (0,0) and max is (1,1).
Therefore, the possible maximum value should be the image_width, not image_width - 1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the following nodes expect the maximum value to image_width - 1, we may need to align relevant nodes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. 👍
Have you conducted a simple test for verification?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will find a simple test method and will post to the description.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yukkysaito
Tests on objects at image edges are done and the results are visualized as the description.

1. eliminate misuse of std::numeric_limits<double>::min()
2. fix roi range up to the image edges

Signed-off-by: Taekjin LEE <[email protected]>
Improve the calculation of the region of interest (ROI) in the RoiDetectedObjectFusionNode. The previous code had an issue where the ROI range was not correctly limited to the image edges. This fix ensures that the ROI is within the image boundaries by using the correct comparison operators for the x and y coordinates.

Signed-off-by: Taekjin LEE <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants