-
Notifications
You must be signed in to change notification settings - Fork 657
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
base: main
Are you sure you want to change the base?
fix(autoware_image_projection_based_fusion): detected object roi box projection fix #9519
Conversation
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
fe461df
to
3d9f51c
Compare
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)); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]>
3d9f51c
to
26cdeea
Compare
Description
std::numeric_limits<double>::min()
Related links
Parent Issue:
How was this PR tested?
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.