-
Notifications
You must be signed in to change notification settings - Fork 5
Arguments of the program
In this repository, LaBGen-P is provided with a ready-to-use program, able to estimate the stationary background of any video sequence. Since the possibilities of this program are numerous, a long list of options is available. This page aims at explaining the different options and the allowed combinations.
Once the program has been compiled, the following command gives the complete list of available options:
$ ./LaBGen-P-cli --help
The syntax used to provide the path of the input video sequence is the same one used by the OpenCV library. Thus, for instance, one can generate a stationary background image for the IBMtest2 sequence of the SBI dataset with (S, N) = (5, 3) as follows:
$ ./LaBGen-P-cli -i path_to_IBMtest2/IBMtest2_%6d.png -o my_output_path -s 5 -n 3
One can directly use the default set of parameters with the -d
option:
$ ./LaBGen-P-cli -i path_to_IBMtest2/IBMtest2_%6d.png -o my_output_path -d
One can observe the processing performed by LaBGen-P in a graphical window by adding the -v
option:
$ ./LaBGen-P-cli -i path_to_IBMtest2/IBMtest2_%6d.png -o my_output_path -d -v
With this last option, the processing will be significantly slower as an estimation of the stationary background is generated after each frame in the corresponding window. Here is an example of the execution of the program with the -v
option:
By default, all the items to observe are gathered in a unique window. If, for any reason, a graphical window per item is required, one can add the -l
option along with -v
:
It is possible to customize the width and height of an image to visualize. For instance, using the options -w
(to set the width) and -h
(to set the height), one is able to resize each image to display in 400x400:
$ ./LaBGen-P-cli -i path_to_IBMtest2/IBMtest2_%6d.png -o my_output_path -d -v -w 400 -h 400
By adding the -k
option, the aspect ratio is kept:
Last but not least, one is able to record the processing in a video file using the MJPEG codec embedded in an AVI container. The -r
record option takes two arguments. The first one is the path of the recorded video file, the second one (which is optional) is the recording frame rate (set by default to 15 fps). Thus, using the following command, the processing is recorded at 15 fps:
$ ./LaBGen-P-cli -i path_to_IBMtest2/IBMtest2_%6d.png -o my_output_path -d -r path_to_recorded_video.avi
while it is recorded at 26 fps using the following one:
$ ./LaBGen-P-cli -i path_to_IBMtest2/IBMtest2_%6d.png -o my_output_path -d -r path_to_recorded_video.avi 26
Note that the options -w
(set width), -h
(set height), -k
(keep aspect ratio), and -r
(record) cannot be used with split windows (-l
). It is not mandatory to enable visualization to record a video file. Furthermore, the -r
(record) option can be combined with -w
(width), -h
(height), and -k
(keep aspect ratio).
Finally, one can use the -t
option to define (in ms) the time to wait between the processing of two frames when the visualization is enabled (this options has no impact on recording). This time is given to the waitKey()
function of OpenCV. Consequently, the option -t 0
means that you have to press any key to process the next frame. By default, the time is defined to 1 ms.