struct mp2p_icp_filters::SegmentedPlane

Overview

One plane found by segment_planes()

#include <plane_segmentation.h>

struct SegmentedPlane
{
    // fields

    mrpt::math::TVector3D normal = {0, 0, 1};
    double offset = 0;
    mrpt::math::TPoint3D centroid = {0, 0, 0};
    std::vector<uint32_t> inliers;
    double area = 0;
    double thickness_rms = 0;
    double thickness_p95 = 0;
    mrpt::math::TVector3D axis_u = {1, 0, 0};
    mrpt::math::TVector3D axis_v = {0, 1, 0};
    double u_min = 0;
    double u_max = 0;
    double v_min = 0;
    double v_max = 0;
    std::array<double, 3> tangent_variances = {0, 0, 0};
    mrpt::math::CMatrixDouble44 covariance;

    // methods

    std::size_t num_points() const;
    mrpt::math::TPlane plane() const;
    mp2p_icp::plane_patch_t as_plane_patch() const;
};

Fields

mrpt::math::TVector3D normal = {0, 0, 1}

Unit normal, pointing towards PlaneSegmentationParams::viewpoint.

double offset = 0

Plane equation: normal.p = offset for every point p on the plane.

mrpt::math::TPoint3D centroid = {0, 0, 0}

Mean of the inliers, projected onto the plane.

std::vector<uint32_t> inliers

Indices of the inliers in the input cloud, in ascending order.

double area = 0

Covered area [m2]: occupied cells of an in-plane grid of voxel_size

double thickness_rms = 0

RMS of the inlier point-to-plane distances [m].

double thickness_p95 = 0

95th percentile of the absolute inlier point-to-plane distances [m]

mrpt::math::TVector3D axis_u = {1, 0, 0}

In-plane principal directions (largest spread first). axis_u, axis_v, normal form a right-handed orthonormal basis.

double u_min = 0

Oriented bounding box: inlier coordinates along axis_u and axis_v span [u_min, u_max] x [v_min, v_max], relative to centroid [m].

std::array<double, 3> tangent_variances = {0, 0, 0}

Variances of the minimal plane parameters [alpha, beta, gamma] : the plane through centroid + gamma * normal with normal normal + alpha * axis_u + beta * axis_v (to first order). They are uncorrelated in this basis: max(thickness_rms, 1e-4 m)^2 divided by the sum of squared u (resp. v) coordinates, and by the number of inliers. The 0.1 mm floor keeps them positive for exact synthetic planes. This assumes independent residuals, which overlapping scans of a map are not: treat it as a lower bound.

mrpt::math::CMatrixDouble44 covariance

Covariance of [nx, ny, nz, offset], the same uncertainty mapped to the 4-parameter form (rank 3).

Methods

mrpt::math::TPlane plane() const

The plane as an MRPT object.

mp2p_icp::plane_patch_t as_plane_patch() const

The plane, centroid, area and number of points as a plane_patch_t, e.g. for metric_map_t::planes