VidSegm Class Reference

Video segmentatin class. More...

#include <VidSegm.hpp>

Collaboration diagram for VidSegm:
[legend]

List of all members.

Public Member Functions

 VidSegm (int winxy, int winz, int stepxy, int stepz, PatchOptions::norm_type nt, double bkv, int K, int n, double reg, int nf=0, int bkvf=0)
 initialize a video segmentor object.
void learnDTM (string vpath, bool doseg=true)
 learn the dtm using training video.
void segmentVideoSequence (std::vector< string > path, int stepxy, int stepz, int filtxy, int filtz, string opath)
 segments a set of videos in a sequence.
Mat segmentVideo (Mat vid, int stepxy, int stepz, int filtxy, int filtz, Mat &osmask)
 Memory efficient single video segmentation function.
Mat segm_mask ()
 Computes segmentation mask using class and location info of patches.
Mat maxvotefilt (Mat I, int sx, int sy, int sz, int nclass)
 maximum vote filter.

Public Attributes

DytexMix dtm
 dynamix texture mixture learned from training video.
Mat initSegm
 initial training video segmentation.
PatchOptions popt
 patch options for dtm learning and segmentation.
int K
 number of segments.
int n
 number of states.
double regV
 regularization value for the dtm.
int nfrm
 number of frames to use for the training video.
Point3i coff
 offset to center of patch.
vector< int > allx
 all x-locations on step grid.
vector< int > ally
 all y-locations on step grid.
vector< int > allz
 all z-locations on step grid.
Point3i vidsize
 size of the video.
vector< Point3i > locall
 coordinates of top-left of all patches.
vector< bool > locall_mask
 mask for all patches.
std::vector< int > allclasses
 classes for all valid patches.

Detailed Description

Video segmentatin class.

Can be used to segment a video or video sequence using dynamic textures.

See also:
DytexMix.

Definition at line 26 of file VidSegm.hpp.


Constructor & Destructor Documentation

VidSegm::VidSegm ( int  winxy,
int  winz,
int  stepxy,
int  stepz,
PatchOptions::norm_type  nt,
double  bkv,
int  K,
int  n,
double  reg,
int  nf = 0,
int  bkvf = 0 
)

initialize a video segmentor object.

Parameters:
winxy xy patch size.
winz z patch size.
stepxy xy step size.
stepz z step size.
nt patch normalization tyep.
bkv minimum background variance.
K number of segments.
n number of states.
reg dtm regularization value.
nf number of frames to use for training.
bkvf number of frames to look for variance test (make patches more strict).
See also:
learnDTM.

Definition at line 68 of file VidSegm.cpp.


Member Function Documentation

void VidSegm::learnDTM ( string  vpath,
bool  dosegm = true 
)

learn the dtm using training video.

Parameters:
vpath training video dat file path.
doseg do the initial segmentation or not.

Can be used for the initial segmentation of the training video.

See also:
segmentVideoSequence.

Definition at line 93 of file VidSegm.cpp.

Here is the call graph for this function:

Mat VidSegm::maxvotefilt ( Mat  I,
int  sx,
int  sy,
int  sz,
int  numclass 
)

maximum vote filter.

Parameters:
I input video.
sx x filter size.
sy y filter size.
sz z filter size.
nclass number of classes in the video.
Returns:
filtered video.

Can be used to smooth out the segmentation results.

See also:
segmentVideo.

Definition at line 897 of file VidSegm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Mat VidSegm::segm_mask (  ) 

Computes segmentation mask using class and location info of patches.

Returns:
segmentation mask for each frame of video

computes the mask using NN filling method.

Remarks:
location and class infos must be filled before calling this function. Must be called after segmentvideo is called
See also:
segmentVideo.

Definition at line 586 of file VidSegm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Mat VidSegm::segmentVideo ( Mat  vid,
int  stepxy,
int  stepz,
int  filtxy,
int  filtz,
Mat &  osmask 
)

Memory efficient single video segmentation function.

Parameters:
vid video to segment.
stepxy xy scale/step for patches.
stepz z scale/setep for patches.
filtxy xy size of the maxvote smoothing filter applied to the segmentation mask.
filtz z size of the maxvote smoothing filter applied to the segmentation mask.
osmask output segmentation mask.
Returns:
color segmented video

Segments the video in chunks and saves classes and locations for producing overall segmentation mask and color segmentation .

Remarks:
In general one should use segmentVideoSequence function and not call this directly.
See also:
segmentVideoSequence.

Definition at line 389 of file VidSegm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void VidSegm::segmentVideoSequence ( std::vector< string >  paths,
int  stepxy,
int  stepz,
int  filtxy,
int  filtz,
string  vidPath2 
)

segments a set of videos in a sequence.

Parameters:
path path vector of all videos in order.
stepxy segmentation step xy size.
stepz segmentation step z size.
filtxy max vote filter xy size.
filtz max vote filter z size.
opath path of the output video, mask files.

can also be used to segment just one video.

Remarks:
dtm must be ready before calling this function.
See also:
learnDTM.

Definition at line 159 of file VidSegm.cpp.

Here is the call graph for this function:


The documentation for this class was generated from the following files:

Generated on 18 Dec 2014 for libdt-OpenCV by  doxygen 1.6.1