ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE > Class Template Reference

SegmentProfile handles the similarity information of the segments in a frame window. More...

#include <motionProfile.h>

Inheritance diagram for ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >:

ncut::Profile< IMG_ELM_TYPE, MSK_ELM_TYPE > List of all members.

Public Member Functions

const std::vector< std::vector<
MSK_ELM_TYPE > > * 
elements () const
 Get a list of elements for each segment in this profile.
const std::vector< MSK_ELM_TYPE > * elements (unsigned int idx) const
 Get a list of elements for a segment.
const ElementProfile< IMG_ELM_TYPE,
MSK_ELM_TYPE > * 
elmProfile () const
 Get the element profile for the elements contained in the segments.
const MSK_ELM_TYPE & mask (const MSK_ELM_TYPE &elmId) const
 Get the segment id for the element identified by elmId.
unsigned int idxMask (unsigned int elmIdx) const
 Get the segment index for the element with the given index.
unsigned int age (const MSK_ELM_TYPE &segId) const
 Get the age of a segment.
bool inactive (const MSK_ELM_TYPE &segId) const
 Get the active/inactive status of a segment.
const std::map< MSK_ELM_TYPE,
bool > * 
inactive () const
 Get the active/inactive list.
const std::map< MSK_ELM_TYPE,
unsigned int > * 
age () const
 Get the age list.
const MSK_ELM_TYPE & simSeg (const MSK_ELM_TYPE &segId) const
 Get the most similar segment to the given segment.
unsigned int nElm () const
 Get the number of elements in this segment profile.
unsigned int nSeg () const
 Get the number of segments in this segment profile.
unsigned int nChl () const
 Get the number of channels of the frames in this frame window.
double locationX (unsigned int seg) const
 Get the mean location x-coordinate of a segment.
double locationY (unsigned int seg) const
 Get the mean location y-coordinate of a segment.
unsigned int nPixels (unsigned int seg) const
 Get the number of pixels in a segment.
double dif (unsigned int idx1, unsigned int idx2, const std::vector< std::vector< MSK_ELM_TYPE > > *elements=NULL) const
 Calculate the difference between two segments.
int push (const ElementProfile< IMG_ELM_TYPE, MSK_ELM_TYPE > *elmProfile, const std::vector< std::vector< MSK_ELM_TYPE > > &segments)
 Calculate segment info of a new frame window and segmentation.
int calcSim ()
 Calculate segment similarity.
 SegmentProfile (const Setting *setting)
 SegmentProfile empty constructor.
 SegmentProfile (const SegmentProfile &clone)
 SegmentProfile copy constructor.
virtual ~SegmentProfile ()
 SegmentProfile destructor.
virtual SegmentProfileoperator= (const SegmentProfile &clone)
 SegmentProfile assignment operator.

Protected Attributes

std::vector< std::vector<
MSK_ELM_TYPE > > 
elements_
const ElementProfile< IMG_ELM_TYPE,
MSK_ELM_TYPE > * 
elmProfile_
std::map< MSK_ELM_TYPE, MSK_ELM_TYPE > mask_
std::vector< unsigned int > idxMask_
std::map< MSK_ELM_TYPE, unsigned
int > 
age_
std::map< MSK_ELM_TYPE, bool > inactive_
std::map< MSK_ELM_TYPE, MSK_ELM_TYPE > simSeg_
unsigned int nSeg_
unsigned int nChl_
MSK_ELM_TYPE nextSegId_
Matrix neighbors_
double ** intensity_
double * locationX_
double * locationY_
unsigned int * nElements_
unsigned int * nPixels_

Detailed Description

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
class ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >

SegmentProfile handles the similarity information of the segments in a frame window.

A SegmentProfile is used to store information about the segments resulting of the segmentation of one frame window. SegmentProfile is also used to determine the connections of segments from this frame window to segments from the last frame window. Throghout the sequence, segments are connected through their identifiers. segments that appear in consecutive frames and have the same identifiers are to be considered the same segment.


Constructor & Destructor Documentation

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::SegmentProfile const Setting setting  ) 
 

SegmentProfile empty constructor.

Parameters:
setting The parameters of the current segmentation.
Construct an empty SegmentProfile.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::SegmentProfile const SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE > &  clone  ) 
 

SegmentProfile copy constructor.

Parameters:
clone The SegmentProfile to be cloned.


Member Function Documentation

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
const std::map<MSK_ELM_TYPE, unsigned int>* ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::age  )  const [inline]
 

Get the age list.

Returns:
A map from segment identifiers to integers indicating the age of a segment with that identifier.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
unsigned int ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::age const MSK_ELM_TYPE &  segId  )  const
 

Get the age of a segment.

Parameters:
segId The identifier of the segment.
Returns:
The age of a segment with the given identifier.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
int ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::calcSim  ) 
 

Calculate segment similarity.

Returns:
0 if successful
Calculate the similarity of every segment to every other segment.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
double ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::dif unsigned int  idx1,
unsigned int  idx2,
const std::vector< std::vector< MSK_ELM_TYPE > > *  elements = NULL
const
 

Calculate the difference between two segments.

Parameters:
idx1 Index of segment 1.
idx2 Index of segment 2.
elements A segmentation, this paramter is optional.
Returns:
The difference between segment 1 and segment 2.
If the segments don't touch, a maximal value of 500 is returned. Optionally, a segmentation different from the segmentation in this SegmentProfile can be specified.

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
const std::vector<MSK_ELM_TYPE>* ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::elements unsigned int  idx  )  const [inline]
 

Get a list of elements for a segment.

