src.mining.height_feats_miner

Classes

HeightFeatsMiner(**kwargs)

class src.mining.height_feats_miner.HeightFeatsMiner(**kwargs)
Author:

Alberto M. Esmoris Pena

Basic height features miner. See Miner.

Variables:
  • support_chunk_size (int) – How many tasks (support points) per chunk must be considered when computing the support neighborhoods (i.e., the neighborhoods centered at the support points). If it is zero, then all the points are considered at once.

  • support_subchunk_size (int) – How many support neighborhoods inside a given chunk must be considered when computing the features in parallel. It must be at least one, i.e., \(>0\).

  • pwise_chunk_size (int) – How many tasks (points) per chunk must be considered when computing the height features for each point in the point cloud. If it is zero, then all the points are considered at once.

  • neighborhood (dict) –

    The neighborhood definition. For example:

    {
        "type": "cylinder",
        "radius": 50,
        "separation_factor": 0.7
    }
    

    In this definition, the radius (often in meters) describes either the disk of a cylinder or half the side of a rectangular region along the vertical axis. Note that separation factor can be set to zero. In this case, the height features will be computed point-wise.

  • outlier_filter (str or None) – The outlier filter to be applied (if any).

  • fnames (list) – The list of height features that must be mined. [‘floor_distance’] by default.

  • nthreads (int) – The number of threads to be used for the parallel computation of the geometric features. Note using -1 (default value) implies using as many threads as available cores.

  • frenames (list) – Optional attribute to specify how to rename the mined features.

static extract_miner_args(spec)

Extract the arguments to initialize/instantiate a HeightFeatsMiner from a key-word specification.

Parameters:

spec – The key-word specification containing the arguments.

Returns:

The arguments to initialize/instantiate a HeightFeatsMiner.

__init__(**kwargs)

Initialize an instance of HeightFeatsMiner.

The neighborhood definition and feature names (fnames) are always assigned during initialization. The default neighborhood is a cylinder with a disk of radius 50.

Parameters:

kwargs (dict) – The attributes for the HeightFeatsMiner that will also be passed to the parent.

mine(pcloud)

Mine height features from the given point cloud. See Miner and mining.Miner.mine().

Parameters:

pcloud – The point cloud to be mined.

Returns:

The point cloud extended with height features.

Return type:

PointCloud

compute_height_features(X)

Compute the height features for the given matrix of coordinates \(\pmb{X} \in \mathbb{R}^{m \times 3}\).

Parameters:

X (np.ndarray) – The matrix of coordinates.

Returns:

The computed features.

Return type:

np.ndarray

compute_height_features_on_support(X, sup_X, kdt)

Compute the height features on each support neighborhood.

Parameters:
  • X – The matrix of coordinates representing the input point cloud.

  • sup_X – The center point for each support neighborhood.

  • kdt – The KDTree representing the input point cloud on (x, y) only (i.e., 2D).

Returns:

The support points for non-empty neighborhoods and the height features for each support point of a non-empty neighborhood.

Return type:

tuple (np.ndarray, np.ndarrray)

compute_pwise_height_features(X, sup_F, kdt)

Compute the height features for each point in the point cloud.

Parameters:
  • X – The matrix of coordinates representing the input point cloud.

  • sup_F – The features for each support point.

  • kdt – The KDTree representing the support points.

Returns:

The height features for each point in the point cloud.

Return type:

np.ndarray

select_support_height_functions()

Select height functions from specified feature names (fnames). These functions will be computed on the vertical coordinates of the neighborhood for each support point.

Returns:

List of functions to extract height features from a vector of vertical coordinates. Each feature is a map from a vector of arbitrary dimensionality representing height coordinates to a single scalar.

Return type:

list

select_height_functions()

Select height functions from specified feature names (fnames). Some of these features are taken directly from the support neighborhood, others are derived as a function of the point and the corresponding support neighborhood.

Returns:

Two lists. The first one is a list of functions to extract height features from a pair of values. The first value represents the vertical coordinate of the point in the point cloud and the second value represents a given height feature corresponding to the closest support point (or a vector of features, e.g., quartiles or deciles). The second list represents the dimensionality of each feature, i.e., one for most features because they correspond to a single scalar but greatear than one for vectorial features (e.g., 3 for quartiles or 9 for deciles).

Return type:

tuple of list