Flow Algorithm Video Segmentation (FAVS) Version 3.3

Source Code Usage Output Example

The Matlab code runs video segmentation by different criteria using HPF network flow algorithm:
Three objective options are available:
  1. Minimum Cut
  2. Normalized Cut Prime
  3. Ratio Cut
For definitions, see Reference .

Reference

Dorit S. Hochbaum, "Polynomial Time Algorithms for Ratio Regions and a Variant of Normalized Cut", IEEE Transactions on Pattern Analysis and Machine Intelligence, pp. 889-898, May, 2010. [ Link here ]

License Information

The source code is subject to the following academic license. Note this is not an open source license.

Copyright 2011. The Regents of the University of California (Regents). All Rights Reserved.

Permission to use, copy, modify, and distribute this software and its documentation for educational, research, and not-for-profit purposes, without fee and without a signed licensing agreement, is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies, modifications, and distributions. Contact The Office of Technology Licensing, UC Berkeley, 2150 Shattuck Avenue, Suite 510, Berkeley, CA 94720-1620, (510) 643-7201, for commercial licensing opportunities. Created by Bala Chandran and Dorit S. Hochbaum, Department of Industrial Engineering and Operations Research, University of California, Berkeley.

IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.


Source Code

The source is available as a zip file [FAVS-3.3.zip ].

Usage

Functional form:
function segments = FAVS(varargin)

Precondition:
pseudo_flow_windows.exe must be installed in the same directory.
The frames of a sequence is contained in a single folder and they are the only files in that folder.

Start:
Type FAVS at Command Window after the path is set to FAVS folder or open FAVS.mat and hit F5.

Parameter Options:
if do not specify any parameter, the program expects to
  1. open a window to load a picture frame in a folder containing a sequence of video frames; or
  2. a .mat file containing video feature for intensity ; or
  3. a .mat file containing the similarity matrix (in addition to intensity); or
  4. a .mat file containing the sources and sinks (in addition to all above).


Optional parameters:
At the Command Window run FAVS following the key words, then followed by the value. For example,

FAVS(...,'lambda', 2 ,...)

Key word Type Description
'lambda' Double Float parametric cut parameter
'skew' @function skew function to scale weights of similarities
'save features' 'yes' or 'no' whether to save features
'save similarity' 'yes' or 'no' whether to save similarity matrix
'save sandt' 'yes' or 'no' whether to save sources and sinks
'similarity type' Character Probability 'p', Correlation 'r', Absolute Distance 'a', and Euclidean Distance 'e'
'segment type' Character Min cut 'm', Normalized cut prime 'n', and ratio regions 'r'
'suppress visual' 'yes' or 'no' whether to supress the result of segmentation displayed visually

Output

segments: the segments of the frames in the sequence in a 3D matrix form, where different numbers in the matrix correspond to different segments.

Example

This example runs FAVS on the following image:

image

After downloading FAVS from the link above,

Pre-Step: Adjust LAMBDA variable and SKEW_FUNC in FAVS.mat
The best variables can be found by exhaustive search or trail-and-error.



After following the instruction on how to start the program:

Step 1: Select one image from the folder containing the video sequence
After the program is run, select the file corresponding to the image. Save feature data in a .mat file if desired.

image




Step 2: Select the type of the similarity measure to be used in constructing similarity matrix.
Save both feature data and similarity matrix in a .mat file if desired.

image




Step 3: Select seed nodes for source and sink by clicking anywhere in the picture(s).
Source seed nodes and sink seed nodes should be in separate parts of background and salient region. Save feature data, similarity matrix and seed node location(s) in a .mat file if desired.

image




Step 4: Select the segmentation method.
See Reference for the definitions of different methods.

image




Step 5: Segmentation results: display visually by selecting 'yes' at the prompt.
The output segments is also in the form of a matrix, where different numbers correspond to different segments.

image




RIOT Project
Last Updated: August 5, 2011
2011 Professor Dorit S.Hochbaum, All Rights Reserved Worldwide