|
Project Information
|
CbModel LibraryCbModel is a library for motion detection based on the paper: " Background Modeling and Subtraction by Codebook Construction", by L. Davis et. al. (International Conference on Image Processing, ICIP 2004). What I need to use CbModel library?CbModel is a library for the Processing programming environment, implemented by following these guidelines. The library can be use without limitation from any Java program as well. Supported PlattformCbModel is operating system independent,tested on Ubuntu platform with Processing 1.0.3 DocumentationLinks Wiki's pages ExamplesSimple example program that analyzes a video (using video library GSMovie) and finds the foreground pixels. It uses 50 frames to build the background model and use the remaining frame for shows the image "difference" (pixel contains white / blacks that indicate the pixel foreground to background, respectively): import codeanticode.gsvideo.*;
import it.ppm.codebookmodel.*;
GSMovie myMovie;
CbModel Model;
int frame=0;
PFont Font;
void setup() {
size(385,630, P3D);
background(200);
Font = loadFont("/home/federico/bin/processing-1.0.3/examples/3D/Typography/Typing/data/Univers45.vlw");
textFont(Font, 15);
myMovie=new GSMovie(this, "/home/federico/Scrivania/ppm/video/walk1.mpg");
Model=new CbModel(this,384,288);
print(Model.getVersion());
fill(0);
text("frame:", 0, 310);
myMovie.loop();
}
void draw(){
fill(200);
rect(50,295,40,15);
fill(0);
text(frame, 50, 310);
if(frame<50){
if (myMovie.available()) {
frame=frame+1;
myMovie.read();
image(myMovie, 0,0);
try{
Model.updateModel(myMovie);
}
catch(LearningStateException Err){
println("Impossible to pass the state 'test' to the state of 'learning'...");
}
catch(WrongSizeException Err){
println("Dimension of input's image not equal to the size set in the model...");
}
}
}
else{
Model.setTestState();
if(Model.isTestState()){
if(myMovie.available()){
frame=frame+1;
myMovie.read();
image(myMovie, 0,0);
try{
image(Model.getDifferenceImage(myMovie),0,320);
}
catch(WrongSizeException Err){
println("Dimension");
}
catch(LearningStateException Err){
println("Learn");
}
}
}
}
}ApplicationsForward there are 3 programs to test the library (to set the parameters) in different scenarios:
ReleaseCbModel 0.1 is now available. LicenseCbModel is released under the LGPLv3 license.
CreditCbModel has been developed by Federico Bartoli under Contate-mail: bert1987@libero.it |