Package adams.data.boofcv.transformer
Class Binary
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,ImageTransformer<BoofCVImageContainer>,FlowContextHandler,Serializable,Comparable
public class Binary extends AbstractBoofCVTransformer
Creates a binary image.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-threshold-type <MANUAL|MEAN|ADAPTIVE_GAUSSIAN|ADAPTIVE_SQUARE|OTSU> (property: thresholdType) The type of threshold to apply. default: MANUAL
-threshold <float> (property: threshold) The manual threshold to use. default: 0.0
-gaussian-radius <int> (property: gaussianRadius) The Gaussian radius to use. default: 1 minimum: 1
-square-radius <int> (property: squareRadius) The radius of the square region to use. default: 1 minimum: 1
-bias <float> (property: bias) The bias to use (for adaptive methods). default: 0.0
-threshold-down <boolean> (property: thresholdDown) Whether to threshold down or up. default: false
-remove-small-blobs <boolean> (property: removeSmallBlobs) If enabled, small blobs are removed using erode8/dilate8. default: false
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBinary.ThresholdTypeThe treshold type to apply.
-
Field Summary
Fields Modifier and Type Field Description protected floatm_Biasthe bias (for adaptive methods).protected intm_GaussianRadiusthe gaussian radius.protected booleanm_RemoveSmallBlobswhether to remove small blobs.protected intm_SquareRadiusthe square radius.protected floatm_Thresholdthe manual threshold to use.protected booleanm_ThresholdDownthe down (for adaptive methods).protected Binary.ThresholdTypem_ThresholdTypethe type of threshold to apply.-
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 Binary()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringbiasTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected BoofCVImageContainer[]doTransform(BoofCVImageContainer img)Performs no transformation at all, just returns the input.StringgaussianRadiusTipText()Returns the tip text for this property.floatgetBias()Returns the bias to use (for adaptive methods).intgetGaussianRadius()Returns the Gaussian radius to use.booleangetRemoveSmallBlobs()Returns whether to remove small blobs using erode8/dilate8.intgetSquareRadius()Returns the radius of the square region to use.floatgetThreshold()Returns the manual threshold to use.booleangetThresholdDown()Returns whether to threshold down or up (adaptive methods).Binary.ThresholdTypegetThresholdType()Returns the type of threshold to apply.StringglobalInfo()Returns a string describing the object.StringremoveSmallBlobsTipText()Returns the tip text for this property.voidsetBias(float value)Sets the bias to use.voidsetGaussianRadius(int value)Sets the Gaussian radius to use.voidsetRemoveSmallBlobs(boolean value)Sets whether to remove small blobs using erode8/dilate8.voidsetSquareRadius(int value)Sets the radius of the square region to use.voidsetThreshold(float value)Sets the manual threshold to use.voidsetThresholdDown(boolean value)Sets whether to threshold down or up (adaptive methods).voidsetThresholdType(Binary.ThresholdType value)Sets the type of threshold to apply.StringsquareRadiusTipText()Returns the tip text for this property.StringthresholdDownTipText()Returns the tip text for this property.StringthresholdTipText()Returns the tip text for this property.StringthresholdTypeTipText()Returns the tip text for this property.-
Methods inherited from class adams.data.boofcv.transformer.AbstractBoofCVTransformer
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, 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, 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_ThresholdType
protected Binary.ThresholdType m_ThresholdType
the type of threshold to apply.
-
m_Threshold
protected float m_Threshold
the manual threshold to use.
-
m_GaussianRadius
protected int m_GaussianRadius
the gaussian radius.
-
m_SquareRadius
protected int m_SquareRadius
the square radius.
-
m_Bias
protected float m_Bias
the bias (for adaptive methods).
-
m_ThresholdDown
protected boolean m_ThresholdDown
the down (for adaptive methods).
-
m_RemoveSmallBlobs
protected boolean m_RemoveSmallBlobs
whether to remove small blobs.
-
-
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
-
setThresholdType
public void setThresholdType(Binary.ThresholdType value)
Sets the type of threshold to apply.- Parameters:
value- the type
-
getThresholdType
public Binary.ThresholdType getThresholdType()
Returns the type of threshold to apply.- Returns:
- the type
-
thresholdTypeTipText
public String thresholdTypeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setThreshold
public void setThreshold(float value)
Sets the manual threshold to use.- Parameters:
value- the threshold to use
-
getThreshold
public float getThreshold()
Returns the manual threshold to use.- Returns:
- the threshold in use
-
thresholdTipText
public String thresholdTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setGaussianRadius
public void setGaussianRadius(int value)
Sets the Gaussian radius to use.- Parameters:
value- the radius
-
getGaussianRadius
public int getGaussianRadius()
Returns the Gaussian radius to use.- Returns:
- the radius
-
gaussianRadiusTipText
public String gaussianRadiusTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setSquareRadius
public void setSquareRadius(int value)
Sets the radius of the square region to use.- Parameters:
value- the radius
-
getSquareRadius
public int getSquareRadius()
Returns the radius of the square region to use.- Returns:
- the radius
-
squareRadiusTipText
public String squareRadiusTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setBias
public void setBias(float value)
Sets the bias to use.- Parameters:
value- the bias to use
-
getBias
public float getBias()
Returns the bias to use (for adaptive methods).- Returns:
- the bias in use
-
biasTipText
public String biasTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setThresholdDown
public void setThresholdDown(boolean value)
Sets whether to threshold down or up (adaptive methods).- Parameters:
value- true if to threshold down
-
getThresholdDown
public boolean getThresholdDown()
Returns whether to threshold down or up (adaptive methods).- Returns:
- true if to threshold down
-
thresholdDownTipText
public String thresholdDownTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setRemoveSmallBlobs
public void setRemoveSmallBlobs(boolean value)
Sets whether to remove small blobs using erode8/dilate8.- Parameters:
value- true if to remove blobs
-
getRemoveSmallBlobs
public boolean getRemoveSmallBlobs()
Returns whether to remove small blobs using erode8/dilate8.- Returns:
- true if blobs removed
-
removeSmallBlobsTipText
public String removeSmallBlobsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
doTransform
protected BoofCVImageContainer[] doTransform(BoofCVImageContainer img)
Performs no transformation at all, just returns the input.- Specified by:
doTransformin classAbstractImageTransformer<BoofCVImageContainer>- Parameters:
img- the image to process (can be modified, since it is a copy)- Returns:
- the copy of the image
-
-