Class Grid
- 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.Grid
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,ObjectPrefixHandler
,Serializable
public class Grid extends AbstractSubImagesGenerator
Splits the image using a grid of specified number of columns and rows.
Additional report values:
- Row for the row
- Column for the column
- Coordinates for the 1-based coordinates (x,y,w,h)
It is possible to generate overlapping images (all but last row and last column) by defining overlaps. In case of overlaps, the following report values are then available:
- OverlapX on the x axis
- OverlapY on the y axis
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING min-user-mode: Expert
-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
-num-cols <int> (property: numCols) The number of columns. default: 1 minimum: 1
-num-rows <int> (property: numRows) The number of rows. default: 1 minimum: 1
-overlap-x <int> (property: overlapX) The overlap on the x axis. default: 0 minimum: 0
-overlap-y <int> (property: overlapY) The overlap on the y axis. default: 0 minimum: 0
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
KEY_COLUMN
the key for the column.static String
KEY_COORDINATES
the key for the coordinates.static String
KEY_OVERLAP_X
the key for the X overlap.static String
KEY_OVERLAP_Y
the key for the Y overlap.static String
KEY_ROW
the key for the row.protected int
m_NumCols
the number of columns to use.protected int
m_NumRows
the number of rows to use.protected int
m_OverlapX
the overlap on the x axis.protected int
m_OverlapY
the overlap on the y axis.-
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 Grid()
-
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.int
getNumCols()
Returns the number of columns in the grid.int
getNumRows()
Returns the number of rows in the grid.int
getOverlapX()
Returns the overlap on the x axis.int
getOverlapY()
Returns the overlap on the y axis.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.String
globalInfo()
Returns a string describing the object.String
numColsTipText()
Returns the tip text for this property.String
numRowsTipText()
Returns the tip text for this property.String
overlapXTipText()
Returns the tip text for this property.String
overlapYTipText()
Returns the tip text for this property.void
setNumCols(int value)
Sets the number of columns in the grid.void
setNumRows(int value)
Sets the number of rows in the grid.void
setOverlapX(int value)
Sets the overlap on the x axis.void
setOverlapY(int value)
Sets the overlap on the y axis.-
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_COLUMN
public static final String KEY_COLUMN
the key for the column.- See Also:
- Constant Field Values
-
KEY_ROW
public static final String KEY_ROW
the key for the row.- See Also:
- Constant Field Values
-
KEY_OVERLAP_X
public static final String KEY_OVERLAP_X
the key for the X overlap.- See Also:
- Constant Field Values
-
KEY_OVERLAP_Y
public static final String KEY_OVERLAP_Y
the key for the Y overlap.- See Also:
- Constant Field Values
-
KEY_COORDINATES
public static final String KEY_COORDINATES
the key for the coordinates.- See Also:
- Constant Field Values
-
m_NumCols
protected int m_NumCols
the number of columns to use.
-
m_NumRows
protected int m_NumRows
the number of rows to use.
-
m_OverlapX
protected int m_OverlapX
the overlap on the x axis.
-
m_OverlapY
protected int m_OverlapY
the overlap on the y axis.
-
-
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
-
setNumCols
public void setNumCols(int value)
Sets the number of columns in the grid.- Parameters:
value
- the number of columns
-
getNumCols
public int getNumCols()
Returns the number of columns in the grid.- Returns:
- the number of columns
-
numColsTipText
public String numColsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setNumRows
public void setNumRows(int value)
Sets the number of rows in the grid.- Parameters:
value
- the number of rows
-
getNumRows
public int getNumRows()
Returns the number of rows in the grid.- Returns:
- the number of rows
-
numRowsTipText
public String numRowsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setOverlapX
public void setOverlapX(int value)
Sets the overlap on the x axis.- Parameters:
value
- the overlap
-
getOverlapX
public int getOverlapX()
Returns the overlap on the x axis.- Returns:
- the overlap
-
overlapXTipText
public String overlapXTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setOverlapY
public void setOverlapY(int value)
Sets the overlap on the y axis.- Parameters:
value
- the overlap
-
getOverlapY
public int getOverlapY()
Returns the overlap on the y axis.- Returns:
- the overlap
-
overlapYTipText
public String overlapYTipText()
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
-
-