latest version v1.9 - last update 10 Apr 2010 |
This functor adjust the given list of locations by a given mask. More...
#include <ltiLocationSelector.h>
Classes | |
class | parameters |
the parameters for the class locationSelector More... | |
Public Member Functions | |
locationSelector () | |
locationSelector (const locationSelector &other) | |
virtual | ~locationSelector () |
virtual const char * | getTypeName () const |
bool | apply (const channel8 &mask, std::list< location > &locs) const |
bool | apply (const matrix< int > &mask, const std::list< location > &locs, std::vector< std::list< location > > &filteredLocs) const |
bool | apply (const std::list< areaPoints > &objs, const std::list< location > &locs, std::vector< std::list< location > > &filteredLocs) const |
locationSelector & | copy (const locationSelector &other) |
locationSelector & | operator= (const locationSelector &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
This functor adjust the given list of locations by a given mask.
There are two modes for this functor. The first one will remove all locations of a given list, that are marked to be removed in a mask.
The second mode will separate a list of locations into a set of smaller lists, so that all locations in each sublist have the same label. This way, sublists of locations per object can be generated.
lti::locationSelector::locationSelector | ( | ) |
default constructor
lti::locationSelector::locationSelector | ( | const locationSelector & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::locationSelector::~locationSelector | ( | ) | [virtual] |
destructor
bool lti::locationSelector::apply | ( | const std::list< areaPoints > & | objs, | |
const std::list< location > & | locs, | |||
std::vector< std::list< location > > & | filteredLocs | |||
) | const |
Separate the locations list "locs" into several smaller locations lists, each one having locations for one object in the list of areaPoints.
objs | the list of objects. Each object is represented by an areaPoints object. | |
locs | the complete location list. | |
filteredLocs | a list, with a number of elements equal the number of objects in objs plus one, containing list of locations, one for each object. The first element of the vector will contain all locations assigned to the "background", ie. all locations that do not correspond to any object in the objs list. |
bool lti::locationSelector::apply | ( | const matrix< int > & | mask, | |
const std::list< location > & | locs, | |||
std::vector< std::list< location > > & | filteredLocs | |||
) | const |
Separate the locations list "locs" into several smaller location lists, each one having locations for one corresponding label in the labeled mask.
mask | the label mask to select locations. | |
locs | the complete location list. | |
filteredLocs | a vector, indexed by the label number in the mask, containing list of locations. |
Remove all locations from the given list, for which the corresponding entry in the mask have the value getParameters().eraseEntry.
mask | the decision-mask for the locations | |
locs | location list. If for a location loc in the list holds mask.at(loc.position) == getParameters().eraseEntry, then the location will be removed from the list. |
virtual functor* lti::locationSelector::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
locationSelector& lti::locationSelector::copy | ( | const locationSelector & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
const parameters& lti::locationSelector::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::functor.
virtual const char* lti::locationSelector::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("locationSelector")
Reimplemented from lti::functor.
locationSelector& lti::locationSelector::operator= | ( | const locationSelector & | other | ) |