Jitter removal with moving average
@awestphal1 ci sta già lavorando.
Dal 7/9/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Summary
Implement a moving-average filter to reduce positional jitter in pedestrian trajectories. The filter should smooth each pedestrian's x/y coordinates independently while preserving trajectory metadata and frame alignment.
Background / Context
Trajectory data from recordings and simulations can contain small frame-to-frame position fluctuations. These fluctuations can distort derived quantities such as speed and acceleration.
Providing a built-in smoothing utility lets users reduce this noise consistently before applying analysis methods, without manually manipulating the underlying DataFrame.
Technical Details
- Add the filtering functionality in the preprocessing API.
- Accept a configurable moving-average window size in frames.
- Smooth
X_COLandY_COLindependently for eachID_COL, ordered byFRAME_COL. - Preserve the original pedestrian IDs, frame numbers, and
TrajectoryDataframe rate. - Define and document boundary behavior for incomplete windows at the beginning and end of each trajectory.
- Validate the window size and raise an appropriate PedPy custom exception for invalid input.
- Export the public API from
pedpy/__init__.pyand add it to__all__if applicable. - Add unit tests under
tests/unit_tests/for normal operation, multiple pedestrians, boundaries, and invalid window sizes.
Acceptance Criteria
- Users can apply a moving-average filter with a specified positive window size to a
TrajectoryDatainstance or the trajectory of a specific pedestrian(s) (by ID) - Coordinates are smoothed independently per pedestrian and never use samples from another pedestrian
- Output retains all original IDs, frames, non-coordinate columns, and trajectory metadata.
- Boundary behavior is analyzed and implemented & documented:
- apply filter where possible, remove other data (trajectory may become shorter).
- adaptive window size at border
- take inspiration from scipy
- If window size is larger than trajectory, keep the original trajectory and warn the user
- Use an existing implementation, e.g. scipy
- Invalid window sizes (<=0) raise a PedPy custom exception with a useful error message.
- Unit tests cover single- and multi-pedestrian trajectories, boundary frames, and invalid input.
- The new public API is documented.
- Describe how the window size may be chosen and influence on the result
- Describe border behavior.
- Describe in which scenarios the moving average may be used to remove jitter from trajectories.
- Describe pre-conditions, when the filter may be applied, e.g., windows size vs length of trajectory.
First draft of the potential API:
traj = load_trajectory(foo)
trajectory_smoothed = moving_average(traj=traj, window_size=5, border_behavior=..)
trajectory_smoothed = moving_average(traj, ped_ids=[5, 10], window_size=5, border_behavior=..)
- Lingua principale
- Pascal
- Stelle
- 35
- Fork
- 18
- Merge medio
- 8g 12h
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PedestrianDynamics/PedPy
-
Add a neighbour cutoff to compute_individual_distancesForse già presa @chraibi l’ha presa 3 giorni fa. Apertaoptimization spatial analysis
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
PedestrianDynamics/PedPy#585 · 1 assegnatario ·
-
compute_rset_map: float arange adds an extra column of cellsForse già presa @chraibi l’ha presa 3 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
PedestrianDynamics/PedPy#581 · 1 assegnatario ·
-
compute_rset_map: fix paper reference, add a percentile methodForse già presa @chraibi l’ha presa 3 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
PedestrianDynamics/PedPy#580 · 1 assegnatario ·
-
compute_line_flow unitAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
PedestrianDynamics/PedPy#579 ·
-
Jitter removal with Savitzky-Golay filterForse di nuovo libera @awestphal1 l’ha presa 45 giorni fa e non c’è nessuna pull request aperta. Apertapre-processing
PedestrianDynamics/PedPy#578 · 1 assegnatario ·