Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
785c7ec
added preprocessing and trajectory_projector
awestphal1 Nov 13, 2025
61be7f9
started editing user guide, added test file
awestphal1 Nov 26, 2025
12111b4
Fixed Float_Precision Problem and added tests
awestphal1 Nov 27, 2025
c5d0f8c
Current update
awestphal1 Dec 2, 2025
9ac8ec5
new distance function
awestphal1 Dec 4, 2025
1d47c0b
errors for false parameters, better structure, method for catching in…
Dec 4, 2025
15d9c87
Added Errors for Exceptions
Dec 4, 2025
62caaa6
Finish documentation
Dec 7, 2025
16c537b
Merge branch 'preproccesing' into main
Dec 7, 2025
a3d82d6
changed list structure for geo_data into dataframes
awestphal1 Feb 11, 2026
9414d93
Fixed Docstring Notation
awestphal1 Feb 12, 2026
8030b73
Updated min_ - / max_distance to user_guide
awestphal1 Feb 12, 2026
2e33e50
restored docs/source/ notebooks from main
awestphal1 Feb 12, 2026
bde30d7
Merge branch 'preproccesing'
awestphal1 Feb 12, 2026
46ac491
Merge branch 'PedestrianDynamics:main' into main
awestphal1 Feb 12, 2026
219a5d3
Fixed destroyed symlinks
awestphal1 Feb 24, 2026
3bd2c3b
Symlinks describtion for Windows User in developeterguide
awestphal1 Mar 3, 2026
f19b5be
Fixed import statements
awestphal1 Mar 3, 2026
2ac34d1
added a visualization for the min-/max-distance parameters
awestphal1 Mar 3, 2026
9aabe50
added a visualization for the min-/max-distance parameters
awestphal1 Mar 3, 2026
afa0168
Merge branch 'PedestrianDynamics:main' into main
awestphal1 Mar 3, 2026
07a1534
deleted worse .svg image
awestphal1 Mar 3, 2026
cb39276
Merge branch 'documentation_preprocessing'
awestphal1 Mar 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
771 changes: 390 additions & 381 deletions docs/source/developer_guide.rst

Large diffs are not rendered by default.

Binary file added docs/source/images/parameters_preprocessing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions notebooks/user_guide.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"execution_count": null,
"metadata": {
"jupyter": {
"is_executing": true,
"outputs_hidden": false
},
"tags": [
Expand Down Expand Up @@ -891,6 +892,67 @@
"get_invalid_trajectory(traj_data=traj, walkable_area=walkable_area_faulty)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Preprocessing\n",
"\n",
"\n",
"### Trajectory Projector\n",
"\n",
"When working with head trajectories, participants may occasionally lean over obstacles. As a result, their trajectories can leave the walkable area for some frames, and this data cannot be processed by PedPy.\n",
"\n",
"To address this, there is a function that moves trajectory points that lay inside a wall or too close to it. The distance that should remain between the point and the wall afterward is calculated by linear interpolation. The new distance lies within the interval between min_distance and max_distance:\n",
"\n",
"$$\n",
"d' = (d-b)*{(e-s) \\over (e-b)}+s\n",
"$$\n",
"\n",
"- d' is the new distance to the wall\n",
"- d is the original distance to the wall\n",
"- b corresponds to back_distance\n",
"- s corresponds to min_distance\n",
"- e corresponds to max_distance\n",
"\n",
"```{eval-rst}\n",
".. figure:: images/parameters_preprocessing.png\n",
" :width: 400px\n",
" :align: center\n",
"```\n",
"\n",
"If a point lies inside the geometry or too close to it, it will be pushed outward. The distance interval for these points starts at back_distance, which must be negative because it represents the maximum depth inside the wall, and ends at max_distance. Points located deeper inside an obstacle are assigned a smaller new distance than points located near the boundary of the interval.\n",
"\n",
"For example, a point, which lays deep inside an obstacle will receive a new distance close to min_distance, which represents the minimum possible value for new_distance. A point that is already outside the obstacle but needs to be adjusted for smoother results will also receive a new distance, but this value will be only slightly larger than its original distance.\n",
"\n",
"It is essential that max_distance is larger than min_distance, and that back_distance is negative. Depending on the geometry and the parameter values, it can also be beneficial to buffer the geometry beforehand to create thicker walls. If the walls are too thin, the function may accidentally move a point to the wrong side.\n",
"\n",
"The function returns a pedpy.TrajectoryData, either the corrected version of the trajectory or the\n",
" original trajectory, if the original trajectory was valid.\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"jupyter": {
"is_executing": true
}
},
"outputs": [],
"source": [
"from pedpy import correct_invalid_trajectories\n",
"\n",
"valid_trajectory = correct_invalid_trajectories(\n",
" trajectory_data=traj,\n",
" walkable_area=walkable_area,\n",
" min_distance_obst=0.01,\n",
" max_distance_obst=0.05,\n",
" back_distance_obst=-0.5,\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
Loading