A powerful tool for analyzing football match data with dual visualization comparing traditional pitch control vs. distance-based team influence zones.
- Launch the application:
python interactive_gui.py - Load match data: Select tracking and event data files
- Choose event: Pick any match event from the dropdown
- Analyze: Click "Analyze" to see side-by-side comparison
- Experiment: Adjust parameters in real-time with auto-update
- Traditional Pitch Control (Left Panel): Metrica Sports framework using player velocities and reaction times
- Team Influence Zones (Right Panel): Distance-based exponential decay model with competitive territorial mapping
- Elliptical Influence Zones: Player-direction oriented zones instead of circles
- Infinite Radius Mode: Field-wide influence coverage
- Disable Closest Player: Turn off automatic assignment for uncontrolled areas
- Real-time Updates: Auto-refresh visualizations as you adjust parameters
- Python 3.8+
- Required packages:
numpy,pandas,matplotlib,tkinter - Data format: FIFA tracking data (CSV) + event data (JSON)
# Install dependencies
pip install -r requirements.txt
# Launch the application
python interactive_gui.py- Tracking Data: Load CSV files with player positions (
Home_[player]_x,Home_[player]_y) - Event Data: Load JSON files with match events and timestamps
- Radius (1-50m): Distance cutoff for influence zones
- Decay Factor (0.1-20.0): How quickly influence decreases with distance
- Elliptical Zones: Orient influence based on player movement direction
- Ellipse Ratio (1.0-5.0): Forward/backward influence ratio
- Forward Shift (0.0-1.0): How much to shift influence center forward
- ☑️ Infinite Radius: Cover entire field (ignores radius setting)
- ☑️ Disable Closest Player: Don't assign uncontrolled pixels to nearest player
- ☑️ Auto-update: Refresh visualization when parameters change
📁 Pitch control+distance/
├── 🎯 interactive_gui.py # MAIN APPLICATION - Launch this!
├── ⚙️ team_influence_analysis.py # Core influence calculation engine
├── 🔧 data_converter.py # FIFA data format converter
├── 📊 LaurieOnTracking/ # Metrica pitch control framework
├── 📂 match_data/ # Sample tracking data
├── 📂 Event Data.../ # Sample event data
├── 📋 requirements.txt # Python dependencies
└── 📖 README.md # This documentation
# Distance-based exponential decay
influence = exp(-decay_factor * (distance / max_radius))
# Elliptical enhancement
if use_elliptical:
distance = elliptical_distance(player_direction, ellipse_ratio)
# Competitive assignment
controlling_team = argmax([home_influence, away_influence])- Radius: 1-50m (or infinite for field-wide coverage)
- Decay: 0.1-20.0 (higher = sharper boundaries)
- Ellipse Ratio: 1.0-5.0 (forward influence extension)
- Forward Shift: 0.0-1.0 (ellipse center displacement)
- Player positions:
Home_[player]_x,Home_[player]_y - Time synchronized with event data
- Metric coordinates (meters)
- Event types, timestamps, positions
- Frame synchronization with tracking data
- FIFA standard format
- Distance Calculation: Euclidean distance from players to grid points
- Influence Model: Exponential decay within max radius, zero beyond
- Competition: Home and away influences compete at each grid point
- Visualization: 50x50 grid resolution, side-by-side comparison
- Tactical Analysis: Understand territorial control patterns
- Player Positioning: Analyze optimal defensive and offensive positions
- Space Creation: Identify areas of contested vs. dominated territory
- Model Comparison: Compare traditional vs. distance-based approaches
- Blue/Red intensity: Probability of ball control by each team
- Based on: Player positions, velocities, reaction times
- Physics model: Assumes players move toward ball with realistic constraints
- Blue/Red regions: Territorial control based purely on distance
- Sharp boundaries: Clear zones of influence competition
- Customizable: Adjust shape, decay, and coverage parameters
PitchControlAnalysisGUI: Main application interfacePlayerInfluenceZones: Core influence calculation enginecalculate_elliptical_distance(): Directional influence geometry
- GUI controls: Add to
interactive_gui.pyparameter frame - Calculations: Extend
team_influence_analysis.py - Visualization: Modify plot generation in analysis thread
- Follow PEP 8 standards
- Document all public methods
- Use type hints where possible
- Test with multiple data sets
- Grid resolution: 50x50 for real-time performance
- Threading: Analysis runs in background to keep GUI responsive
- Memory usage: ~50MB for typical match analysis
- Processing time: 1-3 seconds per event analysis
- Tactical Analysis: Compare territorial control methods
- Player Evaluation: Assess positioning and influence
- Match Insights: Identify key moments and spaces
- Research: Validate new influence models against established pitch control
⚽ Ready to analyze? Launch python interactive_gui.py and explore!