Point Cloud Processing · Vitreous

What Are Principal Axes and 3D Bounding Boxes?

Principal axes and 3D bounding boxes turn an isolated point cloud into a compact description of orientation and size. Learn centroid and covariance geometry, PCA, AABB and OBB behavior, ambiguity and outlier sensitivity, then compute them with Vitreous.

Imagine a cobot picking long metal profiles from a tray. Object segmentation has already produced one point cloud per profile, but the robot still needs a compact answer to three questions: Where is this part? Which way is it pointing? How much space does it occupy? The centroid, principal axes, and 3D bounding boxes answer those geometric questions without needing a trained object model.

Input

Output

The principal direction summarizes the longest spread of the measured points. It is a geometric orientation cue, not a semantic label for the object's front. Media: Telekinesis Skill documentation.

1. What Are Principal Axes and 3D Bounding Boxes?

Principal axes and bounding boxes summarize the position, orientation, and extent of a 3D point set. They are useful after a point cloud has been filtered and separated into individual objects, when passing every raw point to planning would be unnecessarily expensive.

The centroid is the average position of the points. The principal axes describe the directions in which the cloud spreads most, second most, and least. An axis-aligned bounding box (AABB) is the smallest box aligned with the current coordinate frame’s X, Y, and Z axes that contains every point. An oriented bounding box (OBB) is allowed to rotate, so it can follow the object’s own geometry more tightly.

These quantities are related, but they are not interchangeable. AABB answers “what world-aligned region contains this cloud?” OBB answers “what rotated box compactly encloses it?” Principal axes answer “along which directions are these samples distributed?” For a robot, choosing the correct summary is more important than choosing the mathematically fanciest one.

1.1 From Object Points to a Geometric Summary

3D object samples → orientation and extent

Object point cloudOne isolated 3D object or part
Find the centerCompute the centroid of all positions
Describe the spreadCovariance for PCA or a rotating box fit
Recover object directionsPrincipal axes form a local orientation frame
Measure spatial extentAABB stays fixed; OBB follows the object
Geometric summaryCenter, axes, dimensions, and volume

Axes describe directions of spread, not semantic front, left, or up; symmetry and outliers can make that orientation ambiguous.

Principal-axis estimation summarizes how points are distributed around their centroid. Axis-aligned and oriented boxes then turn that distribution into different descriptions of occupied 3D space. Adapted as an explanatory diagram fromPearson, “Lines and Planes of Closest Fit”.

The workflow starts with one isolated object. If the input still contains a tabletop, a neighboring object, or flying depth points, those measurements become part of the geometry and can change every result downstream.

First compute the center. Centering turns absolute camera coordinates into offsets around the object, so the following calculation measures shape rather than location. Next summarize how those offsets vary together. PCA does this with a covariance matrix; an OBB method instead searches for axes that describe a compact enclosing box.

The recovered axes form a candidate local frame for the object. Projecting points into that frame reveals their length, width, and height. The final result is a small geometric description—a center, directions, and dimensions—that a planner can use for cropping, collision approximation, approach selection, or grasp orientation.

1.2 The Centroid Separates Location From Shape

For a cloud containing NN positions pi=[xi,yi,zi]T\mathbf p_i=[x_i,y_i,z_i]^{\mathsf T}, the centroid is

μ=1N∑i=1Npi.\boldsymbol\mu=\frac{1}{N}\sum_{i=1}^{N}\mathbf p_i.

NN is the number of points; pi\mathbf p_i is point ii; and μ\boldsymbol\mu is their mean 3D position. The centered vector qi=pi−μ\mathbf q_i=\mathbf p_i-\boldsymbol\mu describes point ii relative to this center.

The centroid is easy to compute, but it is not necessarily the physical center of mass. Depth cameras sample visible surfaces rather than material volume. If only the front of a part is visible, the point centroid shifts toward that visible side. Uneven density and outliers also move it. Treat it as the center of the measured samples unless the sensing process justifies a stronger interpretation.

1.3 PCA Finds Directions of Maximum Spread

Principal component analysis begins with the covariance matrix

C=1N∑i=1NqiqiT.\mathbf C=\frac{1}{N}\sum_{i=1}^{N}\mathbf q_i\mathbf q_i^{\mathsf T}.

