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 ObjectFinderm_Finderthe object finder to use.protected intm_MaxHeightthe maximum height.protected intm_MaxWidththe maximum width.protected intm_MinHeightthe minimum height.protected intm_MinWidththe minimum width.protected intm_NumRegionsthe number of regions to generate (before removing overlapping ones).protected ObjectOverlapm_OverlapDetectionthe object overlap calculation to use.protected OverlappingObjectRemovalm_OverlapRemovalthe object removal algorithm.protected Randomm_Randomthe random number generator.protected longm_Seedthe 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 voiddefineOptions()Adds options to the internal list of options.protected LocatedObjectsdoGenerateRegions(AbstractImageContainer cont)Generates the negative regions.StringfinderTipText()Returns the tip text for this property.ObjectFindergetFinder()Returns the object finder in use.intgetMaxHeight()Returns the maximum height a negative region can have.intgetMaxWidth()Returns the maximum width a negative region can have.intgetMinHeight()Returns the minimum height a negative region must have.intgetMinWidth()Returns the minimum width a negative region must have.intgetNumRegions()Returns the number of regions to generate, before removing ones that overlap or overlap with annotations.ObjectOverlapgetOverlapDetection()Returns the algorithm for determining the overlapping objects.OverlappingObjectRemovalgetOverlapRemoval()Returns the algorithm for determining the overlapping objects.longgetSeed()Returns the seed value.StringglobalInfo()Returns a string describing the object.StringmaxHeightTipText()Returns the tip text for this property.StringmaxWidthTipText()Returns the tip text for this property.StringminHeightTipText()Returns the tip text for this property.StringminWidthTipText()Returns the tip text for this property.StringnumRegionsTipText()Returns the tip text for this property.StringoverlapDetectionTipText()Returns the tip text for this property.StringoverlapRemovalTipText()Returns the tip text for this property.protected voidreset()Resets the scheme.StringseedTipText()Returns the tip text for this property.voidsetFinder(ObjectFinder value)Sets the object finder to use.voidsetMaxHeight(int value)Sets the maximum height a negative region can have.voidsetMaxWidth(int value)Sets the maximum width a negative region can have.voidsetMinHeight(int value)Sets the minimum height a negative region must have.voidsetMinWidth(int value)Sets the minimum width a negative region must have.voidsetNumRegions(int value)Sets the number of regions to generate, before removing ones that overlap or overlap with annotations.voidsetOverlapDetection(ObjectOverlap value)Sets the algorithm for determining the overlapping objectsvoidsetOverlapRemoval(OverlappingObjectRemoval value)Sets the algorithm for determining the overlapping objectsvoidsetSeed(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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin 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:
setSeedin interfaceRandomizable- Parameters:
value- the seed
-
getSeed
public long getSeed()
Returns the seed value.- Specified by:
getSeedin interfaceRandomizable- Returns:
- the seed
-
seedTipText
public String seedTipText()
Returns the tip text for this property.- Specified by:
seedTipTextin 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:
doGenerateRegionsin classAbstractNegativeRegionsGenerator- Parameters:
cont- the image container to generate the regions for- Returns:
- the generated regions
-
-