Class AbstractObjectTracker

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.SizeOfHandler, ObjectTracker, Serializable
    Direct Known Subclasses:
    AbstractSimpleReportBasedObjectTracker, MultiObjectTracker

    public abstract class AbstractObjectTracker
    extends adams.core.option.AbstractOptionHandler
    implements ObjectTracker, adams.core.QuickInfoSupporter
    Ancestor for object trackers.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean m_Initialized
      whether the tracker has been intialized.
      protected List<adams.core.base.QuadrilateralLocation> m_LastLocations
      the last location(s).
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected String checkInitTracking​(adams.data.image.AbstractImageContainer cont, List<adams.core.base.QuadrilateralLocation> locations)
      Performs checks before the tracking is initialized.
      protected String checkTrackObjects​(adams.data.image.AbstractImageContainer cont)
      Performs checks before tracking an object.
      protected abstract String doInitTracking​(adams.data.image.AbstractImageContainer cont, List<adams.core.base.QuadrilateralLocation> locations)
      Performs the actual initialization of the tracking.
      protected abstract List<adams.core.base.QuadrilateralLocation> doTrackObjects​(adams.data.image.AbstractImageContainer cont)
      Performs the actual tracking of the object.
      protected abstract List<adams.core.base.QuadrilateralLocation> getInitialLocations​(adams.data.image.AbstractImageContainer cont)
      Returns the initial object locations.
      String getQuickInfo()
      Returns a quick info about the actor, which will be displayed in the GUI.
      String initTracking​(adams.data.image.AbstractImageContainer cont)
      Initializes the tracker.
      boolean isInitialized()
      Returns whether the tracker has been initialized.
      protected List<adams.core.base.QuadrilateralLocation> postProcessTrackedObjects​(adams.data.image.AbstractImageContainer cont, List<adams.core.base.QuadrilateralLocation> locations)
      Hook method for post-processing the tracked objects.
      protected void reset()
      Resets the scheme.
      List<adams.core.base.QuadrilateralLocation> trackObjects​(adams.data.image.AbstractImageContainer cont)
      Performs the tracking of the object.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_Initialized

        protected boolean m_Initialized
        whether the tracker has been intialized.
      • m_LastLocations

        protected List<adams.core.base.QuadrilateralLocation> m_LastLocations
        the last location(s).
    • Constructor Detail

      • AbstractObjectTracker

        public AbstractObjectTracker()
    • Method Detail

      • reset

        protected void reset()
        Resets the scheme.
        Overrides:
        reset in class adams.core.option.AbstractOptionHandler
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the actor, which will be displayed in the GUI.
        Default implementation does nothing.
        Specified by:
        getQuickInfo in interface adams.core.QuickInfoSupporter
        Returns:
        null if no info available, otherwise short string
      • getInitialLocations

        protected abstract List<adams.core.base.QuadrilateralLocation> getInitialLocations​(adams.data.image.AbstractImageContainer cont)
        Returns the initial object locations.
        Parameters:
        cont - the current image container
        Returns:
        the locations, null if failed to determine
      • checkInitTracking

        protected String checkInitTracking​(adams.data.image.AbstractImageContainer cont,
                                           List<adams.core.base.QuadrilateralLocation> locations)
        Performs checks before the tracking is initialized.
        Parameters:
        cont - the image to use for initializing
        locations - the initial location(s) of the object(s)
        Returns:
        true if successfully initialized, error message otherwise
      • doInitTracking

        protected abstract String doInitTracking​(adams.data.image.AbstractImageContainer cont,
                                                 List<adams.core.base.QuadrilateralLocation> locations)
        Performs the actual initialization of the tracking.
        Parameters:
        cont - the image to use for initializing
        locations - the initial location(s) of the object(s)
        Returns:
        true if successfully initialized, error message otherwise
      • initTracking

        public String initTracking​(adams.data.image.AbstractImageContainer cont)
        Initializes the tracker.
        Specified by:
        initTracking in interface ObjectTracker
        Parameters:
        cont - the image to use for initializing
        Returns:
        true if successfully initialized, error message otherwise
      • isInitialized

        public boolean isInitialized()
        Returns whether the tracker has been initialized.
        Specified by:
        isInitialized in interface ObjectTracker
        Returns:
        true if initialized
      • checkTrackObjects

        protected String checkTrackObjects​(adams.data.image.AbstractImageContainer cont)
        Performs checks before tracking an object.
        Parameters:
        cont - the current image
        Returns:
        null if checks passed, otherwise error message
      • doTrackObjects

        protected abstract List<adams.core.base.QuadrilateralLocation> doTrackObjects​(adams.data.image.AbstractImageContainer cont)
        Performs the actual tracking of the object.
        Parameters:
        cont - the current image
        Returns:
        the location(s) of the tracked object(s), null if failed to track
      • postProcessTrackedObjects

        protected List<adams.core.base.QuadrilateralLocation> postProcessTrackedObjects​(adams.data.image.AbstractImageContainer cont,
                                                                                        List<adams.core.base.QuadrilateralLocation> locations)
        Hook method for post-processing the tracked objects.
        Parameters:
        cont - the current image
        locations - the location(s) of the tracked object(s)
        Returns:
        the (potentially) updated location(s) of the tracked object(s)
      • trackObjects

        public List<adams.core.base.QuadrilateralLocation> trackObjects​(adams.data.image.AbstractImageContainer cont)
        Performs the tracking of the object.
        Specified by:
        trackObjects in interface ObjectTracker
        Parameters:
        cont - the current image
        Returns:
        the location of the tracked image, null if failed to track