dabble.bbox_to_3d_loc
Description
Estimates the 3D coordinates of an object given a 2D bounding box.
- class Node(config=None, **kwargs)[source]
Uses 2D bounding boxes information to estimate 3D location.
- Inputs
bboxes
(numpy.ndarray
): A NumPy array of shape \((N, 4)\) containing normalized bounding box coordinates of \(N\) detected objects. Each bounding box is represented as \((x_1, y_1, x_2, y_2)\) where \((x_1, y_1)\) is the top-left corner and \((x_2, y_2)\) is the bottom-right corner. The order corresponds to bbox_labels and bbox_scores.- Outputs
obj_3D_locs
(List[numpy.ndarray]
): A list of \(N\) NumPy arrays representing the 3D coordinates \((x, y, z)\) of an object associated with a detected bounding box.- Configs
focal_length (
float
) – default = 1.14.
Approximate focal length of webcam used, in metres. Example on measuring focal length can be found here.height_factor (
float
) – default = 2.5.
A factor used to estimate real-world distance from pixels, based on average human height in metres. The value varies across different camera set-ups, and calibration may be required. Please refer to the Social Distancing use case for more information.