latest version v1.9 - last update 10 Apr 2010 |
This class works on channel8/imatrix to extract connected components and describes them as the topological order of "objects" and "holes". More...
#include <ltiObjectsFromMask.h>
Classes | |
class | objectStruct |
This node-structure for storing information about all objects and holes in the tree. More... | |
class | parameters |
the parameters for the class objectsFromMask More... | |
Public Types | |
enum | { Invalid = -1, E = 0, SE = 1, S = 2, SW = 3, W = 4, NW = 5, N = 6, NE = 7 } |
Public Member Functions | |
objectsFromMask () | |
objectsFromMask (const objectsFromMask &other) | |
virtual | ~objectsFromMask () |
virtual const char * | getTypeName () const |
bool | apply (const channel8 &src8, std::list< ioPoints > &lstIOPointLists) |
bool | apply (const matrix< int > &src, std::list< ioPoints > &lstIOPointLists) |
bool | apply (const channel8 &src8, std::list< borderPoints > &lstBorderPointLists) |
bool | apply (const imatrix &src, std::list< borderPoints > &lstBorderPointLists) |
bool | apply (const channel8 &src8, std::list< areaPoints > &lstAreaPointLists) |
bool | apply (const matrix< int > &src, std::list< areaPoints > &lstAreaPointLists) |
bool | apply (const channel8 &src8, std::list< areaPoints > &lstAreaPointLists, matrix< int > &labeledMask) |
bool | apply (const matrix< int > &src, std::list< areaPoints > &lstAreaPointLists, matrix< int > &labeledMask) |
bool | apply (const channel8 &src8, tree< objectStruct > &objectTree) |
bool | apply (const matrix< int > &src, tree< objectStruct > &objectTree) |
objectsFromMask & | copy (const objectsFromMask &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
This class works on channel8/imatrix to extract connected components and describes them as the topological order of "objects" and "holes".
In the following example there are four objects, a triangle, a rectangle, a circle and a line. There are also two holes. The first one is inside the rectangle, the second is inside the circle. The circle itself and the line are inside the first hole.
--------------------------------- ---*******----------------------- ----*****------------------------ -----***----***************------ ------*-----***************------ ------------**-----------**------ ------------**---***---*-**------ ------------**--**-**--*-**------ ------------**---***---*-**------ ------------**---------*-**------ ------------**-----------**------ ------------***************------ ------------***************------ --------------------------------- "-" means background "*" indicates objects
The topological structure of objects and holes can be described as a tree, where odd numbered levels contain objects and even numbered contain holes. (Level 0 is an exception, because it represents the top-level, which in general stands for the whole image.
For the given example the tree looks like this:
level 0 image /\ / \ level 1 triangle(*) rectangle(*) \ \ level 2 hole(-) /\ / \ level 3 circle(*) line(*) / / level 4 hole(-)
Each node of the tree contains borderPoints, areaPoints and ioPoints. The tree can be obtained by using the apply(...tree<objectStruct>...) method.
If you are only interested in the objects and don't need the holes, then you can use the other apply() methods, which deliver a list of borderPoints, ioPoints or areaPoints for each object. A labeled mask is also available.
anonymous enum |
Chain code constants (also used in geometricFeatures, hence public).
lti::objectsFromMask::objectsFromMask | ( | ) |
constructor
lti::objectsFromMask::objectsFromMask | ( | const objectsFromMask & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::objectsFromMask::~objectsFromMask | ( | ) | [virtual] |
destructor
bool lti::objectsFromMask::apply | ( | const matrix< int > & | src, | |
tree< objectStruct > & | objectTree | |||
) |
operates on the given parameter to extract objects AND holes in their topological order.
src | matrix<int> input-channel | |
objectTree | tree, that contains io-, border- and areaPoints |
bool lti::objectsFromMask::apply | ( | const channel8 & | src8, | |
tree< objectStruct > & | objectTree | |||
) |
operates on the given parameter to extract objects AND holes in their topological order.
src8 | channel8 input-channel | |
objectTree | tree, that contains io-, border- and areaPoints |
bool lti::objectsFromMask::apply | ( | const matrix< int > & | src, | |
std::list< areaPoints > & | lstAreaPointLists, | |||
matrix< int > & | labeledMask | |||
) |
operates on the given parameter to extract only objects.
src | matrix<int> input-channel | |
lstAreaPointLists | list of areaPoints. The boundary of each areaPoints object will be updated. | |
labeledMask | returns a matrix of integers, what represent the number of the segmented object |
bool lti::objectsFromMask::apply | ( | const channel8 & | src8, | |
std::list< areaPoints > & | lstAreaPointLists, | |||
matrix< int > & | labeledMask | |||
) |
operates on the given parameter to extract only objects.
src8 | channel8 input-channel | |
lstAreaPointLists | list of area points. The boundary of each areaPoints object will be updated. | |
labeledMask | returns a matrix of integers, what represent the number of the segmented object |
bool lti::objectsFromMask::apply | ( | const matrix< int > & | src, | |
std::list< areaPoints > & | lstAreaPointLists | |||
) |
operates on the given parameter to extract only objects.
src | matrix<int> input-channel | |
lstAreaPointLists | std::list of areaPoints. The boundary of each areaPoints object will be updated. |
bool lti::objectsFromMask::apply | ( | const channel8 & | src8, | |
std::list< areaPoints > & | lstAreaPointLists | |||
) |
operates on the given parameter to extract only objects.
src8 | channel8 input-channel | |
lstAreaPointLists | std::list of areaPoints. The boundary of each areaPoints object will be updated. |
bool lti::objectsFromMask::apply | ( | const imatrix & | src, | |
std::list< borderPoints > & | lstBorderPointLists | |||
) |
operates on the given parameter to extract only objects.
src | matrix<int> input-channel | |
lstBorderPointLists | std::list of borderPoints |
bool lti::objectsFromMask::apply | ( | const channel8 & | src8, | |
std::list< borderPoints > & | lstBorderPointLists | |||
) |
operates on the given parameter to extract only objects.
src8 | channel8 input-channel | |
lstBorderPointLists | std::list of borderPoints |
bool lti::objectsFromMask::apply | ( | const matrix< int > & | src, | |
std::list< ioPoints > & | lstIOPointLists | |||
) |
operates on the given parameter to extract only objects.
src | matrix<int> input-channel | |
lstIOPointLists | std::list of ioPoints |
virtual functor* lti::objectsFromMask::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Reimplemented from lti::segmentation.
objectsFromMask& lti::objectsFromMask::copy | ( | const objectsFromMask & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::segmentation.
const parameters& lti::objectsFromMask::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::functor.
virtual const char* lti::objectsFromMask::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("objectsFromMask")
Reimplemented from lti::segmentation.