Skip to main content

Module ground

Module ground 

Source
Expand description

Metric size, position and speed of objects standing on the ground (Phase 3 of docs/object_metric_slam_plan.md, moving objects).

An object that moves while the camera moves cannot be triangulated: its rays do not meet. Ground contact places it anyway:

  • The ground is found from the VIO’s static scene points in the gravity-aligned world (z up). PathGround follows the camera’s path: the camera moves over the ground, so a point’s height is measured from the camera where it passed nearest, which keeps roads that climb or fall sharp. estimate_ground_height is the flat-ground version.
  • Each frame (place_on_ground): the ray through the middle of the 2D box’s bottom edge meets the ground at the object’s foot. That fixes its distance, and the box’s rays cut at that distance give its height and width. “Bottom” is the edge lowest in the world, so a camera mounted sideways works as well as an upright one.
  • The ground under the object (place_on_local_ground): stairs, a ramp or a kerb can put an object on another level than the camera’s ground, which makes it look small and near (a lower level) or large and far (a higher one). The ground moves to the layer of scene points under the object’s placed foot until it settles.
  • Over a track (summarize_ground_track): the median size, the path of the foot, and the velocity of a line fitted to it, weighted by how far each foot can be off; a velocity within that noise is still.

The scale comes from the camera’s metric height above the ground, so it is as good as the VIO’s. The object must touch the ground where the box ends: anything carried, stacked or seen over an edge breaks it.

Structs§

BoxRays
World-frame rays through a 2D box: the middles of its four edges and its four corners.
GroundObservation
An object placed on the ground in one frame.
GroundParams
Settings of estimate_ground_height, PathGround and place_on_local_ground.
GroundTrack
An object’s track on the ground.
GroundTrackParams
Settings of summarize_ground_track.
GroundView
One view of an object: where the camera was and the rays of its box.
PathGround
The ground along the camera’s path. The camera moves over the ground, so a scene point’s height is measured from the camera where it passed nearest: on a road that climbs or falls, the ground then lies at one depth below the path, the camera’s height above it. That height is found for each stretch of the path (path_stretch metres either way), so a camera whose height changes (a hand lowering it) is followed too. The ground under any spot is the camera’s height below the nearest point of the path.

Functions§

estimate_ground_height
The ground’s height (world z): the mean height of the points in the densest bin-high layer below lowest_camera_z - min_below_camera.
place_on_ground
Place an upright object standing on the ground z = ground_z, seen from camera_center through the rays of its 2D box. None if the camera is not above the ground or the box’s bottom edge does not point down.
place_on_local_ground
Place an object’s views on the ground under it. Starting from ground_z, the views are placed (place_on_ground), and the ground moves to the densest layer of the local_neighbours scene points horizontally nearest to the median foot (within local_radius, below the lowest camera), while that layer lies more than local_min_shift away (a few rounds at most). Nearest points rather than all within a radius, so that over steps the ground walks down (or up) one step at a time. Returns the ground used and the placed views; None if no view could be placed.
plausible_height
Rough height ranges of COCO classes that stand on the ground, in metres. The height is what ground contact measures best (the width depends on the side the object is seen from). Only for flagging implausible estimates, never to set a scale.
summarize_ground_track
Median size, and the velocity of the path, from at least three frames spanning min_seconds.