Class PathNormalizer


  • public class PathNormalizer
    extends java.lang.Object

    The 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 NormalizedPath normalize​(MouseGesture raw)
      Normalizes a @link MouseGesture into a unit-scaled @link NormalizedPath representation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PathNormalizer

        public PathNormalizer()
    • 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, null is 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.
        If the gesture distance is near zero, null is returned.