.. _line_crossing: *************************************** Line Crossing *************************************** .. rubric:: In this chapter: .. contents:: :local: .. The line crossing functionality allows you to display notifications or collect statistics on the crossing of the object (a face, a body or a vehicle) of a pre-defined virtual line marked on the image from the camera. The line crossing functionality is an integral part of the video analytics system and plays a significant role in perimeter security. It allows you to determine the violation based on the crossing of pre-defined virtual lines by people or vehicles. In addition, the line crossing functionality allows you to collect data for further analysis of the flow of visitors in :ref:`the Analytical BI service ` and solve the following tasks: * Perimeter control and penetration into restricted areas: * passage to prohibited areas * crossing a line in a forbidden direction * Marketing analytics – analytics of the number of people or cars crossing the line in a given direction (in a shop, in the parking lot, at a bus stop, when visiting parks and public places). For example: * analysis of the flow of visitors and determine the most popular areas inside the store * analysis of the load on the transport network depending on the day of the week and time of the day and others Setting Up Video Sources ============================ For working with line crossing functionality, configure cameras and uploads. Do the following: #. Navigate to the :guilabel:`Video Sources` tab. #. Check the camera or uploads on the list to open :ref:`the processing configuration wizard `. #. Navigate to the :guilabel:`Faces`, :guilabel:`Bodies` or :guilabel:`Vehicles` tab, depending on the specified detectors. #. Check :guilabel:`Send track history`. #. Set the :guilabel:`Track maximum duration` to a value greater than 1 (the recommended value is 1000). #. Click :guilabel:`Save`. .. tip:: If there are a lot of objects in the video stream, and they begin to overlap each other periodically, which is why some line crossings may not be fixed, then you can increase the value of ``Overlap threshold`` in the camera settings for the desired detector. |line_crossing_overlap_en| .. |line_crossing_overlap_en| image:: /_static/line_crossing_overlap_en.png :scale: 70% .. |line_crossing_overlap_ru| image:: /_static/line_crossing_overlap_ru.png :scale: 70% .. tip:: If the objects are far enough away, and are poorly or not recognized at all, then you can reduce the value of ``min_size`` in the ``findface-video-worker.yaml`` file for the desired detector, for example, 32 or 16. .. code:: sudo vi /opt/findface-multi/configs/findface-video-worker/findface-video-worker.yaml ... models: cache_dir: /var/cache/findface/models_cache detectors: body: fnk_path: /usr/share/findface-data/models/detector/body.jasmine_fast.018.cpu.fnk min_size: 60 face: fnk_path: /usr/share/findface-data/models/detector/face.jasmine_fast.003.cpu.fnk min_size: 60 car: fnk_path: /usr/share/findface-data/models/detector/car.gustav_normal.004.cpu.fnk min_size: 60 ... .. important:: When reducing the value of ``min_size``, the load on server resources is increased. Create Line Crossing ============================ To create a line crossing, do the following: #. Navigate to the :guilabel:`Line Crossing` tab. #. Click :guilabel:`Create line`. |line_crossing_create_en| .. |line_crossing_create_en| image:: /_static/line_crossing_create_en.png :scale: 70% .. |line_crossing_create_ru| image:: /_static/line_crossing_create_ru.png :scale: 70% #. On the :guilabel:`Information` tab, specify the line name. Add a comment, if needed. |line_crossing_info_en| .. |line_crossing_info_en| image:: /_static/line_crossing_info_en.png :scale: 80% .. |line_crossing_info_ru| image:: /_static/line_crossing_info_ru.png :scale: 80% #. Check :guilabel:`Active`. #. Specify data source. On the :guilabel:`Camera` tab or :guilabel:`Video` tab, select a camera group and a camera or a video archive accordingly. #. Set the intersection point of the bounding box. #. On the :guilabel:`Line` tab, draw the line. |line_crossing_line_en| .. |line_crossing_line_en| image:: /_static/line_crossing_line_en.png :scale: 80% .. |line_crossing_line_ru| image:: /_static/line_crossing_line_ru.png :scale: 80% #. On the :guilabel:`BI Analytics` tab, set the line attributes for :ref:`the Analytical BI service `, if necessary. #. Click :guilabel:`Save`. #. You will see your list of lines on the :guilabel:`Line Crossing` tab. |line_crossing_list_en| .. |line_crossing_list_en| image:: /_static/line_crossing_list_en.png :scale: 60% .. |line_crossing_list_ru| image:: /_static/line_crossing_list_ru.png :scale: 60% #. By clicking the three dots, you can apply the following actions to each line crossing: * Filter events * Deactivate * Delete Filter Line Crossing ============================ The most frequently used filters for the line crossing are available in the upper part of the window. To display the entire set of filters, click the :guilabel:`More filter` button. Here it is: * :guilabel:`Name contains`: filter lines by name. * :guilabel:`ID`: display a line crossing with a given ID. * :guilabel:`Status`: filter line crossing by status. * :guilabel:`Camera group`: display only line crossing from a selected group of cameras. * :guilabel:`Cameras`: display only line crossing from a selected camera. * :guilabel:`Video archive`: display only line crossing from a selected video archive. To create a report, click :guilabel:`Apply and create report`. Monitor Line Crossing Episodes and Events ================================================= To monitor episodes and events of line crossing, navigate to the :guilabel:`Episodes & Events` tab. Click :guilabel:`Episodes` or :guilabel:`Events`. You can navigate directly to the :guilabel:`Events` tab by clicking three dots → :guilabel:`Filter face events`/:guilabel:`Filter body events`/:guilabel:`Filter vehicle events` on the list of lines. An episode ticket contains information about line crossings that have been created in all of its events (``AB`` or ``BA``). |line_crossing_episodes_en| .. |line_crossing_episodes_en| image:: /_static/line_crossing_episodes_en.png :scale: 80% .. |line_crossing_episodes_ru| image:: /_static/line_crossing_episodes_ru.png :scale: 80% Also for an event or episode, a red crossing indicates a reverse crossing: when the object has crossed the same line an even number of times and the last crossing is in reverse of the direction from which the first crossing began. |line_crossing_event_en| .. |line_crossing_event_en| image:: /_static/line_crossing_event_en.png :scale: 50% .. |line_crossing_event_ru| image:: /_static/line_crossing_event_ru.png :scale: 50% On the full frame of an episode with a line crossing, the best event of an episode with the bbox of an object is displayed, and the line with the track is displayed from the event that had a crossing. The blue color shows the beginning of the track, and the red color shows the end of the track. If there are several events with crossing in the episode, the line and track will be displayed from the first event with crossing in the episode. |line_crossing_full_frame_en| .. |line_crossing_full_frame_en| image:: /_static/line_crossing_full_frame_en.png :scale: 40% .. |line_crossing_full_frame_ru| image:: /_static/line_crossing_full_frame_ru.png :scale: 40%