Contraction Expansion
Contraction and expansion analysis for body movement patterns.
This module provides optimized functions for analyzing contraction and expansion of body configurations in 3D space. It computes geometric shape metrics, including bounding box areas, convex hulls, and ellipsoid approximations, to track structural changes relative to a movement baseline.
BoundingBoxFilledArea
Bases: StaticFeature
Computes the Contraction Index based on 3D Surface Area.
Mathematical formulation involves computing the ratio:
where \(Area_{hull}\) is the surface area of the 3D convex hull enclosing the points, and \(Area_{bbox}\) is the surface area of the axis-aligned bounding box.
Note
This feature uses the Convex Hull area and the Axis-Aligned Bounding Box (AABB) area.
Read more in the User Guide.
Source code in pyeyesweb/low_level/contraction_expansion.py
compute(frame_data)
Compute the Contraction Index for a single frame.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in pyeyesweb/low_level/contraction_expansion.py
ContractionExpansionResult
dataclass
Bases: FeatureResult
Shared result contract for the contraction/expansion feature family.
| Attributes: |
|
|---|
Source code in pyeyesweb/low_level/contraction_expansion.py
EllipsoidSphericity
Bases: StaticFeature
Fits an ellipsoid to skeletal joints using PCA and computes shape metrics.
Sphericity is defined as the ratio of the smallest to the largest radius:
where \(c\) is the length of the shortest semi-axis (minor radius) and \(a\) is the length of the longest semi-axis (major radius) of the fitted ellipsoid.
Tip
This metric is highly robust against rotation as it relies on PCA.
Read more in the User Guide.
Source code in pyeyesweb/low_level/contraction_expansion.py
compute(frame_data)
Compute the Sphericity based on fitted ellipsoid radii.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in pyeyesweb/low_level/contraction_expansion.py
PointsDensity
Bases: StaticFeature
Computes the Points Density (Dispersion) for a sequence of skeletal frames.
where \(N\) is the total number of points, \(X_i\) is the 3D position of the \(i\)-th point, and \(\bar{X}\) is the barycenter (mean position) of all points.
Read more in the User Guide.
Source code in pyeyesweb/low_level/contraction_expansion.py
compute(frame_data)
Compute the average distance of points from their barycenter.
| Parameters: |
|
|---|
| Returns: |
|
|---|