These functions help determine optimal camera positions to observe objects or groups of objects in a scene, ensuring the camera is placed in unoccupied (navigable) space and has a clear line of sight.
get_proper_snapshot_observation_point
Finds a single optimal observation point for a set of object centers. It uses the structure tensor of the object centers to determine the 'long axis' and 'short axis' of the group, then attempts to place the camera opposite the short axis to capture the group effectively.
get_random_snapshot_observation_point
Similar to the above, but selects an observation point randomly from valid unoccupied candidates, weighted by their position relative to the object group's orientation.
Common Parameters:
obj_centers: [N, 2] array of object centers in voxel space.unoccupied_map: [H, W] boolean array where True indicates navigable space.min_obs_dist / max_obs_dist: Distance range from the object center to the camera.snapshot_observation_point: A fallback/initial point for the observation.
Returns:
A [2] array representing the optimal (or fallback) observation point in voxel coordinates.