Introduction
The geometry characterizes the image properties, carrying :
- the image buffer type,
- the image dimensions.
The available buffer types are :
- UInt8 / Binary / Label8,
- Int8,
- UInt16 / Label16,
- Int16,
- UInt32 / Label32,
- Real32.
Binary images are unsigned 8-bits data used as logical mask images and its possible values are 0 or 1. As for Label8, Label16 and Label32 images, they have unsigned 8, 16 or 32-bits data type and are used to identify objects in the image by an integer value.
The figure below shows an input image (left), its thresholded and segmented binary version (middle) and the labelled image assigning a label (represented by a color in the image) to the pixels of a blob.
See ipsdk::image::eImageBufferType for more details.
Geometry creation
Functions to create a geommetry
Several functions allow to create a geometry, specifying the required information. Here is the list of these functions :
- ipsdk::image::geometry2d defines the geometry of 2d grey level images,
- ipsdk::image::geometry3d defines the geometry of 3d grey level images,
- ipsdk::image::geometryRgb2d defines the geometry of 2d RGB images,
- ipsdk::image::geometryRgb3d defines the geometry of 3d RGB images,
- ipsdk::image::geometrySeq2d defines the geometry of 2d grey level image sequences,
- ipsdk::image::geometrySeq3d defines the geometry of 3d grey level image sequences.
Functions to reinterpret a geommetry
It is possible to reinterpret an image geometry without creating a new image. For instance, a 3D image can instantly become a multi-channel or a sequence image. The conversion are availeble through the following functions:
- ipsdk::image::reinterpretVolumeToSequence to interpret a volume as a sequence image,
- ipsdk::image::reinterpretSequenceToVolume to interpret a sequence image as a volume,
- ipsdk::image::reinterpretVolumeToMultiChannel to interpret a volume as a multi-channel image,
- ipsdk::image::reinterpretMultiChannelToVolume to interpret a multi-channel image as a volume,
- ipsdk::image::reinterpretSequenceToMultiChannel to interpret a sequence as a multi-channel image,
- ipsdk::image::reinterpretMultiChannelToSequence to interpret a multi-channel image as a sequence.
Please, note that the input image must have 3 dimensions. This means that:
- if the image is 3D, it can't contain several color channels or frames,
- if the image is multi- channel, it can't be a 3D volume or contain several frames,
- if the image is a sequence, it can't be a 3D volume or contain several channels.
Geometry components
We can distinguish three kinds of geometry :
- Volume geometry, which determines if the image is 2d or 3d and is described by ipsdk::image::eVolumeGeometryType,
- Color geometry, which informs if the data is a grey level, RGB, or any other supported color space model, and is described by ipsdk::image::eColorGeometryType,
- Temporal geometry, which allows to handle image sequences, and is described by ipsdk::image::eTemporalGeometryType.
Color models
RGB color model
The RGB color model is associated to the three primary colors :
The RGB color model mapped to a cube. The horizontal x-axis as red values increasing to the left, y-axis as blue increasing to the lower right and the vertical z-axis as green increasing towards the top. The origin, black, is the vertex hidden from view.
- See also
- http://en.wikipedia.org/wiki/RGB_color_model
RGBA color model
The RGB color model is associated to the three primary colors :
with an additional Alpha channel which can be used for example to handle transparency.
A representation of additive color mixing. Projection of primary color lights on a white screen shows secondary colors where two overlap; the combination of all three of red, green, and blue in equal intensities makes white.
- See also
- https://en.wikipedia.org/wiki/RGBA_color_space
-
http://en.wikipedia.org/wiki/RGB_color_model
XYZ Rec 709 color models
The CIE system is based on the description of color as a luminance component Y, as described above, and two additional components X and Z.
It is defined such that all visible colours (physiologically perceived colors in human color vision) can be defined using only positive values, and, the Y value is luminance. We use the CIE XYZ color space as defined by ITU-R BT.709-6 Recommendation with D65 white point.
The standardized transformation settled upon by the CIE special commission was as follows:
The inverse matrix is then given by :
BT.709 primaries shown on the CIE 1931 x, y chromaticity diagram. Colors within the BT.709 color gamut will fall within the triangle that connects the primaries. Also shown is BT.709's white point, Illuminant D65.
- See also
- Digital Video and HD, Algorithms and Interfaces (2nd ed.), Poynton, 2012-02-07.
-
https://fr.wikipedia.org/wiki/SRGB
YCbCr and YPbPr color models
The YCbCr color model defines a color space where :
- Y stands for the luma component (the brightness)
- Cb and Cr are the chrominance (color) components.
Example of Cb-Cr color plane
A RGB image along with its Y, Cb, and Cr components respectively.
YCbCr is sometimes abbreviated to YCC and is used in case of digital signal. YPbPr, sometimes called Yuv, is used in case of analog signal.
YCbCr and YPbPr are then closely related since color spaces are linked by following equations :
where
stands for the number of the bit length of the quantized signal. Note that
normalization term is only added in case of unsigned int data type.
The standardized transformation settled upon by the CIE special commission, as defined by ITU-R BT.709-6 Recommendation with D65 white point, is given by :
The inverse matrix is then given by :
- See also
- https://en.wikipedia.org/wiki/YCbCr
-
Digital Video and HD, Algorithms and Interfaces (2nd ed.), Poynton, 2012-02-07.
L*a*b color model
This color space were defined by the International Commission on Illumination (CIE) in 1976.
Its three components stand for :
- L* : lightness
- a* : green-red component
- b* : blue-yellow component
These values can be obtained from XYZ Rec 709 color models as follow :
where :
and :
The reverse transformation is then given by :
where :
CIELAB color space front view
- See also
- https://en.wikipedia.org/wiki/CIELAB_color_space
-
https://en.wikipedia.org/wiki/Standard_illuminant
-
Digital Video and HD, Algorithms and Interfaces (2nd ed.), Poynton, 2012-02-07.
L*u*v* color model
This color space were adopted by the International Commission on Illumination (CIE) in 1976
Its three components stand for :
- L* : lightness
- u* : first chroma component
- v* : second chroma component
These values can be obtained from XYZ Rec 709 color models as follow :
where :
and :
The reverse transformation is then given by :
and then :
(u', v') chromaticity diagram, also known as the CIE 1976 UCS (uniform chromaticity scale) diagram.
- See also
- https://en.wikipedia.org/wiki/CIELUV
-
https://en.wikipedia.org/wiki/Standard_illuminant
-
Digital Video and HD, Algorithms and Interfaces (2nd ed.), Poynton, 2012-02-07.
HLS color model
HLS color space stands for Hue, Lightness and Saturation color space where :
- Hue is defined technically as "the degree to which a stimulus can be described as similar to or different from stimuli that are described as red, green, blue, and yellow"
- Lightness is the "brightness relative to the brightness of a similarly illuminated white"
- Saturation is the "colorfulness of a stimulus relative to its own brightness"
Transformation from a RGB color model is given by :
On output these components take value in :
for saturation and lightness
for hue
Reverse transformation is then given by :
HLS cylinder.
- See also
- https://en.wikipedia.org/wiki/HSL_and_HSV
HSV color model
HSV color space stands for Hue, Saturation and Value color space where :
- Hue is defined technically as "the degree to which a stimulus can be described as similar to or different from stimuli that are described as red, green, blue, and yellow"
- Saturation is the "colorfulness of a stimulus relative to its own brightness"
- Value is the "attribute of a visual sensation according to which an area appears to emit more or less light"
Transformation from a RGB color model is given by :
On output these components take value in :
for saturation and value
for hue
Reverse transformation is then given by :
HSV cylinder.
- See also
- https://en.wikipedia.org/wiki/HSL_and_HSV