CVR-Lib last update 20 Sep 2009

cvr::splitImageToHSI Class Reference
[Color Analysis]

Split image into its Hue - Saturation - Intensity channels. More...

#include <cvrSplitImageToHSI.h>

Inheritance diagram for cvr::splitImageToHSI:

Inheritance graph
[legend]
Collaboration diagram for cvr::splitImageToHSI:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 splitImageToHSI ()
 splitImageToHSI (const splitImageToHSI &other)
virtual ~splitImageToHSI ()
splitImageToHSIcopy (const splitImageToHSI &other)
splitImageToHSIoperator= (const splitImageToHSI &other)
virtual const std::string & name () const
virtual splitImageToHSIclone () const
virtual splitImageToHSInewInstance () const
virtual bool apply (const matrix< image::value_type > &img, matrix< channel::value_type > &H, matrix< channel::value_type > &S, matrix< channel::value_type > &I) const
virtual bool apply (const matrix< image::value_type > &img, matrix< channel8::value_type > &H, matrix< channel8::value_type > &S, matrix< channel8::value_type > &I) const
virtual bool apply (const rgbaPixel &pixel, float &H, float &S, float &I) const
virtual bool apply (const rgbaPixel &pixel, ubyte &H, ubyte &S, ubyte &I) const
bool extractHue (const matrix< image::value_type > &img, matrix< channel::value_type > &hue) const
bool extractHue (const matrix< image::value_type > &img, matrix< channel8::value_type > &hue) const
bool extractSaturation (const matrix< image::value_type > &img, matrix< channel::value_type > &saturation) const
bool extractSaturation (const matrix< image::value_type > &img, matrix< channel8::value_type > &saturation) const
bool extractIntensity (const matrix< image::value_type > &img, matrix< channel::value_type > &intensity) const
bool extractIntensity (const matrix< image::value_type > &img, matrix< channel8::value_type > &intensity) const
virtual bool extractFirst (const matrix< image::value_type > &img, matrix< channel::value_type > &c1) const
virtual bool extractFirst (const matrix< image::value_type > &img, matrix< channel8::value_type > &c1) const
virtual bool extractSecond (const matrix< image::value_type > &img, matrix< channel::value_type > &c2) const
virtual bool extractSecond (const matrix< image::value_type > &img, matrix< channel8::value_type > &c2) const
virtual bool extractThird (const matrix< image::value_type > &img, matrix< channel::value_type > &c3) const
virtual bool extractThird (const matrix< image::value_type > &img, matrix< channel8::value_type > &c3) const


Detailed Description

Split image into its Hue - Saturation - Intensity channels.

The HSI color space is obtained by a rotation of the RGB color cube in a way that the gray-value axis is oriented with the intensity (I) axis, the hue (H) is the angle and the saturation (S) the distance from the I axis.

The transformation as defined by

Gonzalez and Woods. "Digital Image Processing". Addison Wesley. 1992

is obtained with

\[ \begin{aligned} I &= \frac{R+G+B}{3} \\ S &= 1- \frac{\min(R,G,B)}{I} \\ H &= \arccos\left(\frac{\frac{1}{2}\left[(R-G) + (R-B)\right]} {\sqrt{(R-G)^2+(R-B)(G-B))}}\right) \end{aligned} \]

For the backtransformation see cvr::mergeHSIToImage


Constructor & Destructor Documentation

cvr::splitImageToHSI::splitImageToHSI (  ) 

Constructor.

cvr::splitImageToHSI::splitImageToHSI ( const splitImageToHSI other  ) 

Copy Constructor.

virtual cvr::splitImageToHSI::~splitImageToHSI (  )  [virtual]

Destructor.


Member Function Documentation

virtual bool cvr::splitImageToHSI::apply ( const rgbaPixel pixel,
ubyte H,
ubyte S,
ubyte I 
) const [virtual]

split the pixel in hue value H, saturation S and intensity value I.

The values of each pixel will be between 0 and 255

Parameters:
pixel the pixel to be splitted
H the hue value
S the saturation value
I the intensity value

Implements cvr::splitImage.

virtual bool cvr::splitImageToHSI::apply ( const rgbaPixel pixel,
float &  H,
float &  S,
float &  I 
) const [virtual]

split the pixel in hue value H, saturation S and intensity value I.

The values of each pixel will be between 0.0f and 1.0f

Parameters:
pixel the pixel to be splitted
H the hue value
S the saturation value
I the intensity value

Implements cvr::splitImage.

virtual bool cvr::splitImageToHSI::apply ( const matrix< image::value_type > &  img,
matrix< channel8::value_type > &  H,
matrix< channel8::value_type > &  S,
matrix< channel8::value_type > &  I 
) const [virtual]

split the image in hue channel H, saturation S and intensity channel I.

The values of each image will be between 0 and 255

Parameters:
img the image to be splitted
H the hue channel
S the saturation channel
I the intensity channel

Implements cvr::splitImage.

virtual bool cvr::splitImageToHSI::apply ( const matrix< image::value_type > &  img,
matrix< channel::value_type > &  H,
matrix< channel::value_type > &  S,
matrix< channel::value_type > &  I 
) const [virtual]

split the image in hue channel H, saturation S and intensity channel I.

The values of each image will be between 0.0f and 1.0f

Parameters:
img the image to be splitted
H the hue channel
S the saturation channel
I the intensity channel

Implements cvr::splitImage.

virtual splitImageToHSI* cvr::splitImageToHSI::clone (  )  const [virtual]

returns a pointer to a clone of the functor.

Implements cvr::splitImage.

splitImageToHSI& cvr::splitImageToHSI::copy ( const splitImageToHSI other  ) 

Copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

virtual bool cvr::splitImageToHSI::extractFirst ( const matrix< image::value_type > &  img,
matrix< channel8::value_type > &  c1 
) const [virtual]

Returns the first of the three channels into which the image is split.

If you need only one channel, this might be faster than calling apply().

Parameters:
img the source image
c1 the extracted channel

Reimplemented from cvr::splitImage.

virtual bool cvr::splitImageToHSI::extractFirst ( const matrix< image::value_type > &  img,
matrix< channel::value_type > &  c1 
) const [virtual]

Returns the first of the three channels into which the image is split.

If you need only one channel, this might be faster than calling apply().

Parameters:
img the source image
c1 the extracted channel

Reimplemented from cvr::splitImage.

bool cvr::splitImageToHSI::extractHue ( const matrix< image::value_type > &  img,
matrix< channel8::value_type > &  hue 
) const

return the hue of the image.

If you need also the saturation and the intensity please use the apply methods, which are much faster!

bool cvr::splitImageToHSI::extractHue ( const matrix< image::value_type > &  img,
matrix< channel::value_type > &  hue 
) const

return the hue of the image.

If you need also the saturation and the intensity please use the apply methods, which are much faster!

bool cvr::splitImageToHSI::extractIntensity ( const matrix< image::value_type > &  img,
matrix< channel8::value_type > &  intensity 
) const

return the intensity of the image.

If you need also the hue and the intensity please use the apply methods, which are much faster!

bool cvr::splitImageToHSI::extractIntensity ( const matrix< image::value_type > &  img,
matrix< channel::value_type > &  intensity 
) const

return the intensity of the image.

If you need also the hue and the intensity please use the apply methods, which are much faster!

bool cvr::splitImageToHSI::extractSaturation ( const matrix< image::value_type > &  img,
matrix< channel8::value_type > &  saturation 
) const

return the saturation of the image.

If you need also the hue and the saturation please use the apply methods, which are much faster!

bool cvr::splitImageToHSI::extractSaturation ( const matrix< image::value_type > &  img,
matrix< channel::value_type > &  saturation 
) const

return the saturation of the image.

If you need also the hue and the intensity please use the apply methods, which are much faster!

virtual bool cvr::splitImageToHSI::extractSecond ( const matrix< image::value_type > &  img,
matrix< channel8::value_type > &  c2 
) const [virtual]

Returns the second of the three channels into which the image is split.

If you need only one channel, this might be faster than calling apply().

Parameters:
img the source image
c2 the extracted channel

Reimplemented from cvr::splitImage.

virtual bool cvr::splitImageToHSI::extractSecond ( const matrix< image::value_type > &  img,
matrix< channel::value_type > &  c2 
) const [virtual]

Returns the second of the three channels into which the image is split.

If you need only one channel, this might be faster than calling apply().

Parameters:
img the source image
c2 the extracted channel

Reimplemented from cvr::splitImage.

virtual bool cvr::splitImageToHSI::extractThird ( const matrix< image::value_type > &  img,
matrix< channel8::value_type > &  c3 
) const [virtual]

Returns the third of the three channels into which the image is split.

If you need only one channel, this might be faster than calling apply().

Parameters:
img the source image
c3 the extracted channel

Reimplemented from cvr::splitImage.

virtual bool cvr::splitImageToHSI::extractThird ( const matrix< image::value_type > &  img,
matrix< channel::value_type > &  c3 
) const [virtual]

Returns the third of the three channels into which the image is split.

If you need only one channel, this might be faster than calling apply().

Parameters:
img the source image
c3 the extracted channel

Reimplemented from cvr::splitImage.

virtual const std::string& cvr::splitImageToHSI::name (  )  const [virtual]

Returns the name of this class.

Implements cvr::functor.

virtual splitImageToHSI* cvr::splitImageToHSI::newInstance (  )  const [virtual]

returns a pointer to a new instance of the functor.

Implements cvr::splitImage.

splitImageToHSI& cvr::splitImageToHSI::operator= ( const splitImageToHSI other  ) 

Alias for copy member.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object


The documentation for this class was generated from the following file:

Generated on Sun Sep 20 22:08:52 2009 for CVR-Lib by Doxygen 1.5.8