Callback reference

As described in the custumization tutorial, py4dgeo uses a callback software architecture to allow to flexibly change components of the core algorithm while maintaining its performance. Callbacks can be implemented in Python (for rapid prototyping) or C++ (for performance). In this section, we summarize the available types of callbacks and their available implementations.

Distance + Uncertainty Calculation

This callback is responsible for calculating the distance measure and its uncertainty at one core point. The C++ signature for this callback is the following:

using py4dgeo::DistanceUncertaintyCalculationCallback = std::function<std::tuple<double, DistanceUncertainty>(const DistanceUncertaintyCalculationParameters&)>

The callback type for calculating the distance between two point clouds.

The default implementation calculates the mean and standard deviation:

std::tuple<double, DistanceUncertainty> py4dgeo::mean_stddev_distance(const DistanceUncertaintyCalculationParameters&)

Mean-based implementation of point cloud distance.

This is the default implementation of point cloud distance that takes the mean of both point clouds (center of mass), projects it onto the cylinder axis and calculates the distance.

py4dgeo.fallback.mean_stddev_distance(params: DistanceUncertaintyCalculationParameters) tuple

Alternative, a distance measure based on the median and interquartile range is available:

std::tuple<double, DistanceUncertainty> py4dgeo::median_iqr_distance(const DistanceUncertaintyCalculationParameters&)

Median-based implementation of point cloud distance.

Use median of distances in pointcloud instead of mean. This results in a more expensive but more robust distance measure.

py4dgeo.fallback.median_iqr_distance(params: DistanceUncertaintyCalculationParameters) tuple

Working Set Finder

This callback determines which points from a given epoch that are located around a given corepoint should be taken into consideration by the M3C2 algorithm. The C++ signature is the following:

using py4dgeo::WorkingSetFinderCallback = std::function<EigenPointCloud(const WorkingSetFinderParameters&)>

The callback type that determines the point cloud working subset in the vicinity of a core point.

The available implementations perform a radius and a cylinder search:

EigenPointCloud py4dgeo::radius_workingset_finder(const WorkingSetFinderParameters&)

Implementation of working set finder that performs a regular radius search.

py4dgeo.fallback.radius_workingset_finder(params: WorkingSetFinderParameters) ndarray
EigenPointCloud py4dgeo::cylinder_workingset_finder(const WorkingSetFinderParameters&)

Implementation of a working set finder that performs a cylinder search.

py4dgeo.fallback.cylinder_workingset_finder(params: WorkingSetFinderParameters) ndarray