Main Page | Namespace List | Class List | File List | Class Members

ForegroundDetector Class Reference

ForegroundDetector is a class that wraps functionality from OpenCV. More...

#include <ForegroundDetector.h>

List of all members.

Public Member Functions

void setParameters (const CvFGDStatModelParams &p)
 Sets parameters of the foreground detector.
void getParameters (CvFGDStatModelParams &p) const
 Gets the currently used parameters by the foreground detector.
SimpleManeuveringFiltergetPositionFilter ()
 Gets the SimpleManeuveringFilter object used to filter the x,y position.
SimpleManeuveringFiltergetSizeFilter ()
 Gets the SimpleManeuveringFilter object used to filter the size (width, height).
SimpleManeuveringFiltergetAngleFilter ()
 Gets the SimpleManeuveringFilter object used to filter the angle.
void resetFilters ()
 Resets all three SimpleManeuveringFilter objects to their default parameters.
void run (IplImage *frame)
 Runs the detector and processes the image (frame).
IplImage * getImage () const
 Returns the last image we received through the run() function.
IplImage * getForeground () const
 Returns an image representing what the detector feels is the foreground.
IplImage * getBackground () const
 Returns an image representing what the detector feels is the background.
void drawEllipse (IplImage *image) const
 Draws an ellipse representing the position, size and angle of the foreground object (assuming there is only one).
CvBox2D getTrackBox () const
 Returns the actual "tracking" information of the "tracked" object (assuming there is only one).
void forget ()
 Makes the detector erase its background model and start anew its training.

Static Public Member Functions

static CvFGDStatModelParams getDefaultParameters ()
 Gets the default parameters of the foreground detector.


Detailed Description

ForegroundDetector is a class that wraps functionality from OpenCV.

It segments an assumed foreground object from a mostly static background. If there is only one foreground object detected, its position, size and angle are also computed automatically by moment analysis. Otherwise the information returned is related to the average position, size, and angle of the multiple objects. It also uses SimpleManeuveringFilter objects to smooth out noise from the measured values.

To use this object, set the filters and parameters if desired, then call run() for every image you have. You can then call getForeground(), getBackground(), and getTrackBox() to get images of the foreground and the background, and an idea of where an object is and its size, assuming there is only one.

Author:
Samuel Audet
Version:
1.0, 2006-01-21
Since:
1.0


Member Function Documentation

void ForegroundDetector::drawEllipse IplImage *  image  )  const
 

Draws an ellipse representing the position, size and angle of the foreground object (assuming there is only one).

Parameters:
image the image to draw an ellipse on

void ForegroundDetector::forget  )  [inline]
 

Makes the detector erase its background model and start anew its training.

Takes effect at next run call.

SimpleManeuveringFilter& ForegroundDetector::getAngleFilter  )  [inline]
 

Gets the SimpleManeuveringFilter object used to filter the angle.

Returns:
SimpleManeuveringFilter of the angle

IplImage * ForegroundDetector::getBackground  )  const
 

Returns an image representing what the detector feels is the background.

Returns:
the background image

CvFGDStatModelParams ForegroundDetector::getDefaultParameters  )  [static]
 

Gets the default parameters of the foreground detector.

Returns:
default parameters

IplImage * ForegroundDetector::getForeground  )  const
 

Returns an image representing what the detector feels is the foreground.

The background is represented as pure black.

Returns:
the foreground image

IplImage* ForegroundDetector::getImage  )  const [inline]
 

Returns the last image we received through the run() function.

Returns:
last image received, usually from camera

void ForegroundDetector::getParameters CvFGDStatModelParams &  p  )  const [inline]
 

Gets the currently used parameters by the foreground detector.

Returns:
current active parameters

SimpleManeuveringFilter& ForegroundDetector::getPositionFilter  )  [inline]
 

Gets the SimpleManeuveringFilter object used to filter the x,y position.

Returns:
SimpleManeuveringFilter of the x,y position

SimpleManeuveringFilter& ForegroundDetector::getSizeFilter  )  [inline]
 

Gets the SimpleManeuveringFilter object used to filter the size (width, height).

Returns:
SimpleManeuveringFilter of the size (width, height)

CvBox2D ForegroundDetector::getTrackBox  )  const [inline]
 

Returns the actual "tracking" information of the "tracked" object (assuming there is only one).

That is, the position, the size, and the angle.

Returns:
the position, size and angle information

void ForegroundDetector::run IplImage *  frame  ) 
 

Runs the detector and processes the image (frame).

Parameters:
frame image to process

void ForegroundDetector::setParameters const CvFGDStatModelParams &  p  )  [inline]
 

Sets parameters of the foreground detector.

For information on these parameters, check cvaux.h to see the fields of the structure and read: Interface of ACM MM2003 algorithm (Liyuan Li, Weimin Huang, Irene Y.H. Gu, and Qi Tian. "Foreground Object Detection from Videos Containing Complex Background. ACM MM2003") http://portal.acm.org/citation.cfm?id=957017

Parameters:
p a structure containing the desired parameter values


The documentation for this class was generated from the following files:
Generated on Sun Feb 19 21:44:51 2006 for CV4HCI by  doxygen 1.4.4