kmeans::OverlapTracker Class Reference

Inheritance diagram for kmeans::OverlapTracker:

kmeans::MultiscaleObjectTracker List of all members.

Detailed Description

A multiscale object tracker that uses the overlap between objects to determine which objects correspond to each other.

At the coarser scale, only overlapping objects will be considered. This imposes a maximum speed on these large-scale objects.

At finer scales, mapping will be done through assignment based on the containment relationship if overlap fails.

Author:
Lakshman
Version:
Id
OverlapTracker.h,v 1.3 2009/06/02 20:17:50 lakshman Exp


Public Types

typedef std::vector< int > Assignment
 For each label in the current image, the region number in the previous image that matches.
typedef std::vector< RegionPropertyRegionsProperties
 For each label in the previous image, the region properties including movement information.

Public Member Functions

virtual ~OverlapTracker ()
void setIntermediateOutput (const std::string &toThisPrefix)
 An option that subclasses may want to provide is to write their intermediate outputs to the prefix provided here.
void track (const LImage< int > &originalImage, const std::vector< LImage< int > > &segmentedScales)
 Pass in the original image (needed for computing regions properties if needed to break ties, etc) and all the segmented scales that you would get by called Segmenter's getScale method.
const std::vector< Assignment > & getAssignments () const
 Returns the assigments at all the scales.
const AssignmentgetAssignment (size_t i) const
 Returns the assignment at the ith scale.
const std::vector< RegionsProperties > & getRegionsProperties () const
 Returns the properties of all the regions at all the scales.
const RegionsPropertiesgetRegionsProperties (size_t i) const
 Returns the properties of the regions at the ith scale.
size_t getNumScales () const
 The number of scales for which assignments are available.
void printAssignment (std::ostream &os, size_t scale) const
 Prints the assignment to the passed in stream.
void printRegions (std::ostream &os, size_t scale) const
 Prints the movement associated with each region to the input stream.
LImage< int > getMovementImage (size_t scale=0, bool useArrows=false) const
 Returns an image in which every 3x3 block contains the vector that represents the maximum movement in that block.

Static Public Member Functions

static LImage< int > advectImage (const LImage< int > &segimg, const RegionsProperties &regprop)
 Will advect the regions in the passed-in segmented image using the region properties specified.

Protected Member Functions

virtual void doOverlapAssignment (const LImage< int > &prev, const LImage< int > &curr, const RegionsProperties &prevRegions, Assignment *assignment)
 Assignment based on overlap only.
void computeContainedRegions (const LImage< int > &detail, const LImage< int > &coarse, std::vector< std::set< int > > *regs)
 Compute the regions in the detail image that are contained in the every region of the coarse image.

Static Protected Member Functions

static LImage< int > advectImage (const LImage< int > &segimg, const RegionsProperties &regprop, const Assignment &mapping)
 Will advect the regions in the passed-in segmented image using the region properties specified.
static LImage< int > advectImage (const LImage< int > &coarseimg, const LImage< int > &detailimg, const RegionsProperties &regprop, const Assignment &mapping)
 Will advect the regions in the passed-in detail image using the region properties specified.

Protected Attributes

std::string prefix
 An option that subclasses may want to provide is to write their intermediate outputs to the prefix provided here.

Classes

class  Candidate
 Handles the candidates in an overlap assignment. More...


Member Typedef Documentation

typedef std::vector<int> kmeans::MultiscaleObjectTracker::Assignment [inherited]

For each label in the current image, the region number in the previous image that matches.

If zero or less than zero, there is no match.

typedef std::vector< RegionProperty > kmeans::MultiscaleObjectTracker::RegionsProperties [inherited]

For each label in the previous image, the region properties including movement information.


Constructor & Destructor Documentation

virtual kmeans::OverlapTracker::~OverlapTracker (  )  [inline, virtual]


Member Function Documentation

static LImage<int> kmeans::MultiscaleObjectTracker::advectImage ( const LImage< int > &  coarseimg,
const LImage< int > &  detailimg,
const RegionsProperties regprop,
const Assignment mapping 
) [static, protected, inherited]

Will advect the regions in the passed-in detail image using the region properties specified.

A mapping of the labels in the coarse image which belongs to the previous frame to the actual region number in the current frame (and hence the regprop array) should be provided.

static LImage<int> kmeans::MultiscaleObjectTracker::advectImage ( const LImage< int > &  segimg,
const RegionsProperties regprop,
const Assignment mapping 
) [static, protected, inherited]

Will advect the regions in the passed-in segmented image using the region properties specified.

A mapping of the labels in the segmented image which belongs to the previous frame to the actual region number in the current frame (and hence the regprop array) should be provided.

static LImage<int> kmeans::MultiscaleObjectTracker::advectImage ( const LImage< int > &  segimg,
const RegionsProperties regprop 
) [static, inherited]

Will advect the regions in the passed-in segmented image using the region properties specified.

The movements encoded in the region props is used, so the region numbers in the segmented image should be the ones used to index the regprop array.

void kmeans::OverlapTracker::computeContainedRegions ( const LImage< int > &  detail,
const LImage< int > &  coarse,
std::vector< std::set< int > > *  regs 
) [protected]

Compute the regions in the detail image that are contained in the every region of the coarse image.

virtual void kmeans::OverlapTracker::doOverlapAssignment ( const LImage< int > &  prev,
const LImage< int > &  curr,
const RegionsProperties prevRegions,
Assignment assignment 
) [protected, virtual]

Assignment based on overlap only.

A template method called by the doTracking() method.

const Assignment& kmeans::MultiscaleObjectTracker::getAssignment ( size_t  i  )  const [inline, inherited]

Returns the assignment at the ith scale.

0 is the most detailed scale, and getNumScales()-1 is the most coarse. Results are undefined if i is passed outside of this range.

const std::vector<Assignment>& kmeans::MultiscaleObjectTracker::getAssignments (  )  const [inline, inherited]

Returns the assigments at all the scales.

See also:
getAssignment

LImage<int> kmeans::MultiscaleObjectTracker::getMovementImage ( size_t  scale = 0,
bool  useArrows = false 
) const [inherited]

Returns an image in which every 3x3 block contains the vector that represents the maximum movement in that block.

The gray value represents the speed, while the direction of the arrow represents the direction.

There are two types of movement images possible -- using arrows to show the movement direction or to use a flow-effect. The flow effect is nicer, but may not be so clear-cut if there are too many small regions.

size_t kmeans::MultiscaleObjectTracker::getNumScales (  )  const [inherited]

The number of scales for which assignments are available.

const RegionsProperties& kmeans::MultiscaleObjectTracker::getRegionsProperties ( size_t  i  )  const [inline, inherited]

Returns the properties of the regions at the ith scale.

0 is the most detailed scale, and getNumScales()-1 is the most coarse. Results are undefined if i is passed outside of this range.

const std::vector<RegionsProperties>& kmeans::MultiscaleObjectTracker::getRegionsProperties (  )  const [inline, inherited]

Returns the properties of all the regions at all the scales.

See also:
getRegionsProperties

void kmeans::MultiscaleObjectTracker::printAssignment ( std::ostream &  os,
size_t  scale 
) const [inherited]

Prints the assignment to the passed in stream.

See also:
getAssignment for the meaning of the scale.

void kmeans::MultiscaleObjectTracker::printRegions ( std::ostream &  os,
size_t  scale 
) const [inherited]

Prints the movement associated with each region to the input stream.

void kmeans::MultiscaleObjectTracker::setIntermediateOutput ( const std::string &  toThisPrefix  )  [inline, inherited]

An option that subclasses may want to provide is to write their intermediate outputs to the prefix provided here.

Normal usage is to add an extension to the prefix and write the file out there.

void kmeans::MultiscaleObjectTracker::track ( const LImage< int > &  originalImage,
const std::vector< LImage< int > > &  segmentedScales 
) [inherited]

Pass in the original image (needed for computing regions properties if needed to break ties, etc) and all the segmented scales that you would get by called Segmenter's getScale method.


Member Data Documentation

std::string kmeans::MultiscaleObjectTracker::prefix [protected, inherited]

An option that subclasses may want to provide is to write their intermediate outputs to the prefix provided here.

Normal usage is to add an extension to the prefix and write the file out there.


Generated on Fri May 4 13:40:22 2012 for WDSS-IIw2algs by  doxygen 1.4.7