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

Segmentation represents the complete segmentation of the elements in an image sequence. More...

#include <ncutCore.h>

List of all members.

Public Member Functions

Settingsetting ()
 Get a pointer to the settings (parameters) used by this Segmentation.
const Image< IMG_ELM_TYPE > * frame (unsigned int num) const
 Get a pointer to one frame of the frame sequence.
const Image< MSK_ELM_TYPE > * elmMask (unsigned int num) const
 Get a pointer to one frame of the mask sequence.
const MSK_ELM_TYPE & elmMask (unsigned int num, unsigned int pxl) const
 Get the value of one pixel of a frame in the mask sequence.
const IMG_ELM_TYPE & frameMask (unsigned int num, unsigned int pxl) const
 Get the value of one pixel of a frame in the frame sequence.
unsigned int width () const
 Get the width of the video sequences.
unsigned int height () const
 Get the height of the video sequences.
unsigned int nChl () const
 Get the number of channels of the video sequence.
unsigned int nElm () const
 Get the number of elements in the current frame window.
double locationX (unsigned int seg) const
 Get the x-midpoint position of a segment in the current frame window.
double locationY (unsigned int seg) const
 Get the y-midpoint position of a segment in the current frame window.
unsigned int nSeg () const
 Get the number of segments in the current frame window.
unsigned int nFrm () const
 Get the number of segmented frames since the creation of this Segmentation.
unsigned int wSize () const
 Get the size of the frame window in frames.
const std::map< MSK_ELM_TYPE,
unsigned int > * 
indices () const
 Get the index map of the segments in the current frame window.
unsigned int idx (const MSK_ELM_TYPE &segId) const
 Get the index of a segment in the current frame window.
const MSK_ELM_TYPE & id (unsigned int segIdx) const
 Get the unique identifier of a segment in the current frame window.
const MSK_ELM_TYPE & segMask (const MSK_ELM_TYPE &elmId) const
 Get the segment an element is part of.
const std::vector< unsigned
int > * 
pixels (unsigned int elmIdx) const
 Get a list of pixels in an element.
double nPixels (int seg) const
 Get the number of pixels in a segment.
const std::vector< unsigned
int > * 
elements (unsigned int segIdx) const
 Get a list of elements in a segment.
unsigned int frameOf (unsigned int elmIdx) const
 Get the frame number in the current frame window an element is in.
unsigned int age (const MSK_ELM_TYPE &segId) const
 Get the age of a segment.
const std::map< MSK_ELM_TYPE,
unsigned int > * 
age () const
 Get a pointer to the age map.
const bool inactive (const MSK_ELM_TYPE &segId) const
 Check if a segment is active (present) in the current frame window.
const std::map< MSK_ELM_TYPE,
bool > * 
inactive () const
 Get a pointer to the inactive map.
const MSK_ELM_TYPE & simSeg (const MSK_ELM_TYPE &segId) const
 Get the most similar segment to a given segment.
const NcutNode< IMG_ELM_TYPE,
MSK_ELM_TYPE > * 
dendogram () const
 Get the root NcutNode of the dendogram of the current frame window.
const ElementProfile< IMG_ELM_TYPE,
MSK_ELM_TYPE > * 
elmProfile () const
 Get the ElementProfile of the current frame window.
const SegmentProfile< IMG_ELM_TYPE,
MSK_ELM_TYPE > * 
segProfile () const
 Get the SegmentProfile of the current frame window.
const Settingsetting () const
 Get a pointer to the settings (parameters) used by this Segmentation.
int push (const Image< IMG_ELM_TYPE > *frame, const Image< MSK_ELM_TYPE > *mask)
 Push frame and mask onto the sequence for segmentation.
 Segmentation (unsigned int wSize=3, Setting setting=Setting())
 Segmentation constructor.
 Segmentation (const Segmentation &clone)
 Segmentation copy constructor.
virtual ~Segmentation ()
 Segmentation destructor.
virtual Segmentationoperator= (const Segmentation &clone)
 Segmentation assignment operator.

Protected Attributes

Setting setting_
NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE > * dendogram_
ElementProfile< IMG_ELM_TYPE,
MSK_ELM_TYPE > 
elmProfile_
SegmentProfile< IMG_ELM_TYPE,
MSK_ELM_TYPE > 
segProfile_


Detailed Description

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
class ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >

