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 classResize.ResizeTypeHow to resize.
-
Field Summary
Fields Modifier and Type Field Description protected doublem_FactorXthe x factor.protected doublem_FactorYthe y factor.protected intm_Heightthe absolute height.protected InterpolationTypem_Interpolationthe interpolation type.protected Resize.ResizeTypem_Typethe resize type.protected intm_Widththe 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 voiddefineOptions()Adds options to the internal list of options.protected OpenCVImageContainer[]doTransform(OpenCVImageContainer img)Performs no transformation at all, just returns the input.StringfactorXTipText()Returns the tip text for this property.StringfactorYTipText()Returns the tip text for this property.doublegetFactorX()Returns the X factor.doublegetFactorY()Returns the Y factor.intgetHeight()Returns the absolute height.InterpolationTypegetInterpolation()Returns the interpolation type.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.Resize.ResizeTypegetType()Returns the resize type.intgetWidth()Returns the absolute width.StringglobalInfo()Returns a string describing the object.StringheightTipText()Returns the tip text for this property.StringinterpolationTipText()Returns the tip text for this property.voidsetFactorX(double value)Sets the X factor.voidsetFactorY(double value)Sets the Y factor.voidsetHeight(int value)Sets the absolute height.voidsetInterpolation(InterpolationType value)Sets the interpolation type.voidsetType(Resize.ResizeType value)Sets the resize type.voidsetWidth(int value)Sets the absolute width.StringtypeTipText()Returns the tip text for this property.StringwidthTipText()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:
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
-
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:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin 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:
doTransformin classAbstractImageTransformer<OpenCVImageContainer>- Parameters:
img- the image to process (can be modified, since it is a copy)- Returns:
- the copy of the image
-
-