
This code is the reference implementation of the algorithm described in:

    Semantic Background Subtraction
    Marc Braham, Sébastien Piérard and Marc Van Droogenbroeck
    ICIP 2017
    https://orbi.ulg.ac.be/handle/2268/213419

    BiBTeX format:

    @inproceedings{Braham2017Semantic, 	
      title = {Semantic Background Subtraction}, 	
      author = {M. Braham and S. Pi\'erard and M. {Van Droogenbroeck}},	
      booktitle = {IEEE International Conference on Image Processing}, 	
      year = {2017}, 	
      month = {September}, 	
      address = {Beijing, China}, 	
      url = {http://hdl.handle.net/2268/213419} 
    }

If you find this code useful, we would appreciate that you cite our paper.

Note that the semantic maps computed with the PSPNet algorithm for the CDNet 2014 dataset can be downloaded from the semantic BGS web page (http://www.telecom.ulg.ac.be/semantic).
 

HOW TO COMPILE
==============

Dependencies:
  - CMake
  - Boost
  - OpenCV 2

Compilation:
  $ cd SemanticBGS-Code
  $ cmake .
  $ make 

It should be noted that the compiled binary file is in the "bin" directory.


USAGE
=====

For help, use -h option. For instance:
$ ./semantic_bgs -h

The program performs semantic background subtraction based on a sequence of bgs masks (8-bits PNG images) and a sequence of semantic masks (16-bits PNG images). The required arguments are:

1. -b arg    (path to the folder of BGS masks)
2. -s arg    (path to the folder of semantic masks)

The thresholds tau_BG and tau_FG within the two semantic-based decision rules may be set with the following arguments:

-d arg      (tau_BG for 16-bits images, in [-1,65535])
-u arg      (tau_FG for 8-bits images, in [0,256])

The update rate of the semantic BG model may be set with the option -m arg. A path to the groundtruth of the sequence (with option -g arg) may also be provided. In this case, performance evaluations of BGS and Semantic BGS are performed. Various performance metrics are then printed. Results may be saved by setting the -r arg (path to the results). All inputs and outputs may be visualized with the option -v.

For a quick test:
$ ./bin/semantic_bgs -b "data/bungalows/bgs_PAWCS" -s "data/bungalows/semantic" -r "data/bungalows/results" -i "data/bungalows/input" -g "data/bungalows/groundtruth" -v