Segmentation represents the complete segmentation of the elements in an image sequence.

The datastructure used for segmentation is a dendogram consisting of NcutNodes . Segmentation contains a pointer to the root NcutNode. Each NcutNode represents a bipartition of a part of the image into two halves. Each NcutNode may have two child NcutNodes representing the further bipartition of each of the two halves. The dendogram has a maximum depth and a desired number of eigenvectors per ncut. Use push to push furher images and correspondings masks for segmentation.


Constructor & Destructor Documentation

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::Segmentation unsigned int  wSize = 3,
Setting  setting = Setting()
 

Segmentation constructor.

Parameters:
wSize The size of the time window in frames.
setting The parameters of the current segmentation.
Creates a new Segmentation that moves a frame window of wSize frames over the whole sequence and calculates ncuts for the window in every step.

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

Segmentation copy constructor.

Parameters:
clone The Segmentation to be cloned.


Member Function Documentation

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const std::map<MSK_ELM_TYPE, unsigned int>* ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::age  )  const [inline]
 

Get a pointer to the age map.

Returns:
Pointer to the age map.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
unsigned int ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::age const MSK_ELM_TYPE &  segId  )  const [inline]
 

Get the age of a segment.

Parameters:
segId Identifier of the segment.
Returns:
Age of a segment.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const NcutNode<IMG_ELM_TYPE, MSK_ELM_TYPE>* ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::dendogram  )  const [inline]
 

Get the root NcutNode of the dendogram of the current frame window.

Returns:
Root NcutNode of the dendogram of the current frame window.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const std::vector<unsigned int>* ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::elements unsigned int  segIdx  )  const [inline]
 

Get a list of elements in a segment.

Parameters:
segIdx Index of the segment.
Returns:
List of the indices of the elements in the segment.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const MSK_ELM_TYPE& ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::elmMask unsigned int  num,
unsigned int  pxl
const [inline]
 

Get the value of one pixel of a frame in the mask sequence.

Parameters:
num The sequence number of the frame.
pxl The number of the pixel (starting from top left).
Returns:
Value of one pixel of a frame in the mask sequence.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const Image<MSK_ELM_TYPE>* ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::elmMask unsigned int  num  )  const [inline]
 

Get a pointer to one frame of the mask sequence.

Parameters:
num The sequence number of the frame.
Returns:
Pointer to one frame of the mask sequence.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const ElementProfile<IMG_ELM_TYPE, MSK_ELM_TYPE>* ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::elmProfile  )  const [inline]
 

Get the ElementProfile of the current frame window.

Returns:
ElementProfile of the current frame window.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const Image<IMG_ELM_TYPE>* ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::frame unsigned int  num  )  const [inline]
 

Get a pointer to one frame of the frame sequence.

Parameters:
num The sequence number of the frame.
Returns:
Pointer to one frame of the frame sequence.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const IMG_ELM_TYPE& ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::frameMask unsigned int  num,
unsigned int  pxl
const [inline]
 

Get the value of one pixel of a frame in the frame sequence.

Parameters:
num The sequence number of the frame.
pxl The number of the pixel (starting from top left).
Returns:
Value of one pixel of a frame in the frame sequence.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
unsigned int ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::frameOf unsigned int  elmIdx  )  const [inline]
 

Get the frame number in the current frame window an element is in.

Parameters:
elmIdx Index of the element.
Returns:
Number of the frame in the current frame window (not the sequence number of the frame).

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
unsigned int ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::height  )  const [inline]
 

Get the height of the video sequences.

Returns:
Height of the video sequences.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const MSK_ELM_TYPE& ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::id unsigned int  segIdx  )  const [inline]
 

Get the unique identifier of a segment in the current frame window.

Parameters:
segIdx Index of the segment in the current frame window.
Returns:
Unique identifier of a segment in the current frame window.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
unsigned int ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::idx const MSK_ELM_TYPE &  segId  )  const [inline]
 

Get the index of a segment in the current frame window.

Parameters:
segId Unique identifier of the segment.
Returns:
Index of a segment in the current frame window.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const std::map<MSK_ELM_TYPE, bool>* ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::inactive  )  const [inline]
 

Get a pointer to the inactive map.

Returns:
Pointer to the inactive map.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const bool ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::inactive const MSK_ELM_TYPE &  segId  )  const [inline]
 

Check if a segment is active (present) in the current frame window.

