Flussonic Watcher documentation

Contents

License Plate Detection Events

Flussonic can detect license plates and recognize Russian car numbers on the video transmitted by an IP camera (including special transport like Emergency and Fire cars). This functionality is known as ANPR (automatic number plate recognition).

Flussonic does the following:

  • Creates events of license plate detection.

    Video comes from IP cameras to a streamer (in cluster mode) or to the managing server (in single mode), where the number recognition takes place.

  • Provides the Watcher UI for viewing plate detection events.

    You can view registered events and watch the recorded video of each event.

  • Provides the API for integration with external services.

To start detecting car numbers:

  1. Prepare hardware and software for the Flussonic server that will carry out number recognition.

  2. Turn on and configure the car number recognition. To configure the feature, use the web interface or the configuration file, but please remember that some options can be set only through the file.

On this page:

Installing the ANPR module

To start using number recognition, install Flussonic Media Server and Watcher first (if you didn't have them installed). The ANPR module can work both in cluster and single mode of Flussonic and Watcher installation.

Number recognition takes splace on a streaming server in cluster mode or on a managing server in single mode. To this server, you need to connect cameras that transmit video from the place where you want to detect car numbers. This server must have at least one high-performance videocard GPU NVIDIA with at least 6 Gb video memory.

System requirements for Flussonic's ANPR module

  • ОS: Ubuntu 16.04 x64
  • GPU: Nvidia (Pascal) minimum 6 GB VRAM (for a certain project we could tell more exactly how much memory is required).
  • CPU: 4+ cores
  • RAM: 8+ GB
  • Flussonic Media Server (on streamers in a cluster)
  • Flussonic Media Server + Watcher (single server)

Attention. In a cluster installation, the number recognition module works on a streamer server, where Flussonic Media Server must be installed first. If you use a single server, install Flussonic Media Server and Watcher before you install the recognition system.

Installation

To install the number recognition module, add the official Nvidia repository to the system and then install the flussonic-vision package from the Flussonic's repository:

wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.2.148-1_amd64.deb
dpkg -i cuda-repo-ubuntu1604_9.2.148-1_amd64.deb
apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
apt update
apt install flussonic-vision

Setting up ANPR in the configuration file

Note. You can do the same through the Watcher UI – the settings will be saved to the config file automatically. But you will still need to check the GPU number in the file and edit it, if necessary.

  1. Open the file /etc/flussonic/flussonic.conf.
  2. Add the line plugin vision;, which enables the recognition system.
  3. Add the vision directive to a stream's settings, and specify the GPU number:
stream cam1 {
  url rtsp://192.168.0.11:554/h264;
  vision gpu=0;
}

stream cam2 {
  url rtsp://192.168.0.12:554/h264;
  vision gpu=1;
}

plugin vision;
  • gpu (required) – GPU number. You can get it by using the nvidia-smi tool.

By default, the recognition system searches for car numbers over all the field of view of a camera.

Reload the configuration so that the changes made to the file take effect.

Setting up ANPR in the UI

Pre-condition

Before you configure cameras in the UI, make sure you enable the recognition system. Add the line plugin vision; to the configuration file /etc/flussonic/flussonic.conf.

Enabling license number recognition

To turn on plate detection and number recognition for a camera:

  1. In the Watcher UI, go to Cameras. Find the camera in the list and open its settings by clicking the icon in the upper right corner of the player.

  2. Select the License plate recognition check box and click Save.

    Now Flussonic will recognize car numbers that appear in the frame of this camera, and mark the time when the car entered and left the scene. Flussonic modifies the stream settings in the configuration file /etc/flussonic/flussonic.conf.

  3. You may need to edit the GPU number manually in the configuration file (see the previous section about setting up ANPR in the configuration file).

ANPR

Viewing ANPR events in Watcher

Flussonic creates events of two types:

  • enter – a car number appeared in the field of view of a camera
  • leave – a car number left the field of view.

To see detected car numbers for a camera:

  1. In the Watcher UI, go to Notifications. The list of all events opens.
  2. To find certain events, use filtering and search capabilities on the right:

    • In Source, select Plate detector.

      ANPR

    • In From and To, select the date and time of beginning and end of the period when events were detected.

      ANPR

    • In Search, type the car number.

    • To delete the specified search criteria, click Clear Filter.

  3. The list of events is filtered as you enter search parameters.

  4. To view the recording of an event, click in the line with this event. The player will appear on the bottom right to play the recording. To enlarge the player, just double-click it.

    ANPR

The API of the ANPR module

After you correctly set up the recognition module, you can get events data in the JSON format via the Watcher API.

The detailed API reference is availabe at https://flussonic.github.io/watcher-docs/api.html.

Below is an example of an API request and a response:

root@ubuntu:~# curl localhost/vsaas/api/v2/events?type=activity -H 'x-vsaas-api-key: dfb21d1f-3e00-44a2-a706-36d99f9e9d73'
  {
    "start_at": 1538645882872,
    "type": "activity",
    "id": "7ecb0a13-414c-462f-a206-3c5d047baad4",
    "ext_data": null,
    "object_id": "A123AA 77",  
    "end_at": null,
    "source": "plate_detector",
    "camera_id": "cam0-00",
    "source_id": "0",
    "object_class": "leave",
    "event_data": null
  }
  • start_at - the start time of an event
  • id - a unique ID of the record
  • object_id - car number
  • camera_id - camera name in Watcher
  • object_class - the event, which can be enter or leave (a car entered or left the camera's field of view).