Traffic Flow Algorithm
Core LogicVehicle Detection Pipeline
- Frame Capture 320x240 @ 10 FPS
- Inference Time ~50ms per frame
- Confidence Threshold >0.6 (60%)
- Aggregation Window 5 seconds
Corridor Aggregation
Sites are grouped into corridors (Mounts Bay Road, Stirling Highway) with directional filtering for accurate flow analysis.
// Corridor grouping example
corridors: {
'mounts-bay-eastbound': {
sitePatterns: ['Mounts Bay'],
directionFilter: 'Eastbound'
},
'stirling-southbound': {
sitePatterns: ['Stirling Hwy'],
directionFilter: 'Southbound'
}
}
Speed Estimation
Traffic speed is estimated using detection frequency patterns and historical calibration data. Thresholds differ by road type based on posted speed limits.
Arterial Roads (60 km/h limit)
Stirling Highway & Mounts Bay Road
Directional Flow Analysis
Each site tracks both directions independently, enabling accurate commute pattern analysis:
- Morning peak: Inbound flow dominates (towards CBD)
- Evening peak: Outbound flow dominates (towards suburbs)