---
id: wiki-2026-0508-gait-analysis-laboratory
title: Gait Analysis Laboratory
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [Gait Lab, Motion Capture Lab, Biomechanics Lab]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [biomechanics, motion-capture, sports-science, vr, game-design]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
  language: motion-capture
  framework: biomechanics
---

# Gait Analysis Laboratory

## 매 한 줄
> **"매 marker-based optical mocap + force plates + EMG 의 fusion 의 movement biomechanics 의 reconstruct"**. Gait analysis lab 매 clinical (cerebral palsy, post-stroke rehab) + sports science (running economy, ACL injury risk) + game/VR design (avatar locomotion authenticity) 의 cross 매 reference platform. 2026 매 Vicon, OptiTrack, Qualisys 매 dominant + markerless (Theia3D, OpenCap) 매 disrupting.

## 매 핵심

### 매 Stack
- **Optical mocap**: 매 12-24 IR cameras + retroreflective markers (Vicon Plug-in Gait, IOR).
- **Force plates**: 매 AMTI / Kistler 매 ground reaction force.
- **EMG**: 매 surface electrodes 매 muscle activation timing.
- **IMU**: 매 inertial sensors 매 portable / out-of-lab.

### 매 Outputs
- **Spatiotemporal**: 매 step length, cadence, stance/swing ratio.
- **Kinematics**: 매 joint angles (hip flex, knee flex, ankle dorsi).
- **Kinetics**: 매 joint moments + powers (inverse dynamics).
- **EMG envelopes**: 매 muscle activation patterns.

### 매 응용
1. Clinical — cerebral palsy surgical planning (Gillette, Shriners protocols).
2. Sports — ACL injury risk screening (Drop Vertical Jump test).
3. Game/VR — authentic locomotion data 의 IK 또는 ML retargeting.
4. Exergaming — 매 VR fitness app 매 user gait 의 detect 의 calibration.

## 💻 패턴

### C3D parsing (mocap interchange format)
```python
import ezc3d
import numpy as np

c = ezc3d.c3d('walk_trial.c3d')
markers = c['data']['points']  # shape: (4, n_markers, n_frames)
labels = c['parameters']['POINT']['LABELS']['value']
rate = c['header']['points']['frame_rate']

heel_idx = labels.index('RHEE')
heel_z = markers[2, heel_idx, :]  # vertical trajectory
```

### Heel-strike detection
```python
from scipy.signal import find_peaks

def detect_heel_strikes(heel_z: np.ndarray, rate: float) -> np.ndarray:
    # 매 heel marker 의 vertical low + GRF onset 의 align
    inverted = -heel_z
    peaks, _ = find_peaks(inverted, distance=int(rate * 0.5))
    return peaks  # frame indices

heel_strikes = detect_heel_strikes(heel_z, rate)
stride_times = np.diff(heel_strikes) / rate
cadence = 60.0 / np.mean(stride_times)
```

### Joint angle (knee flexion)
```python
def knee_angle(hip: np.ndarray, knee: np.ndarray, ankle: np.ndarray) -> np.ndarray:
    thigh = hip - knee   # (3, n_frames)
    shank = ankle - knee
    cos_t = np.einsum('ij,ij->j', thigh, shank) / (
        np.linalg.norm(thigh, axis=0) * np.linalg.norm(shank, axis=0)
    )
    return 180.0 - np.degrees(np.arccos(np.clip(cos_t, -1, 1)))
```

### Inverse dynamics (Newton-Euler, sagittal)
```python
def ankle_moment(grf: np.ndarray, cop: np.ndarray, ankle: np.ndarray,
                 segment_mass: float, segment_com: np.ndarray, segment_acc: np.ndarray,
                 g: float = 9.81) -> np.ndarray:
    # 매 simplified — full 3D 매 segment inertia tensor 의 require
    r = cop - ankle
    M_grf = np.cross(r, grf)
    inertia_term = segment_mass * (segment_acc + np.array([0, 0, g]))
    M_inertia = np.cross(segment_com - ankle, inertia_term)
    return M_grf - M_inertia
```

### Markerless (OpenPose / OpenCap-style)
```python
# 매 multi-view 2D keypoints → 3D triangulation
def triangulate(kp_views: list, P_views: list) -> np.ndarray:
    """
    kp_views: [n_views] of (n_joints, 2)
    P_views:  [n_views] of (3, 4) projection matrices
    """
    A = []
    for kp, P in zip(kp_views, P_views):
        for j, (u, v) in enumerate(kp):
            A.append(u * P[2] - P[0])
            A.append(v * P[2] - P[1])
    A = np.array(A)
    _, _, Vt = np.linalg.svd(A)
    X = Vt[-1]
    return X[:3] / X[3]
```

### Gait deviation index (GDI)
```python
def gait_deviation_index(subject_kinematics: np.ndarray,
                         reference_pcs: np.ndarray,
                         reference_mean: np.ndarray) -> float:
    # GDI: 매 subject 의 normal-database 의 PCA-distance 의 measure
    centered = subject_kinematics.flatten() - reference_mean
    scores = reference_pcs @ centered
    raw_distance = np.linalg.norm(scores[:15])
    return 100 * np.exp(-(raw_distance - REFERENCE_MEAN) / REFERENCE_STD)
```

## 매 결정 기준
| 상황 | Approach |
|---|---|
| Clinical CP / stroke | Vicon Plug-in Gait + force plates + EMG |
| Field sports screening | IMU + markerless video (OpenCap) |
| VR locomotion authoring | Mocap → IK retargeting + ML smoothing |
| Exergame user calibration | Single-IMU + heuristic (no full lab needed) |
| Research-grade longitudinal | Marker-based + standardized protocol |

**기본값**: 매 marker-based optical + force plates 매 gold standard, markerless 매 augmenting.

## 🔗 Graph
- 부모: [[Biomechanics-of-Injury]] · [[Biomedical-Engineering]]
- 응용: [[가상현실(VR) 자전거 시뮬레이터]] · [[엑서게임(Exergaming)]] · [[Beat Saber]]
- Adjacent: [[VR Sickness]] · [[Elite-Athletic-Development]] · [[동작 속도(Movement Speed)]]

## 🤖 LLM 활용
**언제**: Protocol drafting, joint-angle reporting templates, literature synthesis.
**언제 X**: Clinical diagnosis, precise inverse-dynamics validation (deterministic numerics 의 require).

## ❌ 안티패턴
- **Marker placement variability**: 매 inter-rater error 매 GDI 의 swamp.
- **No force-plate sync**: 매 inverse dynamics 매 unreliable.
- **Markerless 만 of clinical**: 매 2026 markerless 매 augment 만 — replace 매 X.
- **Single trial 의 conclusion**: 매 stride-to-stride variability 매 high — 매 5+ strides 의 average.

## 🧪 검증 / 중복
- Verified (Vicon docs, Winter "Biomechanics and Motor Control", Gillette protocol papers, OpenCap Stanford 2022-2024).
- 신뢰도 A.

## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — gait lab stack, kinematics, GDI, markerless integration |
