Class Regions
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.image.transformer.subimages.AbstractSubImagesGenerator
-
- adams.data.image.transformer.subimages.Regions
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,ObjectPrefixHandler
,Serializable
public class Regions extends AbstractSubImagesGenerator
Extracts the sub-images according to the region definitions.
Additional report values:
- Region for the region
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-prefix <java.lang.String> (property: prefix) The report field prefix used in the report. default: Object.
-partial <boolean> (property: partial) If enabled, partial hits are included as well. default: false
-fix-invalid <boolean> (property: fixInvalid) If enabled, objects that fall partially outside the image boundaries get fixed (eg when allowing partial hits). default: false
-region <adams.core.base.BaseRectangle> [-region ...] (property: regions) The regions to extract (x y w h, 0 or 1-based x/y). default:
-one-based-coords <boolean> (property: oneBasedCoords) If enabled, the coordinates are consisdered starting at 1 rather than 0. default: true
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
KEY_COORDINATES
the key for the coordinates.static String
KEY_REGION
the key for the region.protected boolean
m_OneBasedCoords
whether the regions are 1-based or 0-based.protected BaseRectangle[]
m_Regions
the regions to use.-
Fields inherited from class adams.data.image.transformer.subimages.AbstractSubImagesGenerator
m_FixInvalid, m_Partial, m_Prefix
-
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 Regions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected List<BufferedImageContainer>
doProcess(BufferedImageContainer image)
Performs the actual generation of the subimages.boolean
getOneBasedCoords()
Returns whether the coordinates start at 1 or 0.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.BaseRectangle[]
getRegions()
Returns the regions to extract (x y w h, 0 or 1-based x/y).String
globalInfo()
Returns a string describing the object.String
oneBasedCoordsTipText()
Returns the tip text for this property.String
regionsTipText()
Returns the tip text for this property.void
setOneBasedCoords(boolean value)
Sets whether the coordinates start at 1 or 0.void
setRegions(BaseRectangle[] value)
Sets the regions to extract (x y w h, 0 or 1-based x/y).-
Methods inherited from class adams.data.image.transformer.subimages.AbstractSubImagesGenerator
check, fixInvalidTipText, getFixInvalid, getPartial, getPrefix, partialTipText, prefixTipText, process, setFixInvalid, setPartial, setPrefix, transferObjects, transferObjects, transferObjects, transferObjects
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, 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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
KEY_REGION
public static final String KEY_REGION
the key for the region.- See Also:
- Constant Field Values
-
KEY_COORDINATES
public static final String KEY_COORDINATES
the key for the coordinates.- See Also:
- Constant Field Values
-
m_Regions
protected BaseRectangle[] m_Regions
the regions to use.
-
m_OneBasedCoords
protected boolean m_OneBasedCoords
whether the regions are 1-based or 0-based.
-
-
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 classAbstractSubImagesGenerator
-
setRegions
public void setRegions(BaseRectangle[] value)
Sets the regions to extract (x y w h, 0 or 1-based x/y).- Parameters:
value
- the regions
-
getRegions
public BaseRectangle[] getRegions()
Returns the regions to extract (x y w h, 0 or 1-based x/y).- Returns:
- the regions
-
regionsTipText
public String regionsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setOneBasedCoords
public void setOneBasedCoords(boolean value)
Sets whether the coordinates start at 1 or 0.- Parameters:
value
- true if 1-based coordinates
-
getOneBasedCoords
public boolean getOneBasedCoords()
Returns whether the coordinates start at 1 or 0.- Returns:
- true if 1-based coordinates
-
oneBasedCoordsTipText
public String oneBasedCoordsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractSubImagesGenerator
- Returns:
- null if no info available, otherwise short string
-
doProcess
protected List<BufferedImageContainer> doProcess(BufferedImageContainer image)
Performs the actual generation of the subimages.- Specified by:
doProcess
in classAbstractSubImagesGenerator
- Parameters:
image
- the image to process- Returns:
- the list of subimages generated
-
-