S5p (Five-point peak height)
The watershed algorithm is employed to partition regions, which are used in the calculation of feature parameters.
Water is poured into the surface landscape and it runs along the surface shape and reaches the pit. Upon continuing to pour water, the water surfaces of water filling different pits make contact with each other. The set of these contact points is the ridge line that partitions the dale region. The same approach can be applied to the hill region by vertically inverting the process.
Peaks and pits merely need to be higher or lower that other points in their respective neighborhoods. For this reason, a surface with fine asperity can have a vast number of peaks and pits. Applying the watershed algorithm to such surfaces can result in meticulous segmentation into minute peak and valley regions.
In order to suppress this over-segmentation, the Wolf pruning method is used to remove regions below a certain height/depth threshold.
The threshold is provided as a percentage of the maximum height (Sz) of the surface. The default value is 5%.