Class PathNormalizer
- java.lang.Object
-
- com.kraken.api.input.mouse.strategy.replay.PathNormalizer
-
public class PathNormalizer extends java.lang.ObjectThe PathNormalizer class is responsible for standardizing a raw mouse gesture path into a normalized and reusable format. Normalized paths simplify comparisons of different gestures by transforming them into a generic dataset that operates in a normalized coordinate and time space.
This allows the resulting path to be device-independent and facilitates further analysis, validation, and categorization of gesture behavior.
The normalize() method returns a NormalizedPath, which encapsulates relevant metadata and the transformed points representing the gesture.
-
-
Constructor Summary
Constructors Constructor Description PathNormalizer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NormalizedPathnormalize(MouseGesture raw)Normalizes a @link MouseGesture into a unit-scaled @link NormalizedPath representation.
-
-
-
Method Detail
-
normalize
public static NormalizedPath normalize(MouseGesture raw)
Normalizes a @link MouseGesture into a unit-scaled @link NormalizedPath representation.This method processes the raw motion data of a gesture to create a scaled, translated, and rotated form that aligns with the X-axis and maps all data points into a 0.0 to 1.0 range for spatial and temporal dimensions. The normalization ensures geometric and temporal consistency for gesture comparison.
- Parameters:
raw- The @link MouseGesture instance containing raw input data to be normalized. Must include all point data, start and end coordinates, duration, and other metadata. If the input gesture has zero or near-zero distance,nullis returned.- Returns:
- A normalized @link NormalizedPath object containing:
- The gesture's original label.
- The original distance and duration.
- A list of @link UnitPoint instances, each representing a normalized spatial and temporal data point.
nullis returned.
-
-