TLIB documentation
 

tlBackground.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This file is part of the TLIB computer vision library.
00004 //  Copyright (C) 2003-2008 Sebastien Grange
00005 //  Copyright (C) 2003-2007 VRAI Group, EPFL
00006 //  All rights reserved.
00007 // 
00008 //  This library is free software; you can redistribute it and/or modify
00009 //  it under the terms of the GNU General Public License("GPL") version 2
00010 //  as published by the Free Software Foundation.
00011 // 
00012 //  <http://www.tuyphon.com/tlib>
00013 //
00014 /////////////////////////////////////////////////////////////////////////////////
00015 
00016 
00017 #ifndef __TLBACKGROUND_H__
00018 #define __TLBACKGROUND_H__
00019 
00020 
00021 #include "tlVision.h"
00022 
00023 
00024 class tlBackground
00025 {
00026 private:
00027         float     *mean;
00028         float     *variance;
00029 
00030 
00031         // learning params
00032         int   learn;
00033   int   adapt;
00034         float Vmin, Vmax;
00035         float alpha;
00036         float K;
00037         float Koffset;
00038 
00039 public:
00040 
00041   int       width, height;
00042   int       pixelWidth;
00043   tl_format format;  
00044   
00045   tlBackground  ();
00046   tlBackground  (float Vmin, float Vmax, float alpha, float K, float Koffset);
00047         virtual ~tlBackground ();
00048 
00049   // set parameters
00050   int setParam (float Vmin, float Vmax, float alpha, float K, float Koffset);
00051   int setLearn (int val) { return learn = val; };
00052   int setAdapt (int val) { return adapt = val; };
00053 
00054         // background definition and learning
00055         int init                (tlImage *image, int adapt = 0, int learn = 0);
00056         int update      (tlImage *image);
00057   int update  (tlImage *image, tlRect *rect);
00058 
00059         // background display
00060         int get                     (tlImage *dest);
00061   int getVariance (tlImage *dest);
00062 
00063   // foreground extraction
00064         int filter      (tlImage *image);
00065   int filter  (tlImage *image, tlRect *rect);
00066 };
00067 
00068 
00069 #endif


TLIB documentation - generated on 7 May 2008
Please address any questions to seb@tuyphon.com
(C) 2001-2008 - S. Grange
(C) 2001-2007 - VRAI Group, EPFL
All Rights Reserved.