Parameters:
idx The index of the segment.
Returns:
A list of elements for the given segment.

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
const std::vector<std::vector<MSK_ELM_TYPE> >* ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::elements  )  const [inline]
 

Get a list of elements for each segment in this profile.

Returns:
A list of elements for each segment in this profile. This function returns a vector containing vectors of element indices. Vector i contains the element indices of the elements contained in the segment with index i.

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
const ElementProfile<IMG_ELM_TYPE, MSK_ELM_TYPE>* ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::elmProfile  )  const [inline]
 

Get the element profile for the elements contained in the segments.

Returns:
The element profile for the elements contained in the segments.

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
unsigned int ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::idxMask unsigned int  elmIdx  )  const [inline]
 

Get the segment index for the element with the given index.

Parameters:
elmIdx The index of the element.
Returns:
The segment id for an element identified by elmId.

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
const std::map<MSK_ELM_TYPE, bool>* ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::inactive  )  const [inline]
 

Get the active/inactive list.

Returns:
A list of booleans indicating wether a segment is active or inactive (true for inactive, false for active).

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
bool ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::inactive const MSK_ELM_TYPE &  segId  )  const
 

Get the active/inactive status of a segment.

Parameters:
segId The identifier of the segment.
Returns:
true if the segment is inactive, false otherwise.

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
double ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::locationX unsigned int  seg  )  const [inline]
 

Get the mean location x-coordinate of a segment.

Parameters:
seg The index of the segment.
Returns:
The mean location x-coordinate of a segment (in pixels).

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
double ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::locationY unsigned int  seg  )  const [inline]
 

Get the mean location y-coordinate of a segment.

Parameters:
seg The index of the segment.
Returns:
The mean location y-coordinate of a segment (in pixels).

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const MSK_ELM_TYPE & ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::mask const MSK_ELM_TYPE &  elmId  )  const
 

Get the segment id for the element identified by elmId.

Parameters:
elmId The identifier of the element.
Returns:
The segment id for an element identified by elmId.

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
unsigned int ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::nChl  )  const [inline]
 

Get the number of channels of the frames in this frame window.

Returns:
The number of channels of the frames in this frame window.

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
unsigned int ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::nElm  )  const [inline]
 

Get the number of elements in this segment profile.

Returns:
The number of elements in this segment profile.

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
unsigned int ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::nPixels unsigned int  seg  )  const [inline]
 

Get the number of pixels in a segment.

Parameters:
seg The index of the segment.
Returns:
The number of pixels of the given segment.

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
unsigned int ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::nSeg  )  const [inline]
 

Get the number of segments in this segment profile.

Returns:
The number of segments in this segment profile.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE > & ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::operator= const SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE > &  clone  )  [virtual]
 

SegmentProfile assignment operator.

Parameters:
clone The SegmentProfile to be cloned.
Returns:
This object.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
int ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::push const ElementProfile< IMG_ELM_TYPE, MSK_ELM_TYPE > *  elmProfile,
const std::vector< std::vector< MSK_ELM_TYPE > > &  segments
 

Calculate segment info of a new frame window and segmentation.

Parameters:
elmProfile An ElementProfile.
segments A segmentation on the elements of elmProfile.
Returns:
0 if successful
Calculate all needed segment info using information from elmProfile and connect the new segments to the segments from the last frame window.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const MSK_ELM_TYPE & ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::simSeg const MSK_ELM_TYPE &  segId  )  const
 

Get the most similar segment to the given segment.

Parameters:
segId The identifier of the segment.
Returns:
The segment most similar to the given segment.


Member Data Documentation

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
std::map<MSK_ELM_TYPE, unsigned int> ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::age_ [protected]
 

the number of frames each segment has been active (= in the sequence) so far

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
std::vector<std::vector<MSK_ELM_TYPE> > ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::elements_ [protected]
 

a list of elements for each segment

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
const ElementProfile<IMG_ELM_TYPE, MSK_ELM_TYPE>* ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::elmProfile_ [protected]
 

the ElementProfile containing information about the elements the segments consist of

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
std::vector<unsigned int> ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::idxMask_ [protected]
 

a map from element indices to the segment indices of the segments they are part of

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
std::map<MSK_ELM_TYPE, bool> ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::inactive_ [protected]
 

true if a segment from the last frame window wasn't assigned to any segment in this frame window

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
double** ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::intensity_ [protected]
 

the mean intensity of each image channel

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
double* ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::locationX_ [protected]
 

the center-of-gravity X coordinate

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
double* ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::locationY_ [protected]
 

the center-of-gravity Y coordinate

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
std::map<MSK_ELM_TYPE, MSK_ELM_TYPE> ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::mask_ [protected]
 

a map from element identifiers to the segment identifers of the segments they are part of

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
unsigned int ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::nChl_ [protected]
 

the number of channels of the images

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
Matrix ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::neighbors_ [protected]
 

the number of neigboring pixels of every segment to every other segment

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
unsigned int* ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::nElements_ [protected]
 

the number of elements in each segment

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
unsigned int* ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::nPixels_ [protected]
 

the number of pixels in each segment

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
unsigned int ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::nSeg_ [protected]
 

the number of segments in this frame window

template<class IMG_ELM_TYPE = unsigned char, class MSK_ELM_TYPE = signed long>
std::map<MSK_ELM_TYPE, MSK_ELM_TYPE> ncut::SegmentProfile< IMG_ELM_TYPE, MSK_ELM_TYPE >::simSeg_ [protected]
 

the most similar segment of each segment


The documentation for this class was generated from the following file:
Generated on Thu Jun 22 14:47:21 2006 for ncut.kdevelop by  doxygen 1.4.6