latest version v1.9 - last update 10 Apr 2010 |
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>
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.
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.
other | the object to be copied |
virtual lti::chrominanceMapMasking::~chrominanceMapMasking | ( | ) | [virtual] |
Destructor.
bool lti::chrominanceMapMasking::apply | ( | const channel8 & | u, | |
const channel8 & | v, | |||
channel8 & | dest, | |||
channel & | prob | |||
) |
Color segmentation based on a chrominance map only.
u | channel8 with the 1st chrominance band. | |
v | channel8 with the 2nd chrominance ban. | |
dest | color segmentation. | |
prob | the probability of the segmented object. |
Color segmentation based on a chrominance map only.
u | channel8 with the 1st chrominance band. | |
v | channel8 with the 2nd chrominance ban. | |
dest | color segmentation. |
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.
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. |
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.
y | channel8 with the luminance. | |
u | channel8 with the 1st chrominance band. | |
v | channel8 with the 2nd chrominance ban. | |
dest | color segmentation. |
bool lti::chrominanceMapMasking::areMapsConsistent | ( | ) | const |
Are the chrominance map and probability map consistent, e.g.
have the same dimensions and are both valid?
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.
other | the functor to be copied |
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.
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?
bool lti::chrominanceMapMasking::isProbabilityMapValid | ( | ) | const |
Is the probability map valid, e.g.
is is set and does it have equal dimensions?
chrominanceMapMasking& lti::chrominanceMapMasking::operator= | ( | const chrominanceMapMasking & | other | ) |
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.
filename | the name of the chrominance map file. | |
colors | conversion between the colored stored map and the labels used by vision processing. |
bool lti::chrominanceMapMasking::setChrominanceMap | ( | const channel8 & | map | ) |
Set the chrominance map.
The map is copied.
map | the chrominance map. |
bool lti::chrominanceMapMasking::setProbabilityMap | ( | const channel & | map | ) |
Set the probability map.
The map is copied.
map | the probability map. |
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.
map | the chrominance map. |
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.
map | the probability map. |
const channel8* lti::chrominanceMapMasking::m_chrominanceMap [protected] |
the chrominance map
bool lti::chrominanceMapMasking::m_destroyChrominance [protected] |
Remember if the chrominance map must be destroyed on destruction or re-initialization.
bool lti::chrominanceMapMasking::m_destroyProbability [protected] |
Remember if the probability map must be destroyed on destruction or re-initialization.
const channel* lti::chrominanceMapMasking::m_probabilityMap [protected] |
the probability map
int lti::chrominanceMapMasking::m_shift [protected] |
scaling between the size of the chrominance map and 8-bit