bnl.ops
This module provides the core algorithmic operations for transforming
The core components are:
A generic Strategy base class that provides a registry pattern.
Three specialized abstract strategy classes that inherit from Strategy:
SalienceStrategy: For calculating boundary importance.
CleanStrategy: For refining boundary contours.
LevelStrategy: For converting continuous salience into discrete levels.
Concrete implementations for each strategy type, which can be extended.
Classes
Abstract base class for salience calculation strategies. |
|
Salience based on frequency of occurrence. |
|
Salience based on the coarsest layer of appearance. |
|
Salience weighted by layer density. |
|
Abstract base class for boundary cleaning strategies. |
|
|
Clean boundaries by absorbing less salient ones within a window. |
|
Clean boundaries by finding peaks in a weighted kernel density estimate. |
Abstract base class for boundary level quantizing strategies. |
|
Find all distinct salience values and use their integer rank as level. |
|
|
Use mean shift clustering to find peaks in the salience values and clusters them into levels. |