Video segmentatin class. More...
#include <VidSegm.hpp>
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. | |
Video segmentatin class.
Can be used to segment a video or video sequence using dynamic textures.
Definition at line 26 of file VidSegm.hpp.
| 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.
| 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). |
Definition at line 68 of file VidSegm.cpp.
| void VidSegm::learnDTM | ( | string | vpath, | |
| bool | dosegm = true | |||
| ) |
learn the dtm using training video.
| vpath | training video dat file path. | |
| doseg | do the initial segmentation or not. |
Can be used for the initial segmentation of the training video.
Definition at line 93 of file VidSegm.cpp.
| Mat VidSegm::maxvotefilt | ( | Mat | I, | |
| int | sx, | |||
| int | sy, | |||
| int | sz, | |||
| int | numclass | |||
| ) |
maximum vote filter.
| I | input video. | |
| sx | x filter size. | |
| sy | y filter size. | |
| sz | z filter size. | |
| nclass | number of classes in the video. |
Can be used to smooth out the segmentation results.
Definition at line 897 of file VidSegm.cpp.
| Mat VidSegm::segm_mask | ( | ) |
Computes segmentation mask using class and location info of patches.
computes the mask using NN filling method.
Definition at line 586 of file VidSegm.cpp.
| Mat VidSegm::segmentVideo | ( | Mat | vid, | |
| int | stepxy, | |||
| int | stepz, | |||
| int | filtxy, | |||
| int | filtz, | |||
| Mat & | osmask | |||
| ) |
Memory efficient single video segmentation function.
| 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. |
Segments the video in chunks and saves classes and locations for producing overall segmentation mask and color segmentation .
Definition at line 389 of file VidSegm.cpp.
| 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.
| 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.
Definition at line 159 of file VidSegm.cpp.
1.6.1