Skip to content

Architecture#

The CARS Analytics architecture (Figure 1).

CARS Analytics architecture
Figure 1. CARS Analytics architecture

A detailed description of the architecture is given in Table 1.

Table 1. Description of architecture of the CARS Analytics

Component Description
Source RTSP video stream from a camera or a video file containing areas with vehicles, LP, pedestrians and animals in the frame
CARS Stream Subsystem for detecting and tracking objects in the video stream and determining the best shots
ANPR Stream Subsystem for integrating ANPR cameras into CARS Analytics
CARS API Subsystem for detection and recognition of vehicle and LP attributes
Load balancer A service for distributing requests and responses between several running copies of the CARS API, CARS Stream and CARS Analytics backend. It is supported to work only with Nginx
CARS Analytics frontend The client side of CARS Analytics, including the user interface
CARS Analytics UI CARS Analytics user interface
CARS Analytics backend The software part of CARS Analytics, which includes the CARS Analytics backend server, database, vehicle plugin and load balancers for interacting with external systems.
CARS Analytics backend server The software part of CARS Analytics responsible for the functioning of CARS Analytics which takes a frame from CARS Stream as input and sends it to the CARS API for processing the frame using classifiers
PostgreSQL DB designed to store images of the vehicle and LP, planned tasks, settings of planned tasks, events and incidents with recognized attributes of the vehicle and LP
Vehicle plugin Plugin with a set of handlers and its parameters for objects

Sequence diagram of CARS Analytics components interaction with LUNA CARS subsystems#

A diagram of the interaction of CARS Analytics components with other LUNA CARS subsystems (Figure 2).

CARS Analytics sequence diagram
Figure 2. CARS Analytics sequence diagram

A detailed description of the diagram is given in Table 2.

Table 2. Description of the sequence diagram of interaction of CARS Analytics components with LUNA CARS subsystems

Description
(1) The message containing best shot comes from CARS Stream or ANPR Stream (depending on the selected source). The message is transmitted using the callback_matager.py function and includes the best frame of the object and information about the position of the object, as well as the information about the object type. See detailed description of CARS Stream work in «CARS Stream. Administration Manual»
(2) CARS Analytics backend server processes the received message:
- Creates a background task for image processing;
- Places a task in the Celery queue;
- Refreshes the task queue list.
(3) CARS Analytics backend server sends a request to the CARS API to recognize attributes of the vehicle and LP with a list of classifiers and the best shot
(4) The request is processed by the load balancer and sent to the CARS API
(5) CARS API processes the request according to the list of classifiers. For a detailed scheme of how the CARS API works, see «CARS API. Administration Manual»
(6) CARS API returns vehicle and LP attributes to the load balancer
(7) The response is processed by the load balancer and sent to the CARS Analytics backend server
(8) CARS Analytics backend server generates a request to determine the position of objects in the vehicle plugin to determine what type of scenario (event or incident) they belong to by the type of object
(9) The Vehicle plugin processes the request
(10) The Vehicle plugin returns the scenario type information to the CARS Analytics backend server
(11) CARS Analytics backend server processes the received response, aggregates the received results and checks for compliance of the results with the applied filters (if any)
(12) CARS Analytics backend server sends a request to the database to save the vehicle and LP attributes
(13) PostgreSQL returns a response about the result of saving the best frame and attributes of the vehicle and LP to the database
(14) CARS Analytics backend server sends the best frame, recognized vehicle and LP attributes to CARS Analytics UI