ca.mcgill.cim.sre.cv4hci
Class ForegroundDetectorModel

java.lang.Object
  extended by ca.mcgill.cim.sre.cv4hci.swig.ForegroundDetector
      extended by ca.mcgill.cim.sre.cv4hci.ForegroundDetectorModel

public class ForegroundDetectorModel
extends ForegroundDetector

ForegroundDetectorModel is a thin wrapper around ForegroundDetector. This wrapper provides us with some Java features used: Serializable Parameters objects, Java's Observer design pattern (MVC), and an "activated" control variable easily disabling the execution of the detector from the GUI.

Since:
1.0

Nested Class Summary
static class ForegroundDetectorModel.Parameters
          Parameters is a class containing the parameters and other state information that can be set for this detector.
 
Field Summary
 
Fields inherited from class ca.mcgill.cim.sre.cv4hci.swig.ForegroundDetector
swigCMemOwn
 
Constructor Summary
ForegroundDetectorModel()
           
 
Method Summary
 void activate(boolean isTrue)
          Sets the activation state.
 ForegroundDetectorModel.Parameters getParameters()
          Returns the current parameters and state of this detector in a Parameters object.
 java.util.Observable getStateMonitor()
          Gets the StateMonitor (an Observable object) with which other objects implementing the Observer interface can register with.
 boolean isActivated()
          Gets the activation state.
 void run(IplImage image)
          If activated, will run the tracker and notify observers.
 void setDefaultParameters()
          Sets the current parameters and state of this detector to their default values.
 void setParameters(ForegroundDetectorModel.Parameters p)
          Sets the current parameters and state of this detector from a Parameters object.
 
Methods inherited from class ca.mcgill.cim.sre.cv4hci.swig.ForegroundDetector
delete, drawEllipse, finalize, forget, getAngleFilter, getBackground, getCPtr, getDefaultParameters, getForeground, getImage, getParameters, getPositionFilter, getSizeFilter, getTrackBox, resetFilters, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForegroundDetectorModel

public ForegroundDetectorModel()
Method Detail

getStateMonitor

public java.util.Observable getStateMonitor()
Gets the StateMonitor (an Observable object) with which other objects implementing the Observer interface can register with. When a new image has been processed, these objects are notified.

Returns:
the StateMonitor

activate

public void activate(boolean isTrue)
Sets the activation state. If set to false, even if run is called, nothing will happen.

Parameters:
isTrue - the desired activation state

isActivated

public boolean isActivated()
Gets the activation state.

Returns:
the current activation state

run

public void run(IplImage image)
If activated, will run the tracker and notify observers.

Overrides:
run in class ForegroundDetector
Parameters:
image - the image to process

getParameters

public ForegroundDetectorModel.Parameters getParameters()
Returns the current parameters and state of this detector in a Parameters object.

Returns:
the current parameters and state

setParameters

public void setParameters(ForegroundDetectorModel.Parameters p)
Sets the current parameters and state of this detector from a Parameters object.

Parameters:
p - the desired parameters and state

setDefaultParameters

public void setDefaultParameters()
Sets the current parameters and state of this detector to their default values.