src.utils.ptransf.simple_smoother_decorator_transformer

Classes

SimpleSmootherDecoratorTransformer(**kwargs)

class src.utils.ptransf.simple_smoother_decorator_transformer.SimpleSmootherDecoratorTransformer(**kwargs)
Author:

Alberto M. Esmoris Pena

Class representing a simple structure smoother transformer that can be used to decorate different components of the framework.

A simple smooth representation of a point cloud \(\pmb{P} = [\pmb{X} | \pmb{F}] \in \mathbb{R}^{m \times (n_x+n_f)}\) is another point cloud \(\pmb{\tilde{P}} = [\pmb{\tilde{X}} | \pmb{F}] \in \mathbb{R}^{m \times (n_x+n_f)}\). The smooth representation has the same number of points but the structure space \(\pmb{X}\) is transformed considering the neighborhood of each point to update its position. The transformation is the same that can be computed with SimpleStructureSmootherPP but the results on the decorated point cloud (e.g., mined features) are then assigned to the original point cloud, i.e., the point cloud is not updated, the smooth representation is only used during a certain computation.

Variables:
  • smoother – The SimpleStructureSmootherPP object used to .

  • representation_report_path (str) – Path where a point cloud with the smoothed representation will be exported.

__init__(**kwargs)

Initialize/instantiate a simple smoother decorator transformer object.

Parameters:

kwargs – The key-word specification to instantiate the SimpleSmootherDecoratorTransformer.

Keyword Arguments:
  • neighborhood (dict) – See SimpleStructureSmootherPP.__init__().

  • representation_report_path (str) –

    Path where a point cloud with the points in the smoothed representation will be exported.

transform(X, F=None, y=None, fnames=None, header=None, out_prefix=None)

Transform the given point cloud to its smoothed representation.

Parameters:
  • X – The original structure space matrix (i.e., the matrix of point-wise coordinates).

  • F – The feature space matrix (i.e., the matrix of features).

  • y – The reference classes (i.e., the classification).

  • fnames – The names of the features in F, it allows to have named features in the point cloud written to the representation report path.

  • header – The header of the LAS/LAZ file representing the point cloud (OPTIONAL).

  • out_prefix – The output prefix (OPTIONAL). It might be used by a report to particularize the output path.

Returns:

The smoothed structure space matrix.

Return type:

np.ndarray

transform_pcloud(pcloud, fnames=None, ignore_y=False, out_prefix=None)

Transform the given point cloud to its smoothed representation.

Parameters:
  • pcloud (PointCloud) – The point cloud to be transformed.

  • fnames (None or list of str) – A list with the names of the features to be considered. If an empty list is given, no features will be considered. If None is given, all features will be considered.

  • ignore_y (bool) – Whether to ignore the classes (True) or to include them in the representation (False).

  • out_prefix (None or str) – The output prefix (OPTIONAL). It might be used by a report to particularize the output path.

Returns:

A new point cloud that is an FPS representation of the input one.

Return type:

PointCloud