leveling
leveling
#
leveled — a free reconstruction given gravity: its dominant plane becomes the ground.
- Ground. RANSAC over three-point samples of
pointsfinds the plane with the most points withinINLIER_FRACTIONof the cloud's extent; a least-squares fit to those inliers refines it. - Up. The plane's normal is signed so the mean camera centre lies on its positive side: cameras stand above the ground, never below it.
- Move. The whole model turns so that normal becomes
+yand slides so the ground isy = 0— a rigid motion, so scale and shape survive.
INLIER_FRACTION = 0.02
module-attribute
#
How far from the plane a point may lie and still count, as a fraction of the cloud's extent.
dominant_plane(points)
#
The plane through the most of points: (unit normal, a point on it, inlier mask).
Source code in capturegraph-recipes/capturegraph_recipes/sfm/alignment/leveling.py
leveled(model)
#
model turned and lifted so its dominant plane is the ground at y = 0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Reconstruction
|
The reconstruction, typically one built from nothing and so without a notion of up. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the model holds fewer than three points or no camera. |