Package adams.data.image.features
Class PixelClassifications
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<AbstractImageFeatureGenerator>,SizeOfHandler,Serializable,Comparable
public class PixelClassifications extends AbstractBufferedImageFeatureGenerator
Generates a feature vector for each pixel classification that is stored in the image's report.
Pixel classifications are generated with the adams.flow.transformer.PixelSelector transformer, using the adams.flow.transformer.pixelselector.AddClassification action.
Automatically adds the classification label associated with a classification position in the report as a separate attribute.
Valid options are:
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-field <adams.data.report.Field> [-field ...] (property: fields) The fields to add to the output. default:
-notes <adams.core.base.BaseString> [-notes ...] (property: notes) The notes to add as attributes to the generated data, eg 'PROCESS INFORMATION' . default:
-width <int> (property: width) The width of the crop rectangle. default: 100 minimum: 1
-height <int> (property: height) The height of the crop rectangle. default: 75 minimum: 1
-anchor <TOP_LEFT|TOP_RIGHT|CENTER|BOTTOM_LEFT|BOTTOM_RIGHT> (property: anchor) Defines where to anchor the position on the crop rectangle. default: TOP_LEFT
-pixel-type <RGB_SINGLE|RGB_SEPARATE|HSB_SEPARATE> (property: pixelType) The pixel type to use. default: RGB_SINGLE
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz), Dale (dale at cs dot waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ImageAnchorm_Anchorwhere to anchor the position on the rectangle.protected intm_Heightthe height of the crop rectangle.protected Pixels.PixelTypem_PixelTypehow to output the pixels.protected intm_Widththe width of the crop rectangle.-
Fields inherited from class adams.data.image.AbstractImageFeatureGenerator
m_Converter, m_Fields, m_Notes, 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 PixelClassifications()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringanchorTipText()Returns the tip text for this property.HeaderDefinitioncreateHeader(BufferedImageContainer img)Creates the header from a template image.voiddefineOptions()Adds options to the internal list of options.List<Object>[]generateRows(BufferedImageContainer img)Performs the actual feature generation.ImageAnchorgetAnchor()Returns where to anchor the position on the rectangle.protected Integer[]getClassificationIndices(BufferedImageContainer img)Returns the classification indices.intgetHeight()Returns the height of the crop rectangle.protected PointgetPixelLocation(BufferedImageContainer img, int index)Returns the pixel location to paint.Pixels.PixelTypegetPixelType()Returns the type of pixel to output.intgetWidth()Returns the width of the crop rectangle.StringglobalInfo()Returns a string describing the object.StringheightTipText()Returns the tip text for this property.StringpixelTypeTipText()Returns the tip text for this property.voidsetAnchor(ImageAnchor value)Sets where to anchor the position on the rectangle.voidsetHeight(int value)Sets the height of the crop rectangle.voidsetPixelType(Pixels.PixelType value)Sets the type of pixel to output.voidsetWidth(int value)Sets the width of the crop rectangle.StringwidthTipText()Returns the tip text for this property.-
Methods inherited from class adams.data.image.AbstractImageFeatureGenerator
checkData, cleanUp, compareTo, converterTipText, destroy, equals, fieldsTipText, generate, getConverter, getDatasetFormat, getFields, getNotes, getPrefix, getRowFormat, notesTipText, postProcessHeader, postProcessRow, postProcessRows, prefixTipText, reset, setConverter, setFields, setNotes, setPrefix, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Width
protected int m_Width
the width of the crop rectangle.
-
m_Height
protected int m_Height
the height of the crop rectangle.
-
m_Anchor
protected ImageAnchor m_Anchor
where to anchor the position on the rectangle.
-
m_PixelType
protected Pixels.PixelType m_PixelType
how to output the pixels.
-
-
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 classAbstractImageFeatureGenerator<BufferedImageContainer>
-
setWidth
public void setWidth(int value)
Sets the width of the crop rectangle.- Parameters:
value- the width
-
getWidth
public int getWidth()
Returns the width of the crop rectangle.- Returns:
- the width
-
widthTipText
public String widthTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setHeight
public void setHeight(int value)
Sets the height of the crop rectangle.- Parameters:
value- the height
-
getHeight
public int getHeight()
Returns the height of the crop rectangle.- Returns:
- the height
-
heightTipText
public String heightTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setAnchor
public void setAnchor(ImageAnchor value)
Sets where to anchor the position on the rectangle.- Parameters:
value- the anchor
-
getAnchor
public ImageAnchor getAnchor()
Returns where to anchor the position on the rectangle.- Returns:
- the anchor
-
anchorTipText
public String anchorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setPixelType
public void setPixelType(Pixels.PixelType value)
Sets the type of pixel to output.- Parameters:
value- the type
-
getPixelType
public Pixels.PixelType getPixelType()
Returns the type of pixel to output.- Returns:
- the type
-
pixelTypeTipText
public String pixelTypeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
createHeader
public HeaderDefinition createHeader(BufferedImageContainer img)
Creates the header from a template image.- Specified by:
createHeaderin classAbstractImageFeatureGenerator<BufferedImageContainer>- Parameters:
img- the image to act as a template- Returns:
- the generated header
-
getClassificationIndices
protected Integer[] getClassificationIndices(BufferedImageContainer img)
Returns the classification indices.- Parameters:
img- the current image to process- Returns:
- the indices
-
getPixelLocation
protected Point getPixelLocation(BufferedImageContainer img, int index)
Returns the pixel location to paint.- Parameters:
img- the current image to processindex- the pixel location- Returns:
- the location, null if none found
-
generateRows
public List<Object>[] generateRows(BufferedImageContainer img)
Performs the actual feature generation.- Specified by:
generateRowsin classAbstractImageFeatureGenerator<BufferedImageContainer>- Parameters:
img- the image to process- Returns:
- the generated features
-
-