gates and movements
Gates and Movements is a traffic analysis method in AITracker that allows for precise control over vehicle counting at intersections, parking lots, and complex traffic scenarios.
When to use Gates and Movements?
Use this classification method when:
Intersections with multiple traffic directions
Specific route analysis (left turn, right turn, straight ahead)
Movements counting between specific control points
Parking lots with entrances and exits
Complex traffic patterns requiring explicit checkpoint definition
How it works
Gates
Gates are control points that vehicles pass through. Each gate is defined by:
ID: Automatically assigned (A, B, C, D, ...)
Type: Determines the gate's role
Line position: Drawn on the video frame
Direction vector: Arrow perpendicular to the gate line; only crossings in arrow direction are counted
Gate Types
Entry
🟢 Green
→
Entry points to the area
Exit
🔴 Red
←
Exit points from the area
Bidirectional
🟡 Yellow
↔
Serves as both entry and exit
Movements (Routes)
Movements connect two gates to create possible travel routes. A movement cannot exist without gates:
Movement ID: Automatically generated from gate pairs (e.g., AB, AC, BA)
Direction: Derived from gate types
Entry Gate → Exit Gate: Directional movement (shown with arrows)
Color: Automatically assigned from color palette
Dependency on gates: Each movement stores
EntryGateandExitGate; if a referenced gate is removed or its type changes, related movements must be recreated
Creating Gates and Movements
Step 1: Create Gates
Navigate to Design → Gates tab
Select gate type (Entry/Exit/Bidirectional)
Click "Add Gate" button
Draw a line on the video frame at the checkpoint location
Repeat for all entry/exit points (minimum 2 gates)
Step 2: Create Movements
Navigate to Design → Movements tab
Click "Add Movement" button
Select source gate on image (entry point)
Select target gate on image (exit point)
The movement ID is automatically generated (e.g., "AB" for gate A → gate B)
The movement receives an automatic color from the palette
If no valid gates exist, movement creation is not possible
Step 3: Run Classification
Process your video files
Vehicles will be automatically assigned to movements based on which gates they cross
View results grouped by movements in the reports
Table Columns
Gates Table
ID
Gate identifier (A, B, C, ...)
Type
Gate type (Entry/Exit/Bidirectional)
Enabled
Enables or disables gate participation in counting
Operation
Remove gate, Reverse direction vector (180° flip), or rotate angle with the dial
Gate direction and Reverse operation
Each gate shows a direction arrow on the preview image. The arrow is perpendicular to the gate line and defines allowed crossing direction.
If a tracklet crosses the gate in arrow direction, the crossing is counted.
If a tracklet crosses opposite to the arrow direction, the crossing is ignored.
Use Reverse in the Gates table to flip arrow direction by 180°.
Use the dial in the same Operation cell to rotate the direction vector continuously to any angle.
Movements Table
ID
Movement identifier (AB, AC, BA, ...)
Source
Starting gate ID
Target
Ending gate ID
Vehicle Assignment
Vehicles are assigned to movements based on gate crossing detection:
Gate crossing detection: System tracks which gates each vehicle crosses
Gate pair matching: The system identifies the sequence of gates (e.g., A → B)
Movement assignment: Vehicle is assigned to the corresponding movement (e.g., "AB")
Guaranteed assignment: Only vehicles that cross defined gate pairs are counted
Best Practices
Gate placement:
Place gates at clear entry/exit boundaries
Ensure gates are perpendicular to traffic flow
Movement definition:
Define all possible routes through the area
Use descriptive gate placement for easier identification
Validation:
Review sample videos to ensure gates are correctly positioned
Check that movements cover all expected traffic patterns
Verify vehicle counting accuracy before full processing
Example: Intersection with 4 Entries
Color Palette
Movements are automatically assigned colors from the system palette in sequence:
First movement: Blue (#1F77B4)
Second movement: Orange (#FF7F0E)
Third movement: Green (#2CA02C)
Fourth movement: Red (#D62728)
... and 17 more colors in rotation
Each classification type (Gates, Movements, Relations) has its own independent color cycler, ensuring consistent visual distinction.
Tips
Start simple: Begin with basic entry/exit gates before adding complex movements
Test first: Process a short sample video to verify gate placement
Review carefully: Check the movements table to ensure all routes are covered
Last updated
Was this helpful?