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

Type
Color
Symbol
Purpose

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 EntryGate and ExitGate; if a referenced gate is removed or its type changes, related movements must be recreated

Creating Gates and Movements

Step 1: Create Gates

  1. Navigate to Design → Gates tab

  2. Select gate type (Entry/Exit/Bidirectional)

  3. Click "Add Gate" button

  4. Draw a line on the video frame at the checkpoint location

  5. Repeat for all entry/exit points (minimum 2 gates)

Step 2: Create Movements

  1. Navigate to Design → Movements tab

  2. Click "Add Movement" button

  3. Select source gate on image (entry point)

  4. Select target gate on image (exit point)

  5. The movement ID is automatically generated (e.g., "AB" for gate A → gate B)

  6. The movement receives an automatic color from the palette

  7. If no valid gates exist, movement creation is not possible

Step 3: Run Classification

  1. Process your video files

  2. Vehicles will be automatically assigned to movements based on which gates they cross

  3. View results grouped by movements in the reports

Table Columns

Gates Table

Column
Description

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

Column
Description

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:

  1. Gate crossing detection: System tracks which gates each vehicle crosses

  2. Gate pair matching: The system identifies the sequence of gates (e.g., A → B)

  3. Movement assignment: Vehicle is assigned to the corresponding movement (e.g., "AB")

  4. Guaranteed assignment: Only vehicles that cross defined gate pairs are counted

Best Practices

  1. Gate placement:

    • Place gates at clear entry/exit boundaries

    • Ensure gates are perpendicular to traffic flow

  2. Movement definition:

    • Define all possible routes through the area

    • Use descriptive gate placement for easier identification

  3. 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?