CVB++ 14.0
Cvb::Foundation::ConvertColorSpace Namespace Reference

Namespace for collection of color space conversion functions from the Foundation package. More...

Classes

class  ColorTwistMatrix
 Matrix defining color transformations. More...
 

Functions

std::unique_ptr< ImageConvertToRGB (const Image &image, ColorModel guessToColorModel=ColorModel::RGB)
 Convert the input image to RGB. More...
 
std::unique_ptr< ImageConvertToYUV (const Image &image)
 Convert the input image to YUV. More...
 
std::unique_ptr< ImageConvertToYCbCr (const Image &image)
 Convert the input image to YCbCr. More...
 
std::unique_ptr< ImageConvertToCieXYZ (const Image &image)
 Convert the input image to CIE XYZ. More...
 
std::unique_ptr< ImageConvertToCieLUV (const Image &image)
 Convert the input image to CIE LUV. More...
 
std::unique_ptr< ImageConvertToCieLab16 (const Image &image)
 Convert the input image to CIE Lab with DataType::Int16BppUnsigned() for better precision. More...
 
std::unique_ptr< ImageConvertToCieLab8 (const Image &image)
 Convert the input image to CIE Lab with DataType::Int8BppUnsigned(). More...
 
std::unique_ptr< ImageConvertToYCC (const Image &image)
 Convert the input image to YCC. More...
 
std::unique_ptr< ImageConvertToHLS (const Image &image)
 Convert the input image to HLS. More...
 
std::unique_ptr< ImageConvertToHSV (const Image &image)
 Convert the input image to HSV. More...
 
std::unique_ptr< ImageConvertToMono (const Image &image)
 Convert the input image to mono. More...
 
std::unique_ptr< ImageConvertToMono (const Image &image, double weightR, double weightG, double weightB)
 Convert the input image to mono. More...
 
template<class RANGE >
TypedRange< std::unique_ptr< Image >, int, RANGE >::type SwapChannels (const Image &image, const RANGE &newArrangement)
 Create a new image by rearranging the planes of the input image. More...
 
std::unique_ptr< ImageTwistColors (const Image &image, ColorTwistMatrix matrix)
 Apply the color twist matrix to the input image. More...
 

Detailed Description

Namespace for collection of color space conversion functions from the Foundation package.

Remarks
CMake users: Link to imported target CVB::CvbFoundationConvertColorSpace

Function Documentation

◆ ConvertToCieLab16()

std::unique_ptr< Image > ConvertToCieLab16 ( const Image image)
inline

Convert the input image to CIE Lab with DataType::Int16BppUnsigned() for better precision.

Parameters
[in]imageInput image.
Returns
New converted image.
Exceptions
Anyexception derived from std::exception including CvbException.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

◆ ConvertToCieLab8()

std::unique_ptr< Image > ConvertToCieLab8 ( const Image image)
inline

Convert the input image to CIE Lab with DataType::Int8BppUnsigned().

Parameters
[in]imageInput image.
Returns
New converted image.
Exceptions
Anyexception derived from std::exception including CvbException.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

◆ ConvertToCieLUV()

std::unique_ptr< Image > ConvertToCieLUV ( const Image image)
inline

Convert the input image to CIE LUV.

Parameters
[in]imageInput image.
Returns
New converted image.
Exceptions
Anyexception derived from std::exception including CvbException.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

◆ ConvertToCieXYZ()

std::unique_ptr< Image > ConvertToCieXYZ ( const Image image)
inline

Convert the input image to CIE XYZ.

Parameters
[in]imageInput image.
Returns
New converted image.
Exceptions
Anyexception derived from std::exception including CvbException.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

◆ ConvertToHLS()

std::unique_ptr< Image > ConvertToHLS ( const Image image)
inline

Convert the input image to HLS.

Parameters
[in]imageInput image.
Returns
New converted image.
Exceptions
Anyexception derived from std::exception including CvbException.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

◆ ConvertToHSV()

std::unique_ptr< Image > ConvertToHSV ( const Image image)
inline

Convert the input image to HSV.

Parameters
[in]imageInput image.
Returns
New converted image.
Exceptions
Anyexception derived from std::exception including CvbException.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

◆ ConvertToMono() [1/2]

std::unique_ptr< Image > ConvertToMono ( const Image image)
inline

Convert the input image to mono.

Parameters
[in]imageInput image.
Returns
New converted image.
Exceptions
Anyexception derived from std::exception including CvbException.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

◆ ConvertToMono() [2/2]

std::unique_ptr< Image > ConvertToMono ( const Image image,
double  weightR,
double  weightG,
double  weightB 
)
inline

Convert the input image to mono.

Parameters
[in]imageInput image.
[in]weightRWeight (multiplier) for the red channel.
[in]weightGWeight (multiplier) for the green channel.
[in]weightBWeight (multiplier) for the blue channel.
Returns
New converted image.
Exceptions
Anyexception derived from std::exception including CvbException.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly. All Coefficients must be >= 0 and satisfy the condition weightR + weightG + weightB <= 1.

◆ ConvertToRGB()

std::unique_ptr< Image > ConvertToRGB ( const Image image,
ColorModel  guessToColorModel = ColorModel::RGB 
)
inline

Convert the input image to RGB.

Parameters
[in]imageInput image.
[in]guessToColorModelInput color model to use, if image's color model is ColorModel::RGBGuess.
Returns
New converted image.
Exceptions
Anyexception derived from std::exception including CvbException.

If the color model is ColorModel::RGBGuess, then guessToColorModel is used. With that you can build your own images consisting of the desired color space and convert it to RGB.

◆ ConvertToYCbCr()

std::unique_ptr< Image > ConvertToYCbCr ( const Image image)
inline

Convert the input image to YCbCr.

Parameters
[in]imageInput image.
Returns
New converted image.
Exceptions
Anyexception derived from std::exception including CvbException.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

◆ ConvertToYCC()

std::unique_ptr< Image > ConvertToYCC ( const Image image)
inline

Convert the input image to YCC.

Parameters
[in]imageInput image.
Returns
New converted image.
Exceptions
Anyexception derived from std::exception including CvbException.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

◆ ConvertToYUV()

std::unique_ptr< Image > ConvertToYUV ( const Image image)
inline

Convert the input image to YUV.

Parameters
[in]imageInput image.
Returns
New converted image.
Exceptions
Anyexception derived from std::exception including CvbException.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

◆ SwapChannels()

TypedRange< std::unique_ptr< Image >, int, RANGE >::type SwapChannels ( const Image image,
const RANGE &  newArrangement 
)
inline

Create a new image by rearranging the planes of the input image.

Parameters
[in]imageInput image.
[in]newArrangementArray that defines the new plane arrangement. For example for an RGB image, the array [2,1,0] would cause the image planes to be rearranged to BGR plane order.
Returns
New transformed image.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ TwistColors()

std::unique_ptr< Image > TwistColors ( const Image image,
ColorTwistMatrix  matrix 
)
inline

Apply the color twist matrix to the input image.

Parameters
[in]imageImage to apply the matrix to.
[in]matrixMatrix defining the color twist transformation.
Returns
Transformed image.
Exceptions
Anyexception derived from std::exception including CvbException.