Package adams.data.opencv.transformer
Class Resize
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,ImageTransformer<OpenCVImageContainer>
,FlowContextHandler
,Serializable
,Comparable
public class Resize extends AbstractOpenCVTransformer
Resizes the image, either using absolute width/height or factors for x/y.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-type <ABSOLUTE|FACTORS> (property: type) The resize type. default: FACTORS
-width <int> (property: width) The absolute width to use, -1 uses input width. default: -1 minimum: -1
-height <int> (property: height) The absolute height to use, -1 uses input height. default: -1 minimum: -1
-factor-x <double> (property: factorX) The factor to apply to the width. default: 1.0 minimum: 0.0
-factor-y <double> (property: factorY) The factor to apply to the height. default: 1.0 minimum: 0.0
-interpolation <CV_INTER_NN|CV_INTER_LINEAR|CV_INTER_CUBIC|CV_INTER_AREA|CV_INTER_LANCZOS4> (property: interpolation) The interpolation type. default: CV_INTER_LINEAR
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Resize.ResizeType
How to resize.
-
Field Summary
Fields Modifier and Type Field Description protected double
m_FactorX
the x factor.protected double
m_FactorY
the y factor.protected int
m_Height
the absolute height.protected InterpolationType
m_Interpolation
the interpolation type.protected Resize.ResizeType
m_Type
the resize type.protected int
m_Width
the absolute width.-
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 Resize()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected OpenCVImageContainer[]
doTransform(OpenCVImageContainer img)
Performs no transformation at all, just returns the input.String
factorXTipText()
Returns the tip text for this property.String
factorYTipText()
Returns the tip text for this property.double
getFactorX()
Returns the X factor.double
getFactorY()
Returns the Y factor.int
getHeight()
Returns the absolute height.InterpolationType
getInterpolation()
Returns the interpolation type.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.Resize.ResizeType
getType()
Returns the resize type.int
getWidth()
Returns the absolute width.String
globalInfo()
Returns a string describing the object.String
heightTipText()
Returns the tip text for this property.String
interpolationTipText()
Returns the tip text for this property.void
setFactorX(double value)
Sets the X factor.void
setFactorY(double value)
Sets the Y factor.void
setHeight(int value)
Sets the absolute height.void
setInterpolation(InterpolationType value)
Sets the interpolation type.void
setType(Resize.ResizeType value)
Sets the resize type.void
setWidth(int value)
Sets the absolute width.String
typeTipText()
Returns the tip text for this property.String
widthTipText()
Returns the tip text for this property.-
Methods inherited from class adams.data.opencv.transformer.AbstractOpenCVTransformer
forCommandLine, forName, getTransformations
-
Methods inherited from class adams.data.image.AbstractImageTransformer
checkImage, cleanUp, compareTo, destroy, equals, getFlowContext, 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_Type
protected Resize.ResizeType m_Type
the resize type.
-
m_Width
protected int m_Width
the absolute width.
-
m_Height
protected int m_Height
the absolute height.
-
m_FactorX
protected double m_FactorX
the x factor.
-
m_FactorY
protected double m_FactorY
the y factor.
-
m_Interpolation
protected InterpolationType m_Interpolation
the interpolation type.
-
-
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 classAbstractOptionHandler
-
setType
public void setType(Resize.ResizeType value)
Sets the resize type.- Parameters:
value
- the type
-
getType
public Resize.ResizeType getType()
Returns the resize type.- Returns:
- the type
-
typeTipText
public String typeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setWidth
public void setWidth(int value)
Sets the absolute width.- Parameters:
value
- the width (-1 to use input width)
-
getWidth
public int getWidth()
Returns the absolute width.- Returns:
- the width (-1 to use input 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 absolute height.- Parameters:
value
- the height (-1 to use input height)
-
getHeight
public int getHeight()
Returns the absolute height.- Returns:
- the height (-1 to use input height)
-
heightTipText
public String heightTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setFactorX
public void setFactorX(double value)
Sets the X factor.- Parameters:
value
- the factor
-
getFactorX
public double getFactorX()
Returns the X factor.- Returns:
- the factor
-
factorXTipText
public String factorXTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setFactorY
public void setFactorY(double value)
Sets the Y factor.- Parameters:
value
- the factor
-
getFactorY
public double getFactorY()
Returns the Y factor.- Returns:
- the factor
-
factorYTipText
public String factorYTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setInterpolation
public void setInterpolation(InterpolationType value)
Sets the interpolation type.- Parameters:
value
- the type
-
getInterpolation
public InterpolationType getInterpolation()
Returns the interpolation type.- Returns:
- the type
-
interpolationTipText
public String interpolationTipText()
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 classAbstractImageTransformer<OpenCVImageContainer>
- Returns:
- null if no info available, otherwise short string
-
doTransform
protected OpenCVImageContainer[] doTransform(OpenCVImageContainer img)
Performs no transformation at all, just returns the input.- Specified by:
doTransform
in classAbstractImageTransformer<OpenCVImageContainer>
- Parameters:
img
- the image to process (can be modified, since it is a copy)- Returns:
- the copy of the image
-
-