![]() |
IPSDK
4_1_0_2
IPSDK : Image Processing Software Development Kit
|
convert a color image from a given color space to another More...
convert a color image from a given color space to another
This algorithm allows to convert an input color image from its color space (the sourceColorSpace) to another color space defined by InColorConversionTransform (the targetColorSpace)
IPSDK will select the algorithm to use in function of the color space of the input image attribute InColorImg and of TargetColorSpace value of parameter InColorConversionTransform.
Details of used transformations can be found at Color models.
In some cases, a linear transform allows to transform a color space to another with following equation :
where :
and
are color plan indexes
is equal to number of color channels of input image
are components of matrix of underlying linear system
are components of vector of underlying linear systemThis linear system can then be rewritten as follow :
where :
and
are respectively a
matrix and a
vector associated to underlying linear system
and
are color space vector respresentations of used imagesThis is the case when :
In some other cases such as sourceColorSpace or targetColorSpace in :
a specific algorithm is used to proceed to conversion.
In the case where the output image is not provided, the output buffer type is set to :
In this case, output image values are given by:
Here is an example of a YPbPr to Rgb color base conversion operation applied to a 8-bits image :
In this case, the output image values are given by:
Here is an example of a YPbPr to Rgb color base conversion operation applied to a 8-bits image :
Attribute description for algorithm :
| Name | ToolTip | Default Initializer |
|---|---|---|
| ipsdk::imaproc::attr::InColorImg | [Input] color image for processing operation | X |
| ipsdk::imaproc::attr::InColorConversionTransform | [Input] information allowing to convert from a color space to another linked by a linear transform | X |
| ipsdk::imaproc::attr::OutOptWk1RealImg | [Output Optional] Temporary working image for algorithm (data contained in image buffer are reals) | X |
| ipsdk::imaproc::attr::OutColorImg | [Output] color image for processing operation | customOutput (_pOutColorImg, outputTargetColorSpace(_pInColorImg,_pInColorConversionTransform)) |
Global rule description for algorithm :
ipsdk::imaproc::matchSize (ipsdk::imaproc::eMatchImageSizeType::eMIST_XYZT,_pInColorImg,_pOutColorImg) &&
ipsdk::processor::ifIsSet (_pOutOptWk1RealImg,
ipsdk::imaproc::matchSize (_pInColorImg,_pOutOptWk1RealImg)) &&
ipsdk::imaproc::color::matchColorSpace (_pInColorImg,_pOutColorImg,_pInColorConversionTransform)
| IPSDKIPLCOLOR_API image::ImagePtr ipsdk::imaproc::color::colorConvertImg | ( | const ipsdk::image::ImageConstPtr & | pInColorImg, |
| const ipsdk::image::eColorGeometryType & | targetColorSpace | ||
| ) |
wrapper function for convert a color image from a given color space to an other
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLCOLOR_API image::ImagePtr ipsdk::imaproc::color::colorConvertImg | ( | const ipsdk::image::ImageConstPtr & | pInColorImg, |
| const ipsdk::imaproc::attr::ColorConversionTransformConstPtr & | pInColorConversionTransform | ||
| ) |
wrapper function for convert a color image from a given color space to an other
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLCOLOR_API void ipsdk::imaproc::color::colorConvertImg | ( | const ipsdk::image::ImageConstPtr & | pInColorImg, |
| const ipsdk::image::eColorGeometryType & | targetColorSpace, | ||
| const ipsdk::image::ImagePtr & | pOutColorImg | ||
| ) |
wrapper function for convert a color image from a given color space to an other
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLCOLOR_API void ipsdk::imaproc::color::colorConvertImg | ( | const ipsdk::image::ImageConstPtr & | pInColorImg, |
| const ipsdk::imaproc::attr::ColorConversionTransformConstPtr & | pInColorConversionTransform, | ||
| const ipsdk::image::ImagePtr & | pOutColorImg | ||
| ) |
wrapper function for convert a color image from a given color space to an other
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
1.8.14