Parameters:
segId Identifier of the segment.
Returns:
true if inactive, false otherwise.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const std::map<MSK_ELM_TYPE, unsigned int>* ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::indices  )  const [inline]
 

Get the index map of the segments in the current frame window.

Returns:
Index map of the segments in the current frame window.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
double ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::locationX unsigned int  seg  )  const [inline]
 

Get the x-midpoint position of a segment in the current frame window.

Parameters:
seg The index of the segment in the current frame window.
Returns:
X-midpoint position of a segment in the current frame window.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
double ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::locationY unsigned int  seg  )  const [inline]
 

Get the y-midpoint position of a segment in the current frame window.

Parameters:
seg The index of the segment in the current frame window.
Returns:
Y-midpoint position of a segment in the current frame window.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
unsigned int ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::nChl  )  const [inline]
 

Get the number of channels of the video sequence.

Returns:
Number of channels of the video sequence.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
unsigned int ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::nElm  )  const [inline]
 

Get the number of elements in the current frame window.

Returns:
Number of elements in the current frame window.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
unsigned int ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::nFrm  )  const [inline]
 

Get the number of segmented frames since the creation of this Segmentation.

Returns:
Number of segmented frames since the creation of this Segmentation.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
double ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::nPixels int  seg  )  const [inline]
 

Get the number of pixels in a segment.

Parameters:
seg Index of the segment.
Returns:
Number of pixels in a segment.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
unsigned int ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::nSeg  )  const [inline]
 

Get the number of segments in the current frame window.

Returns:
Number of segments in the current frame window.

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

Segmentation assignment operator.

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

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const std::vector<unsigned int>* ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::pixels unsigned int  elmIdx  )  const [inline]
 

Get a list of pixels in an element.

Parameters:
elmIdx Index of the element.
Returns:
List of pixels in an element.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
int ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::push const Image< IMG_ELM_TYPE > *  frame,
const Image< MSK_ELM_TYPE > *  mask
 

Push frame and mask onto the sequence for segmentation.

Parameters:
frame The frame image that should be pushed to the frame sequence for segmentation.
mask The pre-segmentation mask for the frame image.
Returns:
1 if there aren't enough frames in the sequence to start segmentation yet, 0 otherwise.
Pushes frame and mask to the back of the frame and mask sequences, calculates new profiles, constructs a new ncut dendogram and updates segment information.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const MSK_ELM_TYPE& ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::segMask const MSK_ELM_TYPE &  elmId  )  const [inline]
 

Get the segment an element is part of.

Parameters:
elmId Identifier of the element.
Returns:
Identifier of the segment the element is part of.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const SegmentProfile<IMG_ELM_TYPE, MSK_ELM_TYPE>* ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::segProfile  )  const [inline]
 

Get the SegmentProfile of the current frame window.

Returns:
SegmentProfile of the current frame window.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const Setting* ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::setting  )  const [inline]
 

Get a pointer to the settings (parameters) used by this Segmentation.

Returns:
Pointer to the settings (parameters) used by this Segmentation. This function is for read access only.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
Setting* ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::setting  )  [inline]
 

Get a pointer to the settings (parameters) used by this Segmentation.

Returns:
Pointer to the settings (parameters) used by this Segmentation. This function is for read&write access.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const MSK_ELM_TYPE& ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::simSeg const MSK_ELM_TYPE &  segId  )  const [inline]
 

Get the most similar segment to a given segment.

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

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
unsigned int ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::width  )  const [inline]
 

Get the width of the video sequences.

Returns:
Width of the video sequences.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
unsigned int ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::wSize  )  const [inline]
 

Get the size of the frame window in frames.

Returns:
Size of the frame window in frames.


Member Data Documentation

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
NcutNode<IMG_ELM_TYPE, MSK_ELM_TYPE>* ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::dendogram_ [protected]
 

the root node of the ncut dendogram

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
ElementProfile<IMG_ELM_TYPE, MSK_ELM_TYPE> ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::elmProfile_ [protected]
 

holds the element information and the similarity matrix

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
SegmentProfile<IMG_ELM_TYPE, MSK_ELM_TYPE> ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::segProfile_ [protected]
 

holds the segment information

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
Setting ncut::Segmentation< IMG_ELM_TYPE, MSK_ELM_TYPE >::setting_ [protected]
 

Contains all needed parameters


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