C/C++ library for the ViBe algorithm
|
Interface for the ViBe library. More...
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
Go to the source code of this file.
Macros | |
#define | COLOR_BACKGROUND 0 |
#define | COLOR_FOREGROUND 255 |
Typedefs | |
typedef struct vibeModel_Sequential | vibeModel_Sequential_t |
Data structure for the background subtraction model. More... | |
Interface for the ViBe library.
Full documentation is available online at: http://www.ulg.ac.be/telecom/research/vibe/doc
All technical details are available in the following paper: O. Barnich and M. Van Droogenbroeck. ViBe: A universal background subtraction algorithm for video sequences. IEEE Transactions on Image Processing, 20(6):1709-1724, June 2011.
BiBTeX information @article{Barnich2011ViBe, title = {{ViBe}: A universal background subtraction algorithm for video sequences}, author = {O. Barnich and M. {Van Droogenbroeck}}, journal = {IEEE Transactions on Image Processing}, volume = {20}, number = {6}, pages = {1709-1724}, month = {June}, year = {2011}, keywords = {ViBe, Background, Background subtraction, Segmentation, Motion, Motion detection}, pdf = {http://orbi.ulg.ac.be/bitstream/2268/145853/1/Barnich2011ViBe.pdf}, doi = {10.1109/TIP.2010.2101613}, url = {http://hdl.handle.net/2268/145853} }
See [2]
Definition in file vibe-background-sequential.h.
#define COLOR_BACKGROUND 0 |
Default label for background pixels
Definition at line 53 of file vibe-background-sequential.h.
#define COLOR_FOREGROUND 255 |
Default label for foreground pixels. Note that some authors chose any value different from 0 instead
Definition at line 54 of file vibe-background-sequential.h.
struct vibeModel_Sequential_t |
Data structure for the background subtraction model.
This data structure contains the background model as well as some paramaters value. The code is designed to hide all the implementation details to the user to ease its use.
Definition at line 63 of file vibe-background-sequential.h.
int32_t libvibeModel_Sequential_AllocInit_8u_C1R | ( | vibeModel_Sequential_t * | model, |
const uint8_t * | image_data, | ||
const uint32_t | width, | ||
const uint32_t | height | ||
) |
The two following functions allocate the required memory according to the model parameters and the dimensions of the input images. You must use the "C1R" function for grayscale images and the "C3R" for color images. These 2 functions also initialize the background model using the content of *image_data which is the pixel buffer of the first image of your stream.
model | The data structure with ViBe's background subtraction model and parameters. |
image_data | |
width | |
height |
Referenced by processVideo().
int32_t libvibeModel_Sequential_AllocInit_8u_C3R | ( | vibeModel_Sequential_t * | model, |
const uint8_t * | image_data, | ||
const uint32_t | width, | ||
const uint32_t | height | ||
) |
The pixel values of color images are arranged in the following order RGBRGBRGB... (or HSVHSVHSVHSVHSVHSV...)
model | The data structure with ViBe's background subtraction model and parameters. |
image_data | |
width | |
height |
int32_t libvibeModel_Sequential_Free | ( | vibeModel_Sequential_t * | model | ) |
Frees all the memory used by the model
and deallocates the structure.
This function frees all the memory allocated by libvibeModel_SequentialNew and libvibeModel_Sequential_AllocInit_8u_C1R or libvibeModel_Sequential_AllocInit_8u_C3R.
model | The data structure with ViBe's background subtraction model and parameters. |
Referenced by processVideo().
uint32_t libvibeModel_Sequential_GetMatchingNumber | ( | const vibeModel_Sequential_t * | model | ) |
Getter.
model | The data structure with ViBe's background subtraction model and parameters. |
uint32_t libvibeModel_Sequential_GetMatchingThreshold | ( | const vibeModel_Sequential_t * | model | ) |
Setter.
model | The data structure with ViBe's background subtraction model and parameters. |
uint32_t libvibeModel_Sequential_GetNumberOfSamples | ( | const vibeModel_Sequential_t * | model | ) |
Setter.
model | The data structure with ViBe's background subtraction model and parameters. |
uint32_t libvibeModel_Sequential_GetUpdateFactor | ( | const vibeModel_Sequential_t * | model | ) |
Getter.
model | The data structure with ViBe's background subtraction model and parameters. |
vibeModel_Sequential_t* libvibeModel_Sequential_New | ( | ) |
Allocation of a new data structure where the background model will be stored. Please note that this function only creates the structure to host the data. This data structures will only be filled with a call to libvibeModel_Sequential_AllocInit_8u_C1R.
NULL
in the case of an error. Referenced by processVideo().
uint32_t libvibeModel_Sequential_PrintParameters | ( | const vibeModel_Sequential_t * | model | ) |
ViBe uses several parameters. You can print and change some of them if you want. However, default value should meet your needs for most videos.
model | The data structure with ViBe's background subtraction model and parameters. |
int32_t libvibeModel_Sequential_Segmentation_8u_C1R | ( | vibeModel_Sequential_t * | model, |
const uint8_t * | image_data, | ||
uint8_t * | segmentation_map | ||
) |
model | The data structure with ViBe's background subtraction model and parameters. |
image_data | |
segmentation_map |
Referenced by processVideo().
int32_t libvibeModel_Sequential_Segmentation_8u_C3R | ( | vibeModel_Sequential_t * | model, |
const uint8_t * | image_data, | ||
uint8_t * | segmentation_map | ||
) |
The pixel values of color images are arranged in the following order RGBRGBRGB... (or HSVHSVHSVHSVHSVHSV...)
model | The data structure with ViBe's background subtraction model and parameters. |
image_data | |
segmentation_map |
int32_t libvibeModel_Sequential_SetMatchingNumber | ( | vibeModel_Sequential_t * | model, |
const uint32_t | matchingNumber | ||
) |
Setter.
model | The data structure with ViBe's background subtraction model and parameters. |
matchingNumber |
int32_t libvibeModel_Sequential_SetMatchingThreshold | ( | vibeModel_Sequential_t * | model, |
const uint32_t | matchingThreshold | ||
) |
Setter.
model | The data structure with ViBe's background subtraction model and parameters. |
matchingThreshold |
int32_t libvibeModel_Sequential_SetNumberOfSamples | ( | vibeModel_Sequential_t * | model, |
const uint32_t | numberOfSamples | ||
) |
Setter.
model | The data structure with ViBe's background subtraction model and parameters. |
numberOfSamples |
int32_t libvibeModel_Sequential_SetUpdateFactor | ( | vibeModel_Sequential_t * | model, |
const uint32_t | updateFactor | ||
) |
Setter.
model | The data structure with ViBe's background subtraction model and parameters. |
updateFactor | New value for the update factor. Please note that the update factor is to be understood as a probability of updating. More specifically, an update factor of 16 means that 1 out of every 16 background pixels is updated. Likewise, an update factor of 1 means that every background pixel is updated. |
int32_t libvibeModel_Sequential_Update_8u_C1R | ( | vibeModel_Sequential_t * | model, |
const uint8_t * | image_data, | ||
uint8_t * | updating_mask | ||
) |
model | The data structure with ViBe's background subtraction model and parameters. |
image_data | |
updating_mask |
Referenced by processVideo().
int32_t libvibeModel_Sequential_Update_8u_C3R | ( | vibeModel_Sequential_t * | model, |
const uint8_t * | image_data, | ||
uint8_t * | updating_mask | ||
) |
The pixel values of color images are arranged in the following order RGBRGBRGB... (or HSVHSVHSVHSVHSVHSV...)
model | The data structure with ViBe's background subtraction model and parameters. |
image_data | |
updating_mask |
This code is copyrighted by the University of Liège, Belgium. It is only shared for research purposes. Please do not distribute it. Prof. M. Van Droogenbroeck, July 2014.