Class ColorConverterBase
Object
AnchorBean<StackProvider>
InitializableBean<StackProvider, ImageInitialization>
ImageBean<StackProvider>
BeanProviderAsStackBase<StackProvider, Stack>
StackProvider
StackProviderUnary
ColorConverterBase
- All Implemented Interfaces:
Provider<Stack>,ProviderAsStack
- Direct Known Subclasses:
ConvertRGBToHSV,ConvertRGBToLab
public abstract class ColorConverterBase
extends StackProviderUnary
Converts a RGB stack into another color space using OpenCV.
Note that internally the RGB image is reordered as BGR, as OpenCV expects this order, but this should not be performed externally by the user when calling this class, it is rather automatically taken care of.
i.e. please always pass the channels in a Stack in RGB order.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract intThe color space conversion code to use from OpenCV, that defines the color-space to convert to.StackcreateFromStack(Stack stackRGB) Methods inherited from class org.anchoranalysis.image.bean.provider.stack.StackProviderUnary
get, getStack, setStackMethods inherited from class org.anchoranalysis.image.bean.provider.stack.StackProvider
getAsStackMethods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitializationMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
ColorConverterBase
public ColorConverterBase()
-
-
Method Details
-
createFromStack
public Stack createFromStack(Stack stackRGB) throws ProvisionFailedException - Specified by:
createFromStackin classStackProviderUnary- Throws:
ProvisionFailedException
-
colorSpaceCode
protected abstract int colorSpaceCode()The color space conversion code to use from OpenCV, that defines the color-space to convert to.Assume that the inputted image is provided is a 3 channel stack in BGR order.
- Returns:
- the code, as defined by OpenCV, to describe the target color-space.
-