Skip to content

Commit

Permalink
Fix on range of values passed into Point2f and Size2f (#152)
Browse files Browse the repository at this point in the history
* add a temporary fix for clipping the values before the call of dai.Point2f and dai.Size2f

* added missing value to the updated rectangle variable
  • Loading branch information
ptoupas authored Dec 11, 2024
1 parent d5ad692 commit 2797776
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions depthai_nodes/ml/messages/img_detections.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def rotated_rect(self, rectangle: Tuple[float, float, float, float, float]):
@param value: Tuple of (x_center, y_center, width, height, angle).
@type value: tuple[float, float, float, float, float]
"""
rectangle = [max(0, min(1 - 1e-6, value)) for value in rectangle[:-1]] + [
rectangle[-1]
]
center = dai.Point2f(rectangle[0], rectangle[1])
size = dai.Size2f(rectangle[2], rectangle[3])

Expand Down

0 comments on commit 2797776

Please sign in to comment.