BoundingBox2D
Represents a 2D bounding box using top-left corner coordinates plus width and height.
Properties:
Property | Type | Description |
|---|---|---|
|
| Top-left corner X coordinate |
|
| Top-left corner Y coordinate |
|
| Bounding box width |
|
| Bounding box height |
Read-only properties:
Property | Type | Description |
|---|---|---|
|
| Center point X coordinate, calculated from |
|
| Center point Y coordinate, calculated from |
|
| Bounding box area, calculated from |
BoundingBox2D
Signature:
BoundingBox2D(x: int, y: int, width: int, height: int)
Description:
Constructs a BoundingBox2D instance. This type is an immutable dataclass.
Parameters:
Parameter | Type | Required | Description |
|---|---|---|---|
|
| Yes | Top-left corner X coordinate |
|
| Yes | Top-left corner Y coordinate |
|
| Yes | Bounding box width |
|
| Yes | Bounding box height |
Returns:
BoundingBox2D instance.
Raises:
None.
to_dict
Signature:
BoundingBox2D.to_dict() -> dict[str, int]
Description:
Converts to a dictionary containing x / y / width / height.
Parameters:
No parameters.
Returns:
dict[str, int].
Raises:
None.