C\mathbf C is a symmetric 3×33\times3 matrix. Its diagonal entries describe variation along X, Y, and Z; its off-diagonal entries describe how two coordinates vary together. We then solve

Cvk=λkvk,k∈{1,2,3}.\mathbf C\mathbf v_k=\lambda_k\mathbf v_k, \qquad k\in\{1,2,3\}.

vk\mathbf v_k is eigenvector kk, and λk\lambda_k is its eigenvalue. Sort them so λ1≥λ2≥λ3\lambda_1\ge\lambda_2\ge\lambda_3. The first principal axis v1\mathbf v_1 points along the largest spread; v2\mathbf v_2 captures the next-largest perpendicular spread; and v3\mathbf v_3 captures the least. For a flat plate, v3\mathbf v_3 often approximates the surface normal. For a long bar, v1\mathbf v_1 follows its length.

The fraction

ηk=λkλ1+λ2+λ3\eta_k=\frac{\lambda_k}{\lambda_1+\lambda_2+\lambda_3}

is the proportion of total positional variance along axis kk. ηk\eta_k is dimensionless. A long thin object has one dominant value; a roughly spherical cloud has three similar values and therefore no strongly preferred orientation.

1.4 Why Principal Directions Can Flip or Become Ambiguous

An eigenvector has an unavoidable sign ambiguity. If v\mathbf v is an eigenvector, −v-\mathbf v represents the same axis. A principal axis can therefore point in either direction between runs without the underlying line changing. Geometry alone cannot decide which end of a symmetric profile is its “front.”

There is a second ambiguity when eigenvalues are equal or nearly equal. A cylindrical can may have one stable long axis, but any two perpendicular directions around that axis describe almost the same spread. A cube can make all three directions unstable. Small noise may rotate the returned frame dramatically even though the object barely moved.

For stable robot orientation, add a convention: point one axis toward the camera, align the least-varying axis with gravity, use color or a key feature to identify the front, and enforce a right-handed frame. Principal axes propose a geometric frame; these rules make it temporally and semantically consistent.

1.5 AABB: Fast Bounds in the Current Coordinate Frame

An axis-aligned box is defined directly by coordinate-wise extrema:

pmin=[min⁡iximin⁡iyimin⁡izi]T,pmax=[max⁡iximax⁡iyimax⁡izi]T.\mathbf p_{min}= \begin{bmatrix} \min_i x_i&\min_i y_i&\min_i z_i \end{bmatrix}^{\mathsf T}, \qquad \mathbf p_{max}= \begin{bmatrix} \max_i x_i&\max_i y_i&\max_i z_i \end{bmatrix}^{\mathsf T}.

pmin\mathbf p_{min} and pmax\mathbf p_{max} are opposite corners. The box dimensions are e=pmax−pmin\mathbf e=\mathbf p_{max}-\mathbf p_{min}, and its volume is V=exeyezV=e_xe_ye_z, where exe_x, eye_y, and eze_z are its extents.

AABB is fast, deterministic, and always aligned with the frame used by the rest of the system. This makes it excellent for broad-phase collision checks, workspace indexing, and quickly cropping a known world region. Its weakness is rotation: a long diagonal part creates a large box containing substantial empty space.

1.6 OBB: Let the Box Follow the Object

An oriented box introduces a center c\mathbf c, an orthonormal rotation matrix R\mathbf R, and local dimensions e\mathbf e. A world point lies inside when its local coordinates

q=RT(p−c)\mathbf q=\mathbf R^{\mathsf T}(\mathbf p-\mathbf c)

satisfy ∣qx∣≤ex/2|q_x|\le e_x/2, ∣qy∣≤ey/2|q_y|\le e_y/2, and ∣qz∣≤ez/2|q_z|\le e_z/2. Here, p\mathbf p is the world point, c\mathbf c is the box center, R\mathbf R contains the box axes as columns, and q\mathbf q is the same point expressed in the box frame.

An OBB can be derived from candidate object axes and then tightened, or searched to reduce enclosing volume. Telekinesis exposes minimize_bbox_volume for a tighter result and use_robust_fitting when noisy data requires a less brittle fit. Both options trade additional computation for a better geometric summary.

Interactive 3D bounds

Rotate the part and compare world-aligned and object-aligned boxes

—

This top view compares 2D cross-sections of 3D boxes. The real AABB and OBB also measure depth.

The interactive view shows why neither box is universally better. AABB stays meaningful in the world frame as the part rotates, but its size changes. OBB follows the part and usually stays compact, but its orientation can be unstable for symmetric geometry. Pick based on the downstream question.

1.7 Outliers and Partial Views Change the Answer

Extrema make bounding boxes especially sensitive to distant points. One stray measurement can stretch an AABB or OBB far beyond the part. Covariance spreads the influence across all points, but a sufficiently distant outlier contributes a large squared offset and can rotate PCA axes.

Clean the cloud before summarizing it. Crop the workspace, remove statistical or radius outliers, and cluster separate objects. Then test partial views deliberately. An industrial arm may see only the upper surface of a part in one pose and a side surface in another. If those visible samples produce different axes, the principal frame is not a reliable substitute for full 6D model-based pose estimation.

1.8 Which Representation Should You Use?

RepresentationBest questionStrengthImportant limitation
Centroid“Where is the average measured position?”Minimal, fast location cueNot necessarily center of mass
PCA axes“How is this cloud distributed?”Direct shape-orientation summarySensitive to outliers and symmetry
AABB“What world-aligned region contains it?”Fast and stable in the world frameLoose for rotated objects
OBB“What rotated box encloses it compactly?”Tight extent and useful orientation cueMore compute; orientation may be ambiguous
FoundationPose / registration“What is the object’s model-relative 6D pose?”Semantic/model-aware orientationRequires a model, initialization, or more compute

Use the simplest representation that preserves the information required by the task. AABB may be sufficient for AMR obstacle indexing. OBB may give an industrial arm a useful approach direction for a long profile. A keyed aerospace component whose rotation matters around every axis needs a model-aware pose method.

2. How to Use Principal Axes and 3D Boxes in the Telekinesis Agentic OS

The three Vitreous Skills can operate on the same isolated cloud:

from telekinesis import datatypes, vitreous

point_cloud = datatypes.PointCloud.from_url(
    url=(
        "https://assets.telekinesis.ai/examples/v1/point_clouds/"
        "zivid_large_pcb_inspection_cropped_preprocessed.ply"
    ),
    use_cache=True,
)

principal_axes = vitreous.estimate_principal_axes(
    point_cloud=point_cloud,
    method="obb",  # Use "pca" for the covariance-based method.
)

aabb = vitreous.calculate_axis_aligned_bounding_box(
    point_cloud=point_cloud,
)

obb = vitreous.calculate_oriented_bounding_box(
    point_cloud=point_cloud,
    minimize_bbox_volume=True,
    use_robust_fitting=True,
)

print("AABB dimensions:", aabb.dimensions, "volume:", aabb.volume)
print("OBB dimensions:", obb.dimensions, "volume:", obb.volume)
print("principal axes:", principal_axes)

The pca method is fast for clean data. The obb method uses the oriented-box axes and is intended to be more robust on noisy clouds. Do not compare the two only on one visually clean scan; compare orientation repeatability across the full camera and object operating range.

Try it out

Estimate principal axes with Vitreous

See the available PCA and OBB methods and how the returned directions fit into manipulation pipelines.

Open principal axes docs

Runnable example

Run the principal axes example

Open the exact Telekinesis Python script for estimating an object's principal directions.

View Python example

3. How to Evaluate a Geometric Summary

There is no single benchmark score for centroids, axes, and boxes because they answer different questions. Evaluate each output against its intended robot use:

MetricDefinitionWhy it matters
Center errorEuclidean distance to a reference centerMeasures localization drift
Axis angular errorSmallest angle between estimated and reference axesMeasures orientation quality while respecting sign ambiguity
Box IoUIntersection volume divided by union volumeMeasures agreement of 3D occupied regions
Volume ratioEstimated volume divided by reference volumeReveals loose or outlier-stretched boxes
RepeatabilityVariation across repeated scans of a static partExposes sensor and symmetry instability
Task successPick, insertion, or collision-check successVerifies that the abstraction is useful downstream

Separate errors caused by the summarizer from errors caused by segmentation. Run the geometry first on clean reference clouds, then on realistic clustered sensor data. That tells you whether to improve the box method or the upstream perception pipeline.

4. Where to Go Next

5. References