reproject_box#

deltacamera.reproject_box(old_box, old_camera, new_camera)[source]#

Reprojects a bounding box from one camera to another.

This is an ambiguous operation in general, as the computing the box loses information about the precise segmentation of the object.

Therefore, reproject(bbox(mask)) != bbox(reproject(mask)) in general. We apply a heuristic here:

reproject(box) = (bbox(reproject(corners(box))) + bbox(reproject(side_midpoints(box)))) / 2

Parameters:
  • old_box – The bounding box in the old camera image.

  • old_camera – The camera that captured the image where the object has bbox old_box.

  • new_camera – The camera to which the box should be reprojected.

Returns:

The reprojected bounding box in the new camera image.