Fix polygon trigger false positives when bounding boxes are clipped #1748
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
Please include a summary of the change and which issue is fixed or implemented. Please also include relevant motivation and context (e.g. links, docs, tickets etc.).
Fixed an issue where objects partially overlapping with polygons were incorrectly detected. Previously, when a polygon was positioned on the left side of the screen and a person on the right, with the person's bounding box slightly overlapping the polygon, the clip_boxes() function would forcefully clip the boxes to fit within the frame. This caused objects outside the frame to be incorrectly identified as being inside the polygon.
Changes
The original bounding box is large, and its bottom center point does not overlap with the polygon. However, during the clipping process, since the bottom-left corner intersects with the polygon, the box is forcefully shrunk. This causes the center point to shift inside the polygon, resulting in false detections.
Thank you
List any dependencies that are required for this change.
Type of change
Please delete options that are not relevant.
How has this change been tested, please provide a testcase or example of how you tested the change?
YOUR_ANSWER
Any specific deployment considerations
For example, documentation changes, usability, usage/costs, secrets, etc.
Docs