Skip to content

0 Areas of Interest

tasuarez edited this page Jul 4, 2019 · 8 revisions

Areas of Interest

In the first instance, defining areas of interest (AoI) will allow us to determine the boundaries of the space where the object detection will take place, so that all objects that pass through or stay within the AoI will be properly identified and tracked. One of the benefits of defining these areas of interest, is that it will help us to focus and optimize the precision of the detection model into a specific space, reducing the margin of error (false positives, misdetection, etc). With these regions defined we can also trim or mask the original frames in order to reduce the computing times of the inference and future image processing.

In the second instance, we need to define the different areas of interest that might be involved in an intersection. For this, we initially considered defining the following categories: sidewalks, crosswalks, and street. In the particular case of a street, we will be able to differentiate its orientation (North, East, South, West). Taking into account this criteria for defining AoI, we are in a position to define rules for considering dangerous scenarios, such as a car going from the street to the sidewalk while pedestrians are being detected.

Finally, due to some limitations that we have detected regarding the object detection modules, most of them related to external factors such as camera position, camera angle, video’s horizon line, etc, we have decide to give the user the option of manually drawing the desired areas of interest. This manual selection will allow us to customize the AoI according to camera conditions, for each particular case, improving the object detection model functionality.

Usage

Cropping

When running the program with the -show_selection flag, the user will be prompted to draw on the image a rectangle where to focus the detection, by dragging and dropping with the mouse click.

Crop

You can press Del to start over and F to finish.

Del

Drawing

After that the user will be prompted to draw the regions of interest that will add info to the near-misses logic, being:

  1. Streets by pressing S (default)

  2. Sidewalks by pressing W

  3. Crosswalks by pressing Z

By clicking with the left mouse button the user can draw the contours of the regions (with at least 3 points). By pressing Del you can erase the last point drawn. By pressing N, the area will be closed and the user will be able to define a new area, of any kind. Particularly, when drawing streets (after pressing N), the user will be prompted to define an orientation for it (n, s, e, w). To finish this process and proceed, press F

Streets
Sidewalks
Crosswalks

A new window will pop-up with every area drawn when the process is done.

Crosswalks

Detection or Tracking

On the next stage (detection and/or tracking), the rectangle where this process is being done will be slightly highlighted and no detection will be done outside of it.

Highlight

Implementation

The functionality of this module is done in file src/drawer.{cpp,hpp} and in src/main.cpp under the comment Define regions of interest

Near misses areas

In order to handle near misses scenarios, we are adding the possibility to draw an interest area on:

  1. Sidewalks

  2. Streets

  3. Crosswalks

A set of rules is going to be defined by using these areas. For example:

  1. A Car MUST NOT be on a sidewalk.

  2. No car and pedestrians simultaneously on a crosswalk.

  3. A car MUST NOT have 0 velocity on a crosswalk.