Inheritance diagram for kmeans::MultiscaleObjectTracker:
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< RegionProperty > | RegionsProperties |
For each label in the previous image, the region properties including movement information. | |
Public Member Functions | |
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. | |
virtual | ~MultiscaleObjectTracker () |
const std::vector< Assignment > & | getAssignments () const |
Returns the assigments at all the scales. | |
const Assignment & | getAssignment (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 RegionsProperties & | getRegionsProperties (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 ®prop) |
Will advect the regions in the passed-in segmented image using the region properties specified. | |
Static Protected Member Functions | |
static LImage< int > | advectImage (const LImage< int > &segimg, const RegionsProperties ®prop, 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 ®prop, 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. |
typedef std::vector<int> kmeans::MultiscaleObjectTracker::Assignment |
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 |
For each label in the previous image, the region properties including movement information.
virtual kmeans::MultiscaleObjectTracker::~MultiscaleObjectTracker | ( | ) | [inline, virtual] |
static LImage<int> kmeans::MultiscaleObjectTracker::advectImage | ( | const LImage< int > & | coarseimg, | |
const LImage< int > & | detailimg, | |||
const RegionsProperties & | regprop, | |||
const Assignment & | mapping | |||
) | [static, protected] |
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] |
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] |
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.
const Assignment& kmeans::MultiscaleObjectTracker::getAssignment | ( | size_t | i | ) | const [inline] |
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] |
LImage<int> kmeans::MultiscaleObjectTracker::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.
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 |
The number of scales for which assignments are available.
const RegionsProperties& kmeans::MultiscaleObjectTracker::getRegionsProperties | ( | size_t | i | ) | const [inline] |
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] |
void kmeans::MultiscaleObjectTracker::printAssignment | ( | std::ostream & | os, | |
size_t | scale | |||
) | const |
void kmeans::MultiscaleObjectTracker::printRegions | ( | std::ostream & | os, | |
size_t | scale | |||
) | const |
Prints the movement associated with each region to the input stream.
void kmeans::MultiscaleObjectTracker::setIntermediateOutput | ( | const std::string & | toThisPrefix | ) | [inline] |
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 | |||
) |
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.
std::string kmeans::MultiscaleObjectTracker::prefix [protected] |
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.