Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
Bial::ColorSpace Namespace Reference

Functions

template<class D >
Image< ColorMerge (Vector< Image< D > > &img_vector)
 Static constructor of a color image, from an vector of monochromatic images. More...
 
template<class D >
Vector< Image< D > > Split (const Image< Color > &img)
 Create a vector of (N-1)-D images from an N-D image. More...
 
template<class D >
Image< D > Channel (const Image< Color > &img, size_t channel)
 Returns the the chosen channel from input image as a gray image. More...
 
template<class D >
Image< D > Channel (const Image< RealColor > &img, size_t channel)
 
RealColor ARGBtoAHSI (const Color &pxl)
 Converts a RGB format pixel to HSI format. More...
 
Color AHSItoARGB (const RealColor &pxl)
 Converts a HSI format pixel to RGB format. More...
 
Image< RealColorARGBtoAHSI (const Image< Color > &img)
 Converts a RGB format image to HSI format. More...
 
Image< ColorAHSItoARGB (const Image< RealColor > &img)
 Converts a HSI format image to RGB format. More...
 
Image< RealColorARGBtoXYZ (const Image< Color > &img)
 Converts a RGB image to XYZ colorspace. More...
 
Image< ColorXYZtoARGB (const Image< RealColor > &img)
 Converts a XYZ image to RGB colorspace. More...
 
Image< RealColorARGBtoCIELab (const Image< Color > &img)
 Converts a RGB image to CIELab colorspace. More...
 
Image< ColorCIELabtoARGB (const Image< RealColor > &img)
 Converts a CIELab image to RGB colorspace. More...
 
Image< RealColorXYZtoCIELab (const Image< RealColor > &img)
 Converts a XYZ image to CIE-Lab colorspace. More...
 
Image< RealColorCIELabtoXYZ (const Image< RealColor > &img)
 Converts a CIE-Lab image to XYZ colorspace. More...
 
double ARGB_XYZ (double color)
 Auxiliar function to convert between RGB and XYZ color representations. More...
 
double XYZ_ARGB (double color)
 Auxiliar function to convert between XYZ and RGB color representations. More...
 
double XYZ_CIELab (double color)
 Auxiliar function to convert between XYZ and CIELab color representations. More...
 
double CIELab_XYZ (double color)
 Auxiliar function to convert between CIELab and XYZ color representations. More...
 
template<class D >
Image< ColorGraytoARGB (const Image< D > &img)
 Converts gray image to ARGB format. Color channels receive the intensity. More...
 
template<class D >
Image< D > ARGBtoGraybyLuminosity (const Image< Color > &img)
 Converts ARGB image to gray scale using luminosity. gray=( 0.21*red + 0.72*green + 0.07*blue )/2. More...
 
template<class D >
Image< D > ARGBtoGraybyLightness (const Image< Color > &img)
 Converts ARGB image to gray scale using lightness. gray=(max(red,green,blue)+min(red,green,blue))/2. More...
 
template<class D >
Image< D > ARGBtoGraybyBrightness (const Image< Color > &img)
 Converts ARGB image to gray scale using brightness. gray=(red+green+blue)/2. More...
 

Variables

constexpr double XwRef = 95.047
 CIE X White Reference ( Obs.= 2°, Illuminant= D65 ) More...
 
constexpr double YwRef = 100.000
 CIE Y White Reference ( Obs.= 2°, Illuminant= D65 ) More...
 
constexpr double ZwRef = 108.883
 CIE Z White Reference ( Obs.= 2°, Illuminant= D65 ) More...
 
constexpr double Epsilon = 0.008856
 Const. used in conversions between CIELAB and XYZ. More...
 

Function Documentation

Color Bial::ColorSpace::AHSItoARGB ( const RealColor pxl)

Converts a HSI format pixel to RGB format.

Date
2016/Jan/13
Parameters
pxlHSI format pixel
Returns
RGB format pixel
Warning
none.
Image< Color > Bial::ColorSpace::AHSItoARGB ( const Image< RealColor > &  img)

Converts a HSI format image to RGB format.

Date
2016/Jan/13
Parameters
imgHSI format image
Returns
RGB format Image
Warning
none.
double Bial::ColorSpace::ARGB_XYZ ( double  color)

Auxiliar function to convert between RGB and XYZ color representations.

Date
2014/Apr/22
Parameters
colorA color value.
Returns
Converted color value
Warning
none.
RealColor Bial::ColorSpace::ARGBtoAHSI ( const Color pxl)

Converts a RGB format pixel to HSI format.

Date
2016/Jan/13
Parameters
pxlRGB format pixel
Returns
HSI format pixel
Warning
none.
Image< RealColor > Bial::ColorSpace::ARGBtoAHSI ( const Image< Color > &  img)

Converts a RGB format image to HSI format.

Date
2016/Jan/13
Parameters
imgRGB format image
Returns
HSI format Image
Warning
none.
Image< RealColor > Bial::ColorSpace::ARGBtoCIELab ( const Image< Color > &  img)

Converts a RGB image to CIELab colorspace.

Date
2016/Jan/13
Parameters
imgRGB color Image
Returns
Image
Warning
Images must have 3 dimensions, and the "color" ChannelType in 3rd dimension.
XYZ channel intensity range is approximately between 0 and 100.
Color conversion will be better in floating point images.
template<class D >
Image< D > Bial::ColorSpace::ARGBtoGraybyBrightness ( const Image< Color > &  img)

Converts ARGB image to gray scale using brightness. gray=(red+green+blue)/2.

Date
2013/Aug/06
Parameters
imgThe input image.
Returns
Gray scale image
Warning
Only for 3-D colored.
template<class D >
Image< D > Bial::ColorSpace::ARGBtoGraybyLightness ( const Image< Color > &  img)

Converts ARGB image to gray scale using lightness. gray=(max(red,green,blue)+min(red,green,blue))/2.

Date
2013/Aug/06
Parameters
imgThe input image.
Returns
Gray scale image
Warning
Only for 3-D colored.
template<class D >
Image< D > Bial::ColorSpace::ARGBtoGraybyLuminosity ( const Image< Color > &  img)

Converts ARGB image to gray scale using luminosity. gray=( 0.21*red + 0.72*green + 0.07*blue )/2.

Date
2013/Aug/06
Parameters
imgThe input image.
Returns
Gray scale image
Warning
Only for 3-D colored.
Image< RealColor > Bial::ColorSpace::ARGBtoXYZ ( const Image< Color > &  img)

Converts a RGB image to XYZ colorspace.

Date
2013/Oct/29
Parameters
imgRGB color Image
Returns
Image
Warning
Images must have 3 dimensions, and the "color" ChannelType in 3rd dimension.
XYZ channel intensity range is approximately between 0 and 100.
Color conversion will be better in floating point images.
template<class D >
Image< D > Bial::ColorSpace::Channel ( const Image< Color > &  img,
size_t  channel 
)

Returns the the chosen channel from input image as a gray image.

Date
2016/Jan/13
Parameters
imgA 3D or 4D image.
channelA channel.
Returns
An image with the chosen channel from input image.
Warning
none.
template<class D >
Image< D > Bial::ColorSpace::Channel ( const Image< RealColor > &  img,
size_t  channel 
)
double Bial::ColorSpace::CIELab_XYZ ( double  color)

Auxiliar function to convert between CIELab and XYZ color representations.

Date
2014/Apr/22
Parameters
colorA color value.
Returns
Converted color value
Warning
none.
Image< Color > Bial::ColorSpace::CIELabtoARGB ( const Image< RealColor > &  img)

Converts a CIELab image to RGB colorspace.

Date
2016/Jan/13
Parameters
imgXYZ color Image
Returns
Image
Warning
Images must have 3 dimensions, and the "color" ChannelType in 3rd dimension.
Resultant RGB image intensity range is between 0 and 25.
Color conversion will be better in floating point images.
Image< RealColor > Bial::ColorSpace::CIELabtoXYZ ( const Image< RealColor > &  img)

Converts a CIE-Lab image to XYZ colorspace.

Date
2013/Oct/30
Parameters
imgLab color Image
Returns
Image
Warning
Images must have 3 dimensions, and the "color" ChannelType in 3rd dimension.
Color conversion will be better in floating point images.
template<class D >
Image< Color > Bial::ColorSpace::GraytoARGB ( const Image< D > &  img)

Converts gray image to ARGB format. Color channels receive the intensity.

Date
2013/Aug/06
Parameters
imgThe input image.
Returns
An ARGB image.
Warning
none.
template<class D >
Image< Color > Bial::ColorSpace::Merge ( Vector< Image< D > > &  img_vector)

Static constructor of a color image, from an vector of monochromatic images.

Date
2014/Apr/11
Parameters
img_vectorvector of images.
Returns
Resultant merged color image.
Warning
Images in vector must have the same dimension sizes.
template<class D >
Vector< Image< D > > Bial::ColorSpace::Split ( const Image< Color > &  img)

Create a vector of (N-1)-D images from an N-D image.

Date
2013/Oct/23
Parameters
imgA 3D or 4D image.
Returns
An image vector with split images in the last dimension.
Warning
none.
double Bial::ColorSpace::XYZ_ARGB ( double  color)

Auxiliar function to convert between XYZ and RGB color representations.

Date
2014/Apr/22
Parameters
colorA color value.
Returns
Converted color value
Warning
none.
double Bial::ColorSpace::XYZ_CIELab ( double  color)

Auxiliar function to convert between XYZ and CIELab color representations.

Date
2014/Apr/22
Parameters
colorA color value.
Returns
Converted color value
Warning
none.
Image< Color > Bial::ColorSpace::XYZtoARGB ( const Image< RealColor > &  img)

Converts a XYZ image to RGB colorspace.

Date
2013/Oct/30
Parameters
imgXYZ color Image
Returns
Image
Warning
Images must have 3 dimensions, and the "color" ChannelType in 3rd dimension.
Resultant RGB image intensity range is between 0 and 25.
Color conversion will be better in floating point images.
Image< RealColor > Bial::ColorSpace::XYZtoCIELab ( const Image< RealColor > &  img)

Converts a XYZ image to CIE-Lab colorspace.

Date
2013/Oct/30
Parameters
imgXYZ color Image
Returns
Image
Warning
Images must have 3 dimensions, and the "color" ChannelType in 3rd dimension.
Color conversion will be better in floating point images.

Variable Documentation

constexpr double Bial::ColorSpace::Epsilon = 0.008856

Const. used in conversions between CIELAB and XYZ.

Definition at line 39 of file ColorLab.hpp.

constexpr double Bial::ColorSpace::XwRef = 95.047

CIE X White Reference ( Obs.= 2°, Illuminant= D65 )

Definition at line 27 of file ColorLab.hpp.

constexpr double Bial::ColorSpace::YwRef = 100.000

CIE Y White Reference ( Obs.= 2°, Illuminant= D65 )

Definition at line 31 of file ColorLab.hpp.

constexpr double Bial::ColorSpace::ZwRef = 108.883

CIE Z White Reference ( Obs.= 2°, Illuminant= D65 )

Definition at line 35 of file ColorLab.hpp.