paralleldomain.model.annotation.bounding_box_3d

class BoundingBox3D(pose, width, height, length, class_id, instance_id, num_points, attributes=<factory>)

Represents a 3D Bounding Box geometry.

Parameters:
pose

6D Pose for box in 3D sensor space.

length

Length of box in meter along x-axis.

width

Width of box in meter along y-axis.

height

Height of box in meter along z-axis.

class_id

Class ID of annotated object. Can be used to lookup more details in ClassMap.

instance_id

Instance ID of annotated object. Can be used to cross-reference with other instance annotation types, e.g., InstanceSegmentation2D or InstanceSegmentation3D.

num_points

Number of LiDAR points of related Sensor.

attributes

Dictionary of arbitrary object attributes.

classmethod merge_boxes(target_box, source_box)

Takes two 3D box geometries as input and merges both into a new box geometry. The resulting box geometry has dimensions from target_box and source_box merged into it.

Return type:

BoundingBox3DBaseGeometry[TypeVar(T, int, float)]

Parameters:
property edges: ndarray

Returns the 3D edges of a bounding box.

Edges are returned in order of connecting the vertices in the following order:

  • [0, 1]

  • [1, 2]

  • [2, 3]

  • [3, 0]

  • [4, 5]

  • [5, 6]

  • [6, 7]

  • [7, 4]

  • [2, 6]

  • [7, 3]

  • [1, 5]

  • [4, 0]

   5--------6
  /|   top /|
 / |      / |
1--------2  |
|  4-----|--7
| /      | /
|/       |/ left
0--------3
  front
property faces: ndarray

Returns the 3D faces of a bounding box.

Faces are returned in order of connecting the vertices in the following order:

  • [0, 1, 2, 3] (front)

  • [4, 5, 6, 7] (back)

  • [3, 2, 6, 7] (left)

  • [0, 1, 5, 4] (right)

  • [6, 2, 1, 5] (top)

  • [7, 3, 0, 4] (bottom)

   5--------6
  /|   top /|
 / |      / |
1--------2  |
|  4-----|--7
| /      | /
|/       |/ left
0--------3
  front
property vertices: ndarray

Returns the 3D vertices of a bounding box.

Vertices are returned in the following order:

   5--------6
  /|   top /|
 / |      / |
1--------2  |
|  4-----|--7
| /      | /
|/       |/ left
0--------3
  front
property volume: T

Returns volume of 3D Bounding Box in cubic meter.

class BoundingBoxes3D(boxes)

Collection of 3D Bounding Boxes

Parameters:

boxes (List[BoundingBox3D]) – BoundingBoxes3D.boxes

boxes

Unordered list of BoundingBox3D instances

get_box_by_instance_id(instance_id)

Returns the box with matching instance ID.

Parameters:

instance_id (int) – Instance ID of box that should be returned.

Return type:

Optional[BoundingBox3D]

Returns:

Matching box instance. If none found, returns None.

get_boxes_by_attribute_key(attr_key)

Returns all boxes having a certain attribute, independent of value.

Parameters:

attr_key (str) – Name of attribute.

Return type:

List[BoundingBox3D]

Returns:

List of box instances that have the specified attribute.

get_boxes_by_attribute_value(attr_key, attr_value)

Returns all boxes having the specified attribute and value.

Parameters:
  • attr_key (str) – Name of attribute.

  • attr_value (Any) – Value of attribute.

Return type:

List[BoundingBox3D]

Returns:

List of box instances that have the specified attribute and value.

get_boxes_by_attribute_values(attr_key, attr_values)

Returns all boxes having the specified attribute and any of the values.

Parameters:
  • attr_key (str) – Name of attribute.

  • attr_values (List[Any]) – Allowed values of attribute.

Return type:

List[BoundingBox3D]

Returns:

List of box instances that have the specified attribute and any of the values.

get_boxes_by_class_id(class_id)

Returns all boxes with the specified class ID.

Parameters:

class_id (int) – Class ID.

Return type:

List[BoundingBox3D]

Returns:

List of box instances that are of the specified class.

get_boxes_by_class_ids(class_ids)

Returns all boxes having any of the specified class IDs.

Parameters:

class_ids (List[int]) – Class IDs.

Return type:

List[BoundingBox3D]

Returns:

List of box instances that are any of the specified classes.

static merge_boxes(target_box, source_box)

Takes two 3D boxes as input and merges both into a new box. The resulting box has the exact same properties as target_box, but with extended source_box dimensions merged into it.

Return type:

BoundingBox3D

Parameters: