Package adams.data.image.transformer
Class SuppliedImageMask
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,ImageTransformer<BufferedImageContainer>,FlowContextHandler,Serializable,Comparable
public class SuppliedImageMask extends AbstractBufferedImageTransformer
Masks out regions on the image using a supplied image from internal storage, making them transparent.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-mask <adams.flow.control.StorageName> (property: mask) The name of the storage name (image) to use as mask. default: storage
-down <boolean> (property: down) If true, then pixels <= threshold are not masked and the others' alpha channel are set to 0 (made transparent). default: true
-threshold <int> (property: threshold) Threshold value used for binarization, specify -1 to automatically determine a threshold. default: 127 minimum: -1 maximum: 255
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_DownIf true, then pixels <= threshold are not masked and the others' alpha channel are set to 0 (made transparent).protected StorageNamem_Maskthe image in internal storage.protected int[][]m_MaskMatrixthe mask image.protected intm_ThresholdThreshold value used for binarization, specify -1 to automatically determine a threshold.-
Fields inherited from class adams.data.image.AbstractImageTransformer
m_FlowContext
-
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 SuppliedImageMask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected BufferedImageContainer[]doTransform(BufferedImageContainer container)Masks the image.StringdownTipText()Returns the tip text for this property.booleangetDown()Get whether mask is applied below or above the threshold.StorageNamegetMask()Gets the storage name of the mask image.intgetThreshold()Get the manual threshold value.StringglobalInfo()Returns a string describing the object.protected voidinitMask()Initializes the mask if necessary.StringmaskTipText()Returns the tip text for this property.protected voidreset()Resets the scheme.voidsetDown(boolean value)Set whether mask is applied below or above the threshold.voidsetMask(StorageName value)Sets storage name of the mask image.voidsetThreshold(int value)Set the manual threshold value.StringthresholdTipText()Returns the tip text for this property.-
Methods inherited from class adams.data.image.transformer.AbstractBufferedImageTransformer
forCommandLine, forName, getTransformations
-
Methods inherited from class adams.data.image.AbstractImageTransformer
checkImage, cleanUp, compareTo, destroy, equals, getFlowContext, getQuickInfo, initialize, setFlowContext, shallowCopy, shallowCopy, transform
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, 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
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_Mask
protected StorageName m_Mask
the image in internal storage.
-
m_Down
protected boolean m_Down
If true, then pixels <= threshold are not masked and the others' alpha channel are set to 0 (made transparent).
-
m_Threshold
protected int m_Threshold
Threshold value used for binarization, specify -1 to automatically determine a threshold.
-
m_MaskMatrix
protected int[][] m_MaskMatrix
the mask image.
-
-
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
-
getMask
public StorageName getMask()
Gets the storage name of the mask image.- Returns:
- the storage name
-
setMask
public void setMask(StorageName value)
Sets storage name of the mask image.- Parameters:
value- the storage name
-
maskTipText
public String maskTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDown
public boolean getDown()
Get whether mask is applied below or above the threshold.- Returns:
- threshold direction
-
setDown
public void setDown(boolean value)
Set whether mask is applied below or above the threshold.- Parameters:
value- threshold direction
-
downTipText
public String downTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getThreshold
public int getThreshold()
Get the manual threshold value.- Returns:
- manual threshold value
-
setThreshold
public void setThreshold(int value)
Set the manual threshold value.- Parameters:
value- manual threshold value
-
thresholdTipText
public String thresholdTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
initMask
protected void initMask()
Initializes the mask if necessary.
-
doTransform
protected BufferedImageContainer[] doTransform(BufferedImageContainer container)
Masks the image.- Specified by:
doTransformin classAbstractImageTransformer<BufferedImageContainer>- Parameters:
container- the image to be processed- Returns:
- the masked image
-
-