de.unihalle.informatik.MiToBo.tracking.multitarget.datatools
Class DataConverter<S,T>

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.MiToBo.core.operator.MTBOperator
          extended by de.unihalle.informatik.MiToBo.tracking.multitarget.datatools.DataConverter<S,T>
Type Parameters:
S - input data type
T - output data type
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator

public abstract class DataConverter<S,T>
extends MTBOperator

An operator class to convert between data types. The class provides static methods for simple use. The implementations of the abstract DataConverter class are located within the static methods to reduce the number of operator class files (have a look at the implemented conversion methods)

Author:
Oliver Gress

Nested Class Summary
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode
 
Field Summary
 S inputData
           
 T outputData
           
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, portHashAccess, verbose, versionProvider
 
Constructor Summary
protected DataConverter()
           
 
Method Summary
static MTBRegion2DSetBag observationsToRegions(boolean hidden, java.util.Vector<MultiState<MotionModelID>> observations, double xmin, double xmax, double ymin, double ymax)
          Convert observations to regions.
static java.util.HashMap<java.lang.Short,int[]> observationsToTracks(java.util.Vector<MultiState<MotionModelID>> observations, java.util.HashMap<java.lang.Integer,java.util.Vector<java.lang.Integer>> clutterObs)
          Obtain observations assigned to each target from observations with assigned target IDs
static java.util.Vector<MultiState<MotionModelID>> regionsToObservations(boolean hidden, MTBRegion2DSetBag regionsets)
          Convert regions to observations
 
Methods inherited from class de.unihalle.informatik.MiToBo.core.operator.MTBOperator
readResolve
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
deserializeFromXmlFile, fieldContained, getALDPortHashAccessKey, getConstructionMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, isConfigured, operate, parametersToXmlObject, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, runOp, runOp, runOp, serializeToXmlFile, setConstructionMode, setName, setParameter, setParametersFromXml, setParametersFromXml, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory, writeParametersToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputData

@Parameter(label="inputData",
           required=true,
           direction=IN,
           description="Data that has to be converted")
public S inputData

outputData

@Parameter(label="outputData",
           required=false,
           direction=OUT,
           description="Converted data")
public T outputData
Constructor Detail

DataConverter

protected DataConverter()
                 throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

observationsToRegions

public static MTBRegion2DSetBag observationsToRegions(boolean hidden,
                                                      java.util.Vector<MultiState<MotionModelID>> observations,
                                                      double xmin,
                                                      double xmax,
                                                      double ymin,
                                                      double ymax)
                                               throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                                      de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Convert observations to regions.

Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

observationsToTracks

public static java.util.HashMap<java.lang.Short,int[]> observationsToTracks(java.util.Vector<MultiState<MotionModelID>> observations,
                                                                            java.util.HashMap<java.lang.Integer,java.util.Vector<java.lang.Integer>> clutterObs)
Obtain observations assigned to each target from observations with assigned target IDs

Parameters:
observations - observations with target IDs assigned (ID=0 means clutter)
clutterObs - if this map is not null, all clutter observations per time step are stored here (the map is cleared before)
Returns:
a map that for each target ID holds an array which stores for each time step the observation associated the target, or -1 if no observation was associated or -2 if targets was not yet observed or after last observation

regionsToObservations

public static java.util.Vector<MultiState<MotionModelID>> regionsToObservations(boolean hidden,
                                                                                MTBRegion2DSetBag regionsets)
                                                                         throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                                                                de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Convert regions to observations

Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException