Skip to main content

Near Miss Events Widget [NEW]

DataFromSky avatar
Written by DataFromSky
Updated over 3 weeks ago

The Near Miss Events feature detects and logs situations where objects come dangerously close to one another, helping to identify potential collision risks and enhance traffic safety monitoring. These events capture critical interactions between traffic participants, providing valuable insights for safety analysis and prevention measures.

Near Miss Events are part of FLOW’s unified Events data type, which offers structured, persistent event tracking with support for history storage and integration with external systems via API.

About Events

Events are a key data type in FLOW and provide persistent, event-oriented outputs with support for storing event history (depending on device capacity). Each event is uniquely identified by an event ID, which remains consistent across multiple runs of the FLOW BLOCK. This enables reliable referencing, improved data organization, and seamless integration with external systems via API.

Events are generated based on time-bound conditions, typically through spatial filters like gates, zones, or movements. These filters define when an event starts and when it ends, creating well-defined periods for each detected occurrence.

Each event can have three states:

  • Created – when a new event is detected.

  • Updated – when an existing event continues and its data is refreshed. Events are considered linked if they originate from the same source and their start timestamps differ by less than 100 ms.

  • Closed – when an event has not been updated for two processing ticks and is finalized.

This structured approach ensures that events accurately reflect real-world behaviors and allow dynamic updates as the traffic situation develops.

Available Attributes

The Events Widget supports the following attributes:

Near Miss Operator

The Near Miss operator filters trajectories by analyzing how close objects come to one another in space and time. It generates Near Miss Events in FLOW and offers several configurable filters to match the specific needs of your scene.

Post-Encroachment Time (PET)

The Near Miss Operator evaluates potential risks using the Post-Encroachment Time (PET) method — a widely accepted approach in traffic safety analysis. PET measures the time difference between one object leaving a potential collision point and another object arriving at the same location.

This technique is based on actual trajectory data, rather than prediction, and helps reduce false alarms. During processing, FLOW scans all object trajectories in time steps and identifies valid interactions. For each pair of intersecting paths that pass the filters, the PET value is calculated and used to classify the severity of the event.

ℹ️ Tip: Commonly used PET thresholds:

  • 1.5 seconds for high-risk near misses

  • 2.5–3 seconds for general safety analysis

Applied Filters

To ensure only relevant and actionable events are detected, the Near Miss operator applies a series of filters — some of which are user-configurable:

  • Minimum Trajectory Duration
    Ignores trajectories shorter than 1 second.

  • PET Threshold
    Ignores events with PET values exceeding the configured maximum.

  • VRU Priority
    Near misses where a Vulnerable Road User (VRU) crosses first are considered more critical.

  • Speed Filter
    Events involving only slow-moving vehicles (below 15 km/h) are discarded.

  • Angle Filter
    Excludes interactions with very shallow approach angles (below 0.3 radians, approx. 17°).

  • Duplicate Filter
    If multiple detections relate to the same situation, only the event with the most critical PET value is retained.

Visualization and Export

To log and visualize Near Miss Events, the Near miss operator must be configured first, and then an Events Widget must be attached to it with the event type set to "Near miss".

FLOW visualizes Near Miss Events directly within the camera view using PET values in seconds, rounded to one decimal place by default.

A table-based overview of recent near-miss events is also available, showing object types, PET values, timestamps, and collision coordinates. This table supports export in various formats including CSV, XLSX, image, or overlay for further analysis.

API Integration

Near Miss Events are fully supported by FLOW’s webhook and REST API interfaces.

The webhook interface allows real-time delivery of near-miss event notifications. You can configure whether to receive updates when events are created, updated, closed, or any combination of these states.

The REST API provides access to both active and historical Near Miss Events, allowing for flexible retrieval and integration with external safety systems or reporting tools.

For detailed information on working with the API, refer to the dedicated FLOW Public API article.

Previous Versions

In FLOW version 1.18 and earlier, this functionality was covered by the operator of the same name and a sink attached to it. From version 1.19, the Events widget has been the following enhancements:

Parameter/Feature

FLOW 1.18 and earlier

FLOW 1.19+

Trajectory Duration

hard coded

configurable in GUI

PET Threshold

configurable in GUI

configurable in GUI

VRUs First

not implemented

hard coded

Vehicles' Speed

hard coded

configurable in GUI

Vehicles' Angle

hard coded

configurable in GUI

# of Visualized Near Misses

limited by the last 50 trajectories

full historical view

What Next?

Learn more about widgets and sinks in FLOW, explore time processing, or check out other widget types such as Trajectory Events and Movement Set Statistics. Use the FLOW Public API to access data from widgets and sinks and integrate it with your external systems.

Make your traffic analytics smarter and more connected with FLOW.

Did this answer your question?