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, Stirling Highway, Mitchell Freeway, Kwinana Freeway) with directional filtering for accurate flow analysis.
// Corridor grouping example
corridors: {
'mounts-bay-eastbound': {
sitePatterns: ['Mounts Bay'],
directionFilter: 'Eastbound'
},
'mitchell-northbound': {
sitePatterns: ['Mitchell Fwy'],
directionFilter: 'Northbound'
}
}
Speed Estimation
Traffic speed is estimated using detection frequency patterns and historical calibration data. Higher detection rates typically correlate with slower traffic due to increased vehicle density.
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)
- Freeway multipliers: 1.5x stronger directional bias than arterials