Class RandomRegions
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.negativeregions.AbstractNegativeRegionsGenerator
-
- adams.flow.transformer.negativeregions.RandomRegions
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,Randomizable
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,Serializable
public class RandomRegions extends AbstractNegativeRegionsGenerator implements Randomizable
Generates specified number of random regions and then prunes ones that overlap with other regions or annotations.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ObjectFinder
m_Finder
the object finder to use.protected int
m_MaxHeight
the maximum height.protected int
m_MaxWidth
the maximum width.protected int
m_MinHeight
the minimum height.protected int
m_MinWidth
the minimum width.protected int
m_NumRegions
the number of regions to generate (before removing overlapping ones).protected ObjectOverlap
m_OverlapDetection
the object overlap calculation to use.protected OverlappingObjectRemoval
m_OverlapRemoval
the object removal algorithm.protected Random
m_Random
the random number generator.protected long
m_Seed
the seed value.-
Fields inherited from class adams.flow.transformer.negativeregions.AbstractNegativeRegionsGenerator
m_Stopped
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description RandomRegions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected LocatedObjects
doGenerateRegions(AbstractImageContainer cont)
Generates the negative regions.String
finderTipText()
Returns the tip text for this property.ObjectFinder
getFinder()
Returns the object finder in use.int
getMaxHeight()
Returns the maximum height a negative region can have.int
getMaxWidth()
Returns the maximum width a negative region can have.int
getMinHeight()
Returns the minimum height a negative region must have.int
getMinWidth()
Returns the minimum width a negative region must have.int
getNumRegions()
Returns the number of regions to generate, before removing ones that overlap or overlap with annotations.ObjectOverlap
getOverlapDetection()
Returns the algorithm for determining the overlapping objects.OverlappingObjectRemoval
getOverlapRemoval()
Returns the algorithm for determining the overlapping objects.long
getSeed()
Returns the seed value.String
globalInfo()
Returns a string describing the object.String
maxHeightTipText()
Returns the tip text for this property.String
maxWidthTipText()
Returns the tip text for this property.String
minHeightTipText()
Returns the tip text for this property.String
minWidthTipText()
Returns the tip text for this property.String
numRegionsTipText()
Returns the tip text for this property.String
overlapDetectionTipText()
Returns the tip text for this property.String
overlapRemovalTipText()
Returns the tip text for this property.protected void
reset()
Resets the scheme.String
seedTipText()
Returns the tip text for this property.void
setFinder(ObjectFinder value)
Sets the object finder to use.void
setMaxHeight(int value)
Sets the maximum height a negative region can have.void
setMaxWidth(int value)
Sets the maximum width a negative region can have.void
setMinHeight(int value)
Sets the minimum height a negative region must have.void
setMinWidth(int value)
Sets the minimum width a negative region must have.void
setNumRegions(int value)
Sets the number of regions to generate, before removing ones that overlap or overlap with annotations.void
setOverlapDetection(ObjectOverlap value)
Sets the algorithm for determining the overlapping objectsvoid
setOverlapRemoval(OverlappingObjectRemoval value)
Sets the algorithm for determining the overlapping objectsvoid
setSeed(long value)
Sets the seed value.-
Methods inherited from class adams.flow.transformer.negativeregions.AbstractNegativeRegionsGenerator
check, generateRegions, getQuickInfo, isStopped, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, 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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Finder
protected ObjectFinder m_Finder
the object finder to use.
-
m_Seed
protected long m_Seed
the seed value.
-
m_MinWidth
protected int m_MinWidth
the minimum width.
-
m_MaxWidth
protected int m_MaxWidth
the maximum width.
-
m_MinHeight
protected int m_MinHeight
the minimum height.
-
m_MaxHeight
protected int m_MaxHeight
the maximum height.
-
m_NumRegions
protected int m_NumRegions
the number of regions to generate (before removing overlapping ones).
-
m_OverlapDetection
protected ObjectOverlap m_OverlapDetection
the object overlap calculation to use.
-
m_OverlapRemoval
protected OverlappingObjectRemoval m_OverlapRemoval
the object removal algorithm.
-
m_Random
protected transient Random m_Random
the random number generator.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractOptionHandler
-
setFinder
public void setFinder(ObjectFinder value)
Sets the object finder to use.- Parameters:
value
- the finder
-
getFinder
public ObjectFinder getFinder()
Returns the object finder in use.- Returns:
- the finder
-
finderTipText
public String finderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSeed
public void setSeed(long value)
Sets the seed value.- Specified by:
setSeed
in interfaceRandomizable
- Parameters:
value
- the seed
-
getSeed
public long getSeed()
Returns the seed value.- Specified by:
getSeed
in interfaceRandomizable
- Returns:
- the seed
-
seedTipText
public String seedTipText()
Returns the tip text for this property.- Specified by:
seedTipText
in interfaceRandomizable
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMinWidth
public void setMinWidth(int value)
Sets the minimum width a negative region must have.- Parameters:
value
- the minimum width, ignored if <1
-
getMinWidth
public int getMinWidth()
Returns the minimum width a negative region must have.- Returns:
- the minimum width, ignored if <1
-
minWidthTipText
public String minWidthTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMaxWidth
public void setMaxWidth(int value)
Sets the maximum width a negative region can have.- Parameters:
value
- the maximum width, ignored if <1
-
getMaxWidth
public int getMaxWidth()
Returns the maximum width a negative region can have.- Returns:
- the maximum width, ignored if <1
-
maxWidthTipText
public String maxWidthTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMinHeight
public void setMinHeight(int value)
Sets the minimum height a negative region must have.- Parameters:
value
- the minimum height, ignored if <1
-
getMinHeight
public int getMinHeight()
Returns the minimum height a negative region must have.- Returns:
- the minimum height, ignored if <1
-
minHeightTipText
public String minHeightTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMaxHeight
public void setMaxHeight(int value)
Sets the maximum height a negative region can have.- Parameters:
value
- the maximum height, ignored if <1
-
getMaxHeight
public int getMaxHeight()
Returns the maximum height a negative region can have.- Returns:
- the maximum height, ignored if <1
-
maxHeightTipText
public String maxHeightTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumRegions
public void setNumRegions(int value)
Sets the number of regions to generate, before removing ones that overlap or overlap with annotations.- Parameters:
value
- the number of regions
-
getNumRegions
public int getNumRegions()
Returns the number of regions to generate, before removing ones that overlap or overlap with annotations.- Returns:
- the number of regions
-
numRegionsTipText
public String numRegionsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOverlapDetection
public void setOverlapDetection(ObjectOverlap value)
Sets the algorithm for determining the overlapping objects- Parameters:
value
- the algorithm
-
getOverlapDetection
public ObjectOverlap getOverlapDetection()
Returns the algorithm for determining the overlapping objects.- Returns:
- the algorithm
-
overlapDetectionTipText
public String overlapDetectionTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOverlapRemoval
public void setOverlapRemoval(OverlappingObjectRemoval value)
Sets the algorithm for determining the overlapping objects- Parameters:
value
- the algorithm
-
getOverlapRemoval
public OverlappingObjectRemoval getOverlapRemoval()
Returns the algorithm for determining the overlapping objects.- Returns:
- the algorithm
-
overlapRemovalTipText
public String overlapRemovalTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
doGenerateRegions
protected LocatedObjects doGenerateRegions(AbstractImageContainer cont)
Generates the negative regions.- Specified by:
doGenerateRegions
in classAbstractNegativeRegionsGenerator
- Parameters:
cont
- the image container to generate the regions for- Returns:
- the generated regions
-
-