pedpy.methods.density_calculator module#
Module containing functions to compute densities.
- pedpy.methods.density_calculator.compute_classic_density(*, traj_data: DataFrame, measurement_area: Polygon) DataFrame[source]#
Compute the classic density per frame inside the given measurement area.
- Parameters
traj_data (pd.DataFrame) – trajectory data to analyze
measurement_area (shapely.Polygon) – area for which the density is computed
- Returns
DataFrame containing the columns – ‘frame’ and ‘classic density’
- Return type
DataFrame
- pedpy.methods.density_calculator.compute_passing_density(*, density_per_frame: DataFrame, frames: DataFrame) DataFrame[source]#
Compute the individual density of the pedestrian who pass the area.
- Parameters
density_per_frame (pd.DataFrame) – density per frame, DataFrame containing the columns: ‘frame’ (as index) and ‘density’
frames (pd.DataFrame) – information for each pedestrian in the area, need to contain the following columns: ‘ID’,’frame_start’, ‘frame_end’.
- Returns
DataFrame containing the columns – ‘ID’ and ‘density’ in 1/m
- Return type
DataFrame
- pedpy.methods.density_calculator.compute_voronoi_density(*, individual_voronoi_data: DataFrame, measurement_area: Polygon) Tuple[DataFrame, DataFrame][source]#
Compute the voronoi density per frame inside the given measurement area.
- Parameters
individual_voronoi_data (pd.DataFrame) – individual voronoi data per frame needs to contain the columns: ‘ID’, ‘frame’, ‘individual voronoi’, which holds a shapely.Polygon
measurement_area (shapely.Polygon) – area for which the density is computed
- Returns
DataFrame containing the columns – ‘frame’ and ‘voronoi density’, DataFrame containing the columns: ‘ID’, ‘frame’, ‘individual voronoi’, ‘intersecting voronoi’.
- Return type
Tuple[DataFrame, DataFrame]