LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::chrominanceMapMasking Class Reference

This class performs color segmentation in the chrominance plane using a chrominance map which may be drawn manually or computed by the chrominance map estimator class. More...

#include <ltiChrominanceMapMasking.h>

Inheritance diagram for lti::chrominanceMapMasking:
Inheritance graph
[legend]
Collaboration diagram for lti::chrominanceMapMasking:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 The parameters for the class chrominanceMapMasking. More...

Public Member Functions

 chrominanceMapMasking ()
 chrominanceMapMasking (const parameters &par)
 chrominanceMapMasking (const chrominanceMapMasking &other)
virtual ~chrominanceMapMasking ()
virtual const char * getTypeName () const
chrominanceMapMaskingcopy (const chrominanceMapMasking &other)
chrominanceMapMaskingoperator= (const chrominanceMapMasking &other)
virtual functorclone () const
const parametersgetParameters () const
bool useExternalChrominanceMap (const channel8 *map)
bool setChrominanceMap (const channel8 &map)
bool useExternalProbabilityMap (const channel *map)
bool setProbabilityMap (const channel &map)
const channel8getChrominanceMap () const
const channelgetProbabilityMap () const
bool isChrominanceMapValid () const
bool isProbabilityMapValid () const
bool areMapsConsistent () const
bool readChrominanceMap (const std::string &filename, const std::vector< rgbPixel > &colors)
Apply methods for entire images or channel8s.



bool apply (const channel8 &y, const channel8 &u, const channel8 &v, channel8 &dest)
bool apply (const channel8 &y, const channel8 &u, const channel8 &v, channel8 &dest, channel &prob)
bool apply (const channel8 &u, const channel8 &v, channel8 &dest)
bool apply (const channel8 &u, const channel8 &v, channel8 &dest, channel &prob)

Protected Member Functions

bool checkInput (const channel8 &y, const channel8 &u, const channel8 &v)
bool checkInput (const channel8 &u, const channel8 &v)
int getShift () const
void setShift ()

Protected Attributes

bool m_destroyProbability
bool m_destroyChrominance
const channelm_probabilityMap
const channel8m_chrominanceMap
int m_shift

Detailed Description

This class performs color segmentation in the chrominance plane using a chrominance map which may be drawn manually or computed by the chrominance map estimator class.

For achromatic objects a threshold may be specifies to distinguish between black, grey and white.

See also:
overlappingSets2D, chrominanceModelEstimator, chrominanceMapEstimator

Constructor & Destructor Documentation

lti::chrominanceMapMasking::chrominanceMapMasking (  ) 

Default constructor.

lti::chrominanceMapMasking::chrominanceMapMasking ( const parameters par  ) 

Construct a functor using the given parameters.

lti::chrominanceMapMasking::chrominanceMapMasking ( const chrominanceMapMasking other  ) 

Copy constructor.

Parameters:
other the object to be copied
virtual lti::chrominanceMapMasking::~chrominanceMapMasking (  )  [virtual]

Destructor.


Member Function Documentation

bool lti::chrominanceMapMasking::apply ( const channel8 u,
const channel8 v,
channel8 dest,
channel prob 
)

Color segmentation based on a chrominance map only.

Parameters:
u channel8 with the 1st chrominance band.
v channel8 with the 2nd chrominance ban.
dest color segmentation.
prob the probability of the segmented object.
Returns:
true on success and false otherwise.
bool lti::chrominanceMapMasking::apply ( const channel8 u,
const channel8 v,
channel8 dest 
)

Color segmentation based on a chrominance map only.

Parameters:
u channel8 with the 1st chrominance band.
v channel8 with the 2nd chrominance ban.
dest color segmentation.
Returns:
true on success and false otherwise.
bool lti::chrominanceMapMasking::apply ( const channel8 y,
const channel8 u,
const channel8 v,
channel8 dest,
channel prob 
)

Color segmentation based on a chrominance map and thresholding on the luminance for achromatic objects.

Parameters:
y channel8 with the luminance.
u channel8 with the 1st chrominance band.
v channel8 with the 2nd chrominance ban.
dest color segmentation.
prob the probability of the segmented object.
Returns:
true on success and false otherwise.
bool lti::chrominanceMapMasking::apply ( const channel8 y,
const channel8 u,
const channel8 v,
channel8 dest 
)

Color segmentation based on a chrominance map and thresholding on the luminance for achromatic objects.

Parameters:
y channel8 with the luminance.
u channel8 with the 1st chrominance band.
v channel8 with the 2nd chrominance ban.
dest color segmentation.
Returns:
true on success and false otherwise.
bool lti::chrominanceMapMasking::areMapsConsistent (  )  const

Are the chrominance map and probability map consistent, e.g.

have the same dimensions and are both valid?

Returns:
true on success and false otherwise.
bool lti::chrominanceMapMasking::checkInput ( const channel8 u,
const channel8 v 
) [protected]

Check if the input channel8 have the same dimension.

Parameters:
u channel8 with the 1st chrominance band.
v channel8 with the 2nd chrominance ban.
Returns:
true on success and false otherwise.
bool lti::chrominanceMapMasking::checkInput ( const channel8 y,
const channel8 u,
const channel8 v 
) [protected]

Check if the input channel8 have the same dimension.

Parameters:
y channel8 with the luminance.
u channel8 with the 1st chrominance band.
v channel8 with the 2nd chrominance ban.
Returns:
true on success and false otherwise.
virtual functor* lti::chrominanceMapMasking::clone (  )  const [virtual]

Returns a pointer to a clone of this functor.

Implements lti::functor.

chrominanceMapMasking& lti::chrominanceMapMasking::copy ( const chrominanceMapMasking other  ) 

Copy data of "other" functor.

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

Reimplemented from lti::functor.

const channel8& lti::chrominanceMapMasking::getChrominanceMap (  )  const

Get the chrominance map.

const parameters& lti::chrominanceMapMasking::getParameters (  )  const

Returns used parameters.

Reimplemented from lti::modifier.

const channel& lti::chrominanceMapMasking::getProbabilityMap (  )  const

Get the probability map for the most likely object.

int lti::chrominanceMapMasking::getShift (  )  const [protected]

Get the shift used because the chrominance map is downsampled.

Returns:
the shift
virtual const char* lti::chrominanceMapMasking::getTypeName (  )  const [virtual]

Returns the name of this type ("chrominanceMapMasking").

Reimplemented from lti::modifier.

bool lti::chrominanceMapMasking::isChrominanceMapValid (  )  const

Is the chrominance map valid, e.g.

is is set and does it have equal dimensions?

Returns:
true on success and false otherwise.
bool lti::chrominanceMapMasking::isProbabilityMapValid (  )  const

Is the probability map valid, e.g.

is is set and does it have equal dimensions?

Returns:
true on success and false otherwise.
chrominanceMapMasking& lti::chrominanceMapMasking::operator= ( const chrominanceMapMasking other  ) 

Alias for copy member.

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

Reimplemented from lti::functor.

bool lti::chrominanceMapMasking::readChrominanceMap ( const std::string &  filename,
const std::vector< rgbPixel > &  colors 
)

Read the chrominance map from disk.

The chrominance map is interpreted as a color image.

Parameters:
filename the name of the chrominance map file.
colors conversion between the colored stored map and the labels used by vision processing.
Returns:
true on success and false otherwise.
bool lti::chrominanceMapMasking::setChrominanceMap ( const channel8 map  ) 

Set the chrominance map.

The map is copied.

Parameters:
map the chrominance map.
Returns:
true on success and false otherwise.
bool lti::chrominanceMapMasking::setProbabilityMap ( const channel map  ) 

Set the probability map.

The map is copied.

Parameters:
map the probability map.
Returns:
true on success and false otherwise.
void lti::chrominanceMapMasking::setShift (  )  [protected]

Set the shift used because the chrominance map is downsampled.

bool lti::chrominanceMapMasking::useExternalChrominanceMap ( const channel8 map  ) 

Set a link to the chrominance map.

Please ensure that the chrominance map is not deleted while this class or pointer exists.

Parameters:
map the chrominance map.
Returns:
true on success and false otherwise.
bool lti::chrominanceMapMasking::useExternalProbabilityMap ( const channel map  ) 

Set a link to the probability map.

Please ensure that the probability is not deleted while this class or pointer exists.

Parameters:
map the probability map.
Returns:
true on success and false otherwise.

Member Data Documentation

the chrominance map

Remember if the chrominance map must be destroyed on destruction or re-initialization.

Remember if the probability map must be destroyed on destruction or re-initialization.

the probability map

scaling between the size of the chrominance map and 8-bit


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

Generated on Sat Apr 10 15:27:06 2010 for LTI-Lib by Doxygen 1.6.1