latest version v1.9 - last update 10 Apr 2010 |
Threshold segmentation of a single channel (monochrom) image or a contour. More...
#include <ltiThresholding.h>
Classes | |
class | parameters |
the parameters for the class thresholding More... | |
Public Member Functions | |
thresholding () | |
thresholding (const parameters &par) | |
thresholding (const thresholding &other) | |
virtual | ~thresholding () |
virtual const char * | getTypeName () const |
bool | apply (channel8 &srcdest) const |
bool | apply (const channel8 &src, channel8 &dest) const |
bool | apply (const channel8 &src, channel8 &dest, const float lowThreshold, const float highThreshold=1.0f, const bool keepInRegion=true, const bool keepOutRegion=false) const |
bool | apply (channel &src) const |
bool | apply (const channel &src, channel8 &dest) const |
bool | apply (const channel &src, channel &dest) const |
bool | apply (const channel &src, channel &dest, const float lowThreshold, const float highThreshold=1.0f, const bool keepInRegion=true, const bool keepOutRegion=false, const float inRegionValue=1.0f, const float outRegionValue=0.0f) const |
bool | apply (const channel8 &src, areaPoints &dest) const |
bool | apply (const channel &src, areaPoints &dest) const |
bool | apply (const channel8 &src, const areaPoints &comp, areaPoints &dest) const |
bool | apply (const channel &src, const areaPoints &comp, areaPoints &dest) const |
thresholding & | copy (const thresholding &other) |
virtual functor * | clone () const |
virtual bool | updateParameters () |
const parameters & | getParameters () const |
Protected Member Functions | |
bool | initLut (ubyte *lut, ubyte *mask, const float lowThreshold, const float highThreshold, const bool keepInRegion, const bool keepOutRegion, const float inRegionValue, const float outRegionValue) const |
Protected Attributes | |
ubyte | lut [256] |
ubyte | mask [256] |
Threshold segmentation of a single channel (monochrom) image or a contour.
An upper and a lower threshold are used in order to define the pixel-value-region where the thresholding should operate.
Attention: This class was ThresholdSegmentation, but the meaning of highThreshold and lowThreshold has been changed.
lti::thresholding::thresholding | ( | ) |
default constructor
lti::thresholding::thresholding | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::thresholding::thresholding | ( | const thresholding & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::thresholding::~thresholding | ( | ) | [virtual] |
destructor
bool lti::thresholding::apply | ( | const channel & | src, | |
const areaPoints & | comp, | |||
areaPoints & | dest | |||
) | const |
bool lti::thresholding::apply | ( | const channel8 & | src, | |
const areaPoints & | comp, | |||
areaPoints & | dest | |||
) | const |
bool lti::thresholding::apply | ( | const channel & | src, | |
areaPoints & | dest | |||
) | const |
segmentate the channel src, and generate an area-points-list on for the given dest-contour
src | channel with the source data. | |
dest | the area point list where the result will be left. Only the area points will be generated. If you need another contour representation you can use the castFrom methods of the other point list types (see lti::borderPoints, lti::ioPoints) |
bool lti::thresholding::apply | ( | const channel8 & | src, | |
areaPoints & | dest | |||
) | const |
bool lti::thresholding::apply | ( | const channel & | src, | |
channel & | dest, | |||
const float | lowThreshold, | |||
const float | highThreshold = 1.0f , |
|||
const bool | keepInRegion = true , |
|||
const bool | keepOutRegion = false , |
|||
const float | inRegionValue = 1.0f , |
|||
const float | outRegionValue = 0.0f | |||
) | const |
segmentate the src channel and leave the result on dest.
src | channel with the source data | |
dest | channel where the results will be left | |
lowThreshold | low threshold value | |
highThreshold | high threshold value (optional Default: 1.0f) | |
keepInRegion | if the inner pixels should be kept (optional Default: true) | |
keepOutRegion | if the outer pixels should be kept (optional Default: false) | |
inRegionValue | if keepInRegion is false the inner pixels are replaced with this value (optional Default: 1.0f) | |
outRegionValue | if keepOutRegion is false the outer pixels are replaced with this value (optional Default: 0.0f) |
segmentate the channel src, and leave the result in dest
Reimplemented from lti::modifier.
Reimplemented in lti::relativeThresholding.
bool lti::thresholding::apply | ( | channel & | src | ) | const [virtual] |
segmentates a channel on place
src | channel with the source data. The result will be left here as well. |
Reimplemented from lti::modifier.
Reimplemented in lti::relativeThresholding.
bool lti::thresholding::apply | ( | const channel8 & | src, | |
channel8 & | dest, | |||
const float | lowThreshold, | |||
const float | highThreshold = 1.0f , |
|||
const bool | keepInRegion = true , |
|||
const bool | keepOutRegion = false | |||
) | const |
segmentate the src channel and leave the result on dest.
this apply is slower because everytime it is invoked a new Lookuptable is generated
src | channel8 with the source data. | |
dest | channel8 where the result will be left. | |
lowThreshold | low threshold value | |
highThreshold | high threshold value (optional Default: 1) | |
keepInRegion | if the inner pixels should be kept (optional Default: true) | |
keepOutRegion | if the outer pixels should be kept (optional Default: false) |
segmentate the src channel and leave the result on dest
Reimplemented from lti::modifier.
Reimplemented in lti::relativeThresholding.
bool lti::thresholding::apply | ( | channel8 & | srcdest | ) | const [virtual] |
operates on the given parameter.
srcdest | channel8 with the source data. The result will be left here too. |
Reimplemented from lti::modifier.
Reimplemented in lti::relativeThresholding.
virtual functor* lti::thresholding::clone | ( | ) | const [virtual] |
returns a pointer to a clone of the functor.
Implements lti::functor.
Reimplemented in lti::optimalThresholding, and lti::relativeThresholding.
thresholding& lti::thresholding::copy | ( | const thresholding & | other | ) |
copy data of "other" functor.
Reimplemented from lti::functor.
Reimplemented in lti::optimalThresholding, and lti::relativeThresholding.
const parameters& lti::thresholding::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::modifier.
Reimplemented in lti::optimalThresholding, and lti::relativeThresholding.
virtual const char* lti::thresholding::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("thresholding")
Reimplemented from lti::modifier.
Reimplemented in lti::optimalThresholding, and lti::relativeThresholding.
bool lti::thresholding::initLut | ( | ubyte * | lut, | |
ubyte * | mask, | |||
const float | lowThreshold, | |||
const float | highThreshold, | |||
const bool | keepInRegion, | |||
const bool | keepOutRegion, | |||
const float | inRegionValue, | |||
const float | outRegionValue | |||
) | const [protected] |
Method to init the lookuptables.
The lookuptables will be used to accelerate the segmentation of channel8 data. Usually they are initialized within invocation of setParameters() but also in applies to channel8 which contains Thresholds as parameters.
lut | where to store the look up table | |
mask | where to store the mask table | |
lowThreshold | low threshold value | |
highThreshold | high threshold value | |
keepInRegion | whether the inner pixels of the original channel8 should be kept | |
keepOutRegion | whether the outer pixels of the original channel8 should be kept | |
inRegionValue | if keepInRegion is false, the pixel will be overwritten with this value | |
outRegionValue | if keepOutRegion is false, the pixel will be overwritten with this value |
virtual bool lti::thresholding::updateParameters | ( | ) | [virtual] |
sets the functor's parameters.
This member makes a copy of theParam: the functor will keep its own copy of the parameters!
Reimplemented from lti::functor.
ubyte lti::thresholding::lut[256] [protected] |
This look up table will be used to accelerate the segmentation of channel8 data.
It contains the value to be assigned to the destination channel It will be generated within the member setParameters
ubyte lti::thresholding::mask[256] [protected] |
This look up table will be used to accelerate the segmentation of channel8 data.
It contains 0 if the value must be considered as background or 1 otherwise. It will be generated within the member setParameters