Package adams.data.objectoverlap
Class AbstractObjectOverlap
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.objectoverlap.AbstractObjectOverlap
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,ObjectOverlap
,Serializable
- Direct Known Subclasses:
AreaRatio
,IntersectOverUnionRatio
,Null
public abstract class AbstractObjectOverlap extends AbstractOptionHandler implements ObjectOverlap
Ancestor for schemes that calculate image overlaps.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_CopyMetaData
whether to copy meta-data.protected boolean
m_ExcludeIdentical
whether to skip identical objects, i.e., not count them as overlaps.protected BaseString[]
m_MetaDataKeys
the meta-data keys to copy.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.data.objectoverlap.ObjectOverlap
ADDITIONAL_OBJ, UNKNOWN_LABEL
-
-
Constructor Summary
Constructors Constructor Description AbstractObjectOverlap()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addMatch(Map<LocatedObject,Map<LocatedObject,Double>> matches, LocatedObject thisObj, LocatedObject otherObj, double score)
Records the match for the object.LocatedObjects
calculate(LocatedObjects annotations, LocatedObjects predictions)
Computes the overlapping objects between the annotations and the predictions.protected String
check(LocatedObjects annotations, LocatedObjects predictions)
Computes the overlapping objects between the annotations and the predictions.protected void
copyMetaData(LocatedObject source, LocatedObject target)
Copies the specified meta-data values (if available) from source to target.String
copyMetaDataTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected abstract LocatedObjects
doCalculate(LocatedObjects annotations, LocatedObjects predictions, Map<LocatedObject,Map<LocatedObject,Double>> matches)
Computes the overlapping objects between the annotations and the predictions.String
excludeIdenticalTipText()
Returns the tip text for this property.boolean
getCopyMetaData()
Returns whether to copy meta-data values across.boolean
getExcludeIdentical()
Returns whether to exclude identical objects from the comparison.BaseString[]
getMetaDataKeys()
Returns the keys of the meta-data values to copy across.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.protected void
initMatch(Map<LocatedObject,Map<LocatedObject,Double>> matches, LocatedObject thisObj)
Initializes the matches for the object.Map<LocatedObject,Map<LocatedObject,Double>>
matches(LocatedObjects annotations, LocatedObjects predictions)
Computes the overlapping objects between the annotations and the predictions and returns the matches.String
metaDataKeysTipText()
Returns the tip text for this property.void
setCopyMetaData(boolean value)
Sets whether to copy meta-data values across.void
setExcludeIdentical(boolean value)
Sets whether to exclude identical objects from the comparison.void
setMetaDataKeys(BaseString[] value)
Sets the keys of the meta-data values to copy across.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_ExcludeIdentical
protected boolean m_ExcludeIdentical
whether to skip identical objects, i.e., not count them as overlaps.
-
m_CopyMetaData
protected boolean m_CopyMetaData
whether to copy meta-data.
-
m_MetaDataKeys
protected BaseString[] m_MetaDataKeys
the meta-data keys to copy.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setExcludeIdentical
public void setExcludeIdentical(boolean value)
Sets whether to exclude identical objects from the comparison.- Parameters:
value
- true if to exclude
-
getExcludeIdentical
public boolean getExcludeIdentical()
Returns whether to exclude identical objects from the comparison.- Returns:
- true if to exclude
-
excludeIdenticalTipText
public String excludeIdenticalTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setCopyMetaData
public void setCopyMetaData(boolean value)
Sets whether to copy meta-data values across.- Parameters:
value
- true if to copy
-
getCopyMetaData
public boolean getCopyMetaData()
Returns whether to copy meta-data values across.- Returns:
- true if to copy
-
copyMetaDataTipText
public String copyMetaDataTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMetaDataKeys
public void setMetaDataKeys(BaseString[] value)
Sets the keys of the meta-data values to copy across.- Parameters:
value
- the keys
-
getMetaDataKeys
public BaseString[] getMetaDataKeys()
Returns the keys of the meta-data values to copy across.- Returns:
- the keys
-
metaDataKeysTipText
public String metaDataKeysTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.
Default implementation returns null.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Returns:
- null if no info available, otherwise short string
-
check
protected String check(LocatedObjects annotations, LocatedObjects predictions)
Computes the overlapping objects between the annotations and the predictions.- Parameters:
annotations
- the annotations (ground truth)predictions
- the predictions to compare with- Returns:
- the overlapping objects
-
initMatch
protected void initMatch(Map<LocatedObject,Map<LocatedObject,Double>> matches, LocatedObject thisObj)
Initializes the matches for the object.- Parameters:
matches
- for storing the matchesthisObj
- the object to initialize the matches for
-
addMatch
protected void addMatch(Map<LocatedObject,Map<LocatedObject,Double>> matches, LocatedObject thisObj, LocatedObject otherObj, double score)
Records the match for the object.- Parameters:
matches
- for storing the matchesthisObj
- the object that a match was found forotherObj
- the match that was foundscore
- the score of the match
-
doCalculate
protected abstract LocatedObjects doCalculate(LocatedObjects annotations, LocatedObjects predictions, Map<LocatedObject,Map<LocatedObject,Double>> matches)
Computes the overlapping objects between the annotations and the predictions.- Parameters:
annotations
- the annotations (ground truth)predictions
- the predictions to compare withmatches
- for collecting the matches- Returns:
- the overlapping objects
-
calculate
public LocatedObjects calculate(LocatedObjects annotations, LocatedObjects predictions)
Computes the overlapping objects between the annotations and the predictions.- Specified by:
calculate
in interfaceObjectOverlap
- Parameters:
annotations
- the annotations (ground truth)predictions
- the predictions to compare with- Returns:
- the overlapping objects
-
matches
public Map<LocatedObject,Map<LocatedObject,Double>> matches(LocatedObjects annotations, LocatedObjects predictions)
Computes the overlapping objects between the annotations and the predictions and returns the matches.- Specified by:
matches
in interfaceObjectOverlap
- Parameters:
annotations
- the annotations (ground truth)predictions
- the predictions to compare with- Returns:
- the matches
-
copyMetaData
protected void copyMetaData(LocatedObject source, LocatedObject target)
Copies the specified meta-data values (if available) from source to target.- Parameters:
source
- the source object with the valuestarget
- the target object to receive the values
-
-