Class ColorConverterBase

Object
org.anchoranalysis.bean.AnchorBean<B>
org.anchoranalysis.bean.initializable.InitializableBean<T,​org.anchoranalysis.image.bean.nonbean.init.ImageInitialization>
org.anchoranalysis.image.bean.ImageBean<T>
org.anchoranalysis.image.bean.provider.BeanProviderAsStackBase<org.anchoranalysis.image.bean.provider.stack.StackProvider,​org.anchoranalysis.image.core.stack.Stack>
org.anchoranalysis.image.bean.provider.stack.StackProvider
org.anchoranalysis.image.bean.provider.stack.StackProviderUnary
org.anchoranalysis.plugin.opencv.bean.color.ColorConverterBase
All Implemented Interfaces:
org.anchoranalysis.bean.Provider<org.anchoranalysis.image.core.stack.Stack>, org.anchoranalysis.image.core.stack.ProviderAsStack
Direct Known Subclasses:
ConvertRGBToHSV, ConvertRGBToLab

public abstract class ColorConverterBase
extends org.anchoranalysis.image.bean.provider.stack.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 
    Constructor Description
    ColorConverterBase()  
  • Method Summary

    Modifier and Type Method Description
    protected abstract int colorSpaceCode()
    The color space conversion code to use from OpenCV, that defines the color-space to convert to.
    org.anchoranalysis.image.core.stack.Stack createFromStack​(org.anchoranalysis.image.core.stack.Stack stackRGB)  

    Methods inherited from class org.anchoranalysis.image.bean.provider.stack.StackProviderUnary

    get, getStack, setStack

    Methods inherited from class org.anchoranalysis.image.bean.provider.stack.StackProvider

    getAsStack

    Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean

    getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization

    Methods inherited from class org.anchoranalysis.bean.AnchorBean

    checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • createFromStack

      public org.anchoranalysis.image.core.stack.Stack createFromStack​(org.anchoranalysis.image.core.stack.Stack stackRGB) throws org.anchoranalysis.bean.xml.exception.ProvisionFailedException
      Specified by:
      createFromStack in class org.anchoranalysis.image.bean.provider.stack.StackProviderUnary
      Throws:
      org.anchoranalysis.bean.xml.exception.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.