Feature Parameters

Feature parameters according to ISO 25178-2:2021, clause 5.

Feature parameters characterize a scale-limited surface through its significant topographic features (hills and dales) rather than through the statistics of the height distribution. The feature characterization process defined by the standard consists of five stages: selection of the type of texture feature, segmentation, determination of the significant features, selection of feature attributes and computation of attribute statistics.

This module implements the segmentation by watershed (clause 5.3) together with Wolf pruning (height discrimination, Table 2) and derives the named feature parameters of clause 5.8:

  • Spd density of peaks

  • Svd density of pits

  • Spc arithmetic mean peak curvature

  • Svc arithmetic mean pit curvature

  • S5p five-point peak height

  • S5v five-point pit depth

  • S10z ten-point height

The segmentation engine is shared between hills and dales (a dale segmentation of the height data is, up to a sign, a hill segmentation of the inverted data) and is computed once per pruning value and cached.

class surfalize.feature.FeatureParameters(surface)

Bases: CachedInstance

Computes the ISO 25178-2:2021 feature parameters of a Surface by watershed segmentation and Wolf pruning.

The height data is centred on its mean once on instantiation, so that peak heights and pit depths are referenced to the mean plane of the scale-limited surface. The actual segmentation is performed lazily and cached per pruning value, so that the seven named feature parameters which share the same pruning value only trigger a single segmentation of the hills and a single segmentation of the dales.

Parameters:
surfaceSurface

Surface object on which to compute the feature parameters. Must not contain non-measured or masked points.

Methods

S10z([pruning, exclude_edge])

Calculates the ten-point height S10z in µm, the sum of the five-point peak height and the five-point pit depth.

S5p([pruning, exclude_edge])

Calculates the five-point peak height S5p in µm, the mean of the heights of the five highest peaks (referenced to the mean plane).

S5v([pruning, exclude_edge])

Calculates the five-point pit depth S5v in µm, the mean of the depths of the five deepest pits (referenced to the mean plane).

Spc([pruning, exclude_edge])

Calculates the arithmetic mean peak curvature Spc in 1/µm, the mean of the local mean curvature at the peaks of the significant hills.

Spd([pruning, exclude_edge])

Calculates the density of peaks Spd in 1/µm², the number of significant hills per unit area.

Svc([pruning, exclude_edge])

Calculates the arithmetic mean pit curvature Svc in 1/µm, the mean of the local mean curvature at the pits of the significant dales.

Svd([pruning, exclude_edge])

Calculates the density of pits Svd in 1/µm², the number of significant dales per unit area.

clear_cache()

Clears the cache for the entire instance.

create_cache_entry(method, entry, args, kwargs)

Manually creates a cache entry for the specified method.

plot_segmentation([kind, pruning, ...])

Plots the surface together with the boundaries of the significant motifs and their critical points.

S10z(pruning=5.0, exclude_edge=True)

Calculates the ten-point height S10z in µm, the sum of the five-point peak height and the five-point pit depth.

Returns:
S10zfloat
S5p(pruning=5.0, exclude_edge=True)

Calculates the five-point peak height S5p in µm, the mean of the heights of the five highest peaks (referenced to the mean plane). If fewer than five significant peaks are found, the mean is taken over those available.

Returns:
S5pfloat
S5v(pruning=5.0, exclude_edge=True)

Calculates the five-point pit depth S5v in µm, the mean of the depths of the five deepest pits (referenced to the mean plane). If fewer than five significant pits are found, the mean is taken over those available.

Returns:
S5vfloat
Spc(pruning=5.0, exclude_edge=True)

Calculates the arithmetic mean peak curvature Spc in 1/µm, the mean of the local mean curvature at the peaks of the significant hills.

Returns:
Spcfloat
Spd(pruning=5.0, exclude_edge=True)

Calculates the density of peaks Spd in 1/µm², the number of significant hills per unit area.

Returns:
Spdfloat
Svc(pruning=5.0, exclude_edge=True)

Calculates the arithmetic mean pit curvature Svc in 1/µm, the mean of the local mean curvature at the pits of the significant dales. Pits are concave, so Svc is negative.

Returns:
Svcfloat
Svd(pruning=5.0, exclude_edge=True)

Calculates the density of pits Svd in 1/µm², the number of significant dales per unit area.

Returns:
Svdfloat
plot_segmentation(kind='dale', pruning=5.0, exclude_edge=True, ax=None, cmap='jet')

Plots the surface together with the boundaries of the significant motifs and their critical points.

Parameters:
kind{‘dale’, ‘hill’}, default ‘dale’

Whether to plot the dale (pit) or hill (peak) segmentation.

pruningfloat, default 5

Wolf pruning threshold as a percentage of Sz.

exclude_edgebool, default True

If True, motifs touching the border of the evaluation area are not marked as significant features.

axmatplotlib axis, default None

If specified, the plot is drawn on the given axis.

cmapstr | mpl.cmap, default ‘jet’

Colormap applied to the height data.

Returns:
plt.Figure, plt.Axes