Skip to main content
返回首页

如何实现~4ms计时精度

您的phone已经具备精准短跑计时所需的一切——高帧率摄像头、精密陀螺仪和强大的处理器。以下是它实现的原理。

1

亚帧精度

运动员很少在帧捕捉的精确时刻通过计时门。我们的系统分析多个帧来精确定位帧之间的通过时刻——实现远超摄像头原生帧间隔的亚毫秒级插值精度。

The interpolation works by observing the athlete's torso position in at least 3 consecutive frames as they approach and cross the timing line. By fitting a linear motion model to these positions, we solve for the precise timestamp when the torso center crossed the gate position. Because human sprinting velocity is nearly constant over short distances (the 1-2 meter detection zone), the linear model produces highly accurate results.

2

基于物理的校正

phone摄像头从上到下扫描每一帧需要数毫秒,这会根据运动员出现在画面中的位置引入时间偏移。我们自动校正这些以及其他硬件级时间误差,消除系统性误差。

TrackSpeed automatically measures the rolling shutter duration for each device and applies a per-pixel timing correction. If an athlete's torso is detected at 40% of the frame height and the rolling shutter scan takes 10ms, we apply a 4ms correction to the timestamp. This correction is applied before interpolation, ensuring the trajectory regression operates on accurate timing data. The result: rolling shutter becomes a non-factor in the final timing.

3

多设备时钟同步

使用两部phone——一部在起点,一部在终点——它们的时钟需要在毫秒级别保持一致。我们的同步协议实现设备间±3-5ms的对齐精度。同步时请将两部手机保持在约10米范围内以获得最佳效果。同步完成后,可以根据需要移至任意距离。

The sync protocol sends multiple round-trip timing probes between the two phones via peer-to-peer WiFi. By measuring send and receive timestamps on both devices, we calculate the clock offset using the same mathematical principles as the Network Time Protocol (NTP). Multiple samples are taken and outliers are rejected, achieving ±3-5ms alignment between devices. During sync, keep both phones within about 10 meters of each other for best results. Once synced, move them as far apart as needed — the offset stays locked.

4

身体追踪而非光束中断

激光门会被最先中断光束的任何物体触发——伸出的手臂、膝盖或胸部。这因跑姿而异,造成不一致。TrackSpeed追踪运动员的身体质量来确定其躯干何时越过线,与官方计时方式一致。

TrackSpeed's detection engine replicates the official approach. Our geometry-based algorithm processes each video frame at 180×320 resolution, using frame differencing to detect motion, connected component labeling to identify body regions, and size/shape filters to isolate the torso from limbs. An arm-spike suppression algorithm prevents raised arms from triggering false crossings. The result: consistent chest-based timing that matches the official standard, unlike laser gates that trigger on the nearest body part.

~4ms
有效计时精度

亚帧插值、物理校正和时钟同步相结合,仅用phone即可提供媲美专用硬件的计时精度。

对比其他系统

系统分辨率检测方式成本
FAT(官方)0.001s终点摄影摄像头$10,000+
激光门±50-200ms*首次光束中断$500-2000
TrackSpeed~4ms身体追踪您的phone
*激光门以亚毫秒速度触发,但不一致的触发点(手臂 vs 胸部)可能导致同一运动员不同次跑步之间产生50-200ms的偏差。

The Detection Pipeline

Every video frame captured by your phone's camera goes through a multi-stage detection pipeline. Here's what happens in the roughly 2ms it takes to process each frame:

1. Downsample & Extract Luma

The raw camera frame is downsampled to 180×320 pixels and converted to a grayscale (luma) image. This resolution is sufficient for accurate body detection while keeping processing fast enough for real-time analysis at 120fps.

2. Frame Differencing

Each frame is compared against the previous frame (N-1 differencing). Pixels that changed significantly — above a fixed threshold of 15 — indicate motion. This produces a binary motion mask showing where the athlete is moving.

3. Connected Component Labeling

The motion mask is analyzed using an 8-connected component labeling algorithm, which groups adjacent motion pixels into distinct blobs. Each blob is a candidate body region.

4. Size & Shape Filters

Candidate blobs are filtered by physical plausibility. A valid body region must be at least 33% of the frame height and 8% of the frame width. Fill ratio (minimum 0.20) and aspect ratio (maximum 1.2) filters reject noise, shadows, and camera shake artifacts.

5. Gate Crossing Detection

When a validated body region crosses the timing line position, a crossing event is triggered. A 0.5-second cooldown prevents double-counting from the same athlete, and gate-occupied tracking ensures each crossing is recorded exactly once.

6. Position-Based Interpolation

The crossing timestamp is refined using trajectory regression across the surrounding frames. This is where the sub-frame precision comes from — converting a discrete frame event into a continuous-time measurement with ~4ms accuracy.

Device Stability & Thermal Management

Accurate detection requires a stable camera. TrackSpeed monitors your phone's gyroscope in real-time, alerting you if the device moves during timing. The IMU (Inertial Measurement Unit) detects rotation rates as small as 0.15 rad/s — about the level of vibration from a passing truck.

Running the camera at 120fps is computationally intensive. TrackSpeed continuously monitors the device's thermal state and will warn you if the phone is overheating, which can cause frame drops and reduce timing accuracy. For sessions longer than 30 minutes, we recommend using 60fps, which maintains ~6ms accuracy with significantly lower thermal impact.

Frequently Asked Questions

How accurate is phone-based sprint timing compared to laser gates?

TrackSpeed achieves ~4ms effective timing accuracy, which is more consistent than laser gates for training purposes. Laser gates have sub-millisecond trigger speed, but they trigger on whichever body part breaks the beam first — hand, knee, or chest — creating 50-200ms of run-to-run variability. TrackSpeed tracks the chest crossing, matching official timing standards and eliminating this inconsistency.

Does TrackSpeed work without internet or WiFi?

Yes. Single-phone timing works completely offline. Multi-phone timing uses peer-to-peer WiFi Direct between the devices — no internet connection or router needed. The phones connect directly to each other.

Can TrackSpeed replace professional timing equipment?

For training purposes, yes. TrackSpeed provides the consistency and accuracy needed to track progress, compare training sessions, and make coaching decisions. For official competition results that go on record, Fully Automatic Timing (FAT) systems with photo finish cameras remain the standard — they achieve 0.001s resolution. TrackSpeed is designed for the 99% of timing that happens in training, not the 1% that happens at meets.

Why does frame rate matter for timing accuracy?

Higher frame rates give more data points for trajectory regression. At 30fps, frames are 33.3ms apart; at 60fps, 16.7ms; at 120fps, 8.3ms. More frames near the crossing moment means better interpolation accuracy. However, even at 30fps, sub-frame interpolation achieves ~10ms accuracy — still far better than manual stopwatch timing (~200ms human reaction time error).

How does multi-phone timing work?

Place one phone at the start line and one at the finish. The phones connect via peer-to-peer WiFi and synchronize their clocks using an NTP-style protocol (±3-5ms accuracy). Each phone independently detects when the athlete crosses its line. The finish phone subtracts the start timestamp from the finish timestamp to calculate the elapsed time, corrected for the measured clock offset.

What happens if my phone overheats during a session?

TrackSpeed monitors thermal state and warns you before accuracy degrades. At 120fps, sustained recording can cause thermal throttling after 20-30 minutes, leading to dropped frames. If this happens, the app suggests switching to 60fps, which uses significantly less power while maintaining ~6ms timing accuracy. For long practice sessions, 60fps is recommended from the start.

准备好计时训练了吗?

下载TrackSpeed,用phone体验毫秒级精度。