|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.MiToBo.core.operator.MTBOperator
de.unihalle.informatik.MiToBo.color.conversion.RGBToHSXConverter
@ALDAOperator(genericExecutionMode=ALL, level=APPLICATION) public class RGBToHSXConverter
Converts an image of type MTBImageRGB
( RGB color space )
into an image with HSX( hue saturation intensity/brightness/value ) color
space.
MTBImageByte MTBImageByte
or MTBImageFloat MTBImageFloat
.
In the later case all three channels have values in the range 0..1
,
otherwise in the range 0..255
.
There are three ways to convert an rgb-image.
Nested Class Summary | |
---|---|
static class |
RGBToHSXConverter.ColorChannel
Supported Color Channels. |
static class |
RGBToHSXConverter.Mode
The way of converting an image from rgb to hsi. |
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode |
Field Summary | |
---|---|
static float |
BYTE_TO_DEGREE
Constants to convert from [0-255] to [0-359] and vice versa. |
static float |
DEGREE_TO_BYTE
|
static float |
HUE_UNDEFINED
|
static float |
SATURATION_UNDEFINED
To cope with undefined saturation/hue-values, we use the following scheme. |
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
completeDAG, name, operatorExecutionEventlistenerList, portHashAccess, verbose, versionProvider |
Constructor Summary | |
---|---|
RGBToHSXConverter()
Default constructor. |
|
RGBToHSXConverter(MTBImageRGB image)
Constructor. |
Method Summary | |
---|---|
MTBImage |
getHueMTBImg()
Get the hue channel image. |
MTBImageRGB |
getInputMTBImgRGB()
Returns the input image, null if not set. |
MTBImage |
getResultMTBImage()
Returns the converted image, null if not available. |
MTBImage |
getSatMTBImg()
Get the saturation channel image. |
MTBImage |
getXMTBImg()
Get the value channel image. |
static boolean |
isHueUndefined(float saturation)
Return true if the hue channel is undefined which is true is
saturation is zero or undefined which in turn is encoded as zero. |
static boolean |
isHueUndefined(int saturation)
Return true if the hue channel is undefined which is true is
saturation is zero or undefined which in turn is encoded as zero. |
static boolean |
isSaturationUndefined(float xValue)
Return true if the saturation channel is undefined which is true
if the x channel is zero. |
static boolean |
isSaturationUndefined(int xValue)
Return true if the saturation channel is undefined which is true
if the x channel is zero. |
protected void |
operate()
Creates a MTBImage with three channels, the same size as
the original one and converts each rgb pixel to a
hsx
pixel, where x stands for Inentsity or Brightness or Value
depending on the mode set. |
void |
setHueMTBImg(MTBImage hueChannelImage)
Set the hue channel image. |
void |
setInputMTBImgRGB(MTBImageRGB inputImage)
Set the input image. |
void |
setSatMTBImg(MTBImage saturationChannelImage)
Set the saturation channel image. |
void |
setXMTBImg(MTBImage valueChannelImage)
Set the value channel image. |
Methods inherited from class de.unihalle.informatik.MiToBo.core.operator.MTBOperator |
---|
readResolve |
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
addOperatorExecutionProgressEventListener, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getHidingMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, isConfigured, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, runOp, runOp, runOp, setConstructionMode, setHidingMode, setName, setParameter, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float BYTE_TO_DEGREE
public static final float DEGREE_TO_BYTE
public static final float SATURATION_UNDEFINED
public static final float HUE_UNDEFINED
Constructor Detail |
---|
public RGBToHSXConverter() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public RGBToHSXConverter(MTBImageRGB image) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
image
- The input image.
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail |
---|
public MTBImage getResultMTBImage()
null
if not set.public MTBImageRGB getInputMTBImgRGB()
null
if not set.public void setInputMTBImgRGB(MTBImageRGB inputImage)
inputImage
- The input image.public MTBImage getHueMTBImg()
MTBImage
.public MTBImage getSatMTBImg()
MTBImage
.public MTBImage getXMTBImg()
MTBImage
.public void setHueMTBImg(MTBImage hueChannelImage)
hueChannelImage
- The image which contains the hue channel
informations of type MTBImage
.public void setSatMTBImg(MTBImage saturationChannelImage)
saturationChannelImage
- The image which contains the saturation
channel informations of * * type
MTBImage
.public void setXMTBImg(MTBImage valueChannelImage)
valueChannelImage
- The image which contains the value channel
informations of type MTBImage
.protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
MTBImage
with three channels, the same size as
the original one and converts each rgb pixel to a
hsx
pixel, where x stands for Inentsity or Brightness or Value
depending on the mode set.
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public static final boolean isHueUndefined(float saturation)
true
if the hue channel is undefined which is true is
saturation is zero or undefined which in turn is encoded as zero.
saturation
-
public static final boolean isSaturationUndefined(float xValue)
true
if the saturation channel is undefined which is true
if the x channel is zero.
xValue
-
public static final boolean isHueUndefined(int saturation)
true
if the hue channel is undefined which is true is
saturation is zero or undefined which in turn is encoded as zero.
saturation
-
public static final boolean isSaturationUndefined(int xValue)
true
if the saturation channel is undefined which is true
if the x channel is zero.
xValue
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |