Package adams.data.opencv.features
Class Histogram
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<AbstractImageFeatureGenerator>
,SizeOfHandler
,Serializable
,Comparable
public class Histogram extends AbstractOpenCVFeatureGenerator
Computes a histogram from the incoming image.
-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
-converter <adams.data.featureconverter.AbstractFeatureConverter> (property: converter) The feature converter to use to produce the output data. default: adams.data.featureconverter.SpreadSheet -data-row-type adams.data.spreadsheet.DenseDataRow -spreadsheet-type adams.data.spreadsheet.DefaultSpreadSheet
-prefix <java.lang.String> (property: prefix) The (optional) prefix to use for the feature names. default:
-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:
-num-bins <int> (property: numBins) The number of bins to generate. default: 256 minimum: 1 maximum: 256
-min-value <float> (property: minValue) The min value to use. default: 0.0
-max-value <float> (property: maxValue) The max value to use. default: 255.0
-group-channels <boolean> (property: groupChannels) If enabled, grouping is by channel rather than by bin. default: false
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_GroupChannels
whether to group the channels.protected float
m_MaxValue
the maximum value.protected float
m_MinValue
the minimum value.protected int
m_NumBins
the number of bins.-
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 Histogram()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HeaderDefinition
createHeader(OpenCVImageContainer img)
Creates the header from a template image.void
defineOptions()
Adds options to the internal list of options.List<Object>[]
generateRows(OpenCVImageContainer img)
Performs the actual feature generation.boolean
getGroupChannels()
Returns whether to group by channels.float
getMaxValue()
Returns the max value.float
getMinValue()
Returns the min value.int
getNumBins()
Returns the number of bins to use.String
globalInfo()
Returns a string describing the object.String
groupChannelsTipText()
Returns the tip text for this property.String
maxValueTipText()
Returns the tip text for this property.String
minValueTipText()
Returns the tip text for this property.String
numBinsTipText()
Returns the tip text for this property.void
setGroupChannels(boolean value)
Sets the whether to group by channels.void
setMaxValue(float value)
Sets the max value.void
setMinValue(float value)
Sets the min value.void
setNumBins(int value)
Sets the number of bins to use.-
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
-
-
-
-
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 classAbstractImageFeatureGenerator<OpenCVImageContainer>
-
setNumBins
public void setNumBins(int value)
Sets the number of bins to use.- Parameters:
value
- the bins
-
getNumBins
public int getNumBins()
Returns the number of bins to use.- Returns:
- the bins
-
numBinsTipText
public String numBinsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setMinValue
public void setMinValue(float value)
Sets the min value.- Parameters:
value
- the min value
-
getMinValue
public float getMinValue()
Returns the min value.- Returns:
- the min value
-
minValueTipText
public String minValueTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setMaxValue
public void setMaxValue(float value)
Sets the max value.- Parameters:
value
- the max value
-
getMaxValue
public float getMaxValue()
Returns the max value.- Returns:
- the max value
-
maxValueTipText
public String maxValueTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setGroupChannels
public void setGroupChannels(boolean value)
Sets the whether to group by channels.- Parameters:
value
- true if to group by channels
-
getGroupChannels
public boolean getGroupChannels()
Returns whether to group by channels.- Returns:
- true if to group by channels
-
groupChannelsTipText
public String groupChannelsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
createHeader
public HeaderDefinition createHeader(OpenCVImageContainer img)
Creates the header from a template image.- Specified by:
createHeader
in classAbstractImageFeatureGenerator<OpenCVImageContainer>
- Parameters:
img
- the image to act as a template- Returns:
- the generated header
-
generateRows
public List<Object>[] generateRows(OpenCVImageContainer img)
Performs the actual feature generation.- Specified by:
generateRows
in classAbstractImageFeatureGenerator<OpenCVImageContainer>
- Parameters:
img
- the image to process- Returns:
- the generated features
-
-