OpenCV 2.4.3.1

org.opencv.contrib
Class StereoVar

java.lang.Object
  extended by org.opencv.contrib.StereoVar

public class StereoVar
extends java.lang.Object

Class for computing stereo correspondence using the variational matching algorithm

class StereoVar

// C++ code:

StereoVar();

StereoVar(int levels, double pyrScale,

int nIt, int minDisp, int maxDisp,

int poly_n, double poly_sigma, float fi,

float lambda, int penalization, int cycle,

int flags);

virtual ~StereoVar();

virtual void operator()(InputArray left, InputArray right, OutputArray disp);

int levels;

double pyrScale;

int nIt;

int minDisp;

int maxDisp;

int poly_n;

double poly_sigma;

float fi;

float lambda;

int penalization;

int cycle;

int flags;...

};

The class implements the modified S. G. Kosov algorithm [Publication] that differs from the original one as follows:

See Also:
org.opencv.contrib.StereoVar

Field Summary
static int CYCLE_O
           
static int CYCLE_V
           
protected  long nativeObj
           
static int PENALIZATION_CHARBONNIER
           
static int PENALIZATION_PERONA_MALIK
           
static int PENALIZATION_TICHONOV
           
static int USE_AUTO_PARAMS
           
static int USE_EQUALIZE_HIST
           
static int USE_INITIAL_DISPARITY
           
static int USE_MEDIAN_FILTERING
           
static int USE_SMART_ID
           
 
Constructor Summary
  StereoVar()
          The constructor The first constructor initializes StereoVar with all the default parameters.
  StereoVar(int levels, double pyrScale, int nIt, int minDisp, int maxDisp, int poly_n, double poly_sigma, float fi, float lambda, int penalization, int cycle, int flags)
          The constructor The first constructor initializes StereoVar with all the default parameters.
protected StereoVar(long addr)
           
 
Method Summary
 void compute(Mat left, Mat right, Mat disp)
           
protected  void finalize()
           
 int get_cycle()
           
 float get_fi()
           
 int get_flags()
           
 float get_lambda()
           
 int get_levels()
           
 int get_maxDisp()
           
 int get_minDisp()
           
 int get_nIt()
           
 int get_penalization()
           
 int get_poly_n()
           
 double get_poly_sigma()
           
 double get_pyrScale()
           
 void set_cycle(int cycle)
           
 void set_fi(float fi)
           
 void set_flags(int flags)
           
 void set_lambda(float lambda)
           
 void set_levels(int levels)
           
 void set_maxDisp(int maxDisp)
           
 void set_minDisp(int minDisp)
           
 void set_nIt(int nIt)
           
 void set_penalization(int penalization)
           
 void set_poly_n(int poly_n)
           
 void set_poly_sigma(double poly_sigma)
           
 void set_pyrScale(double pyrScale)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CYCLE_O

public static final int CYCLE_O
See Also:
Constant Field Values

CYCLE_V

public static final int CYCLE_V
See Also:
Constant Field Values

nativeObj

protected final long nativeObj

PENALIZATION_CHARBONNIER

public static final int PENALIZATION_CHARBONNIER
See Also:
Constant Field Values

PENALIZATION_PERONA_MALIK

public static final int PENALIZATION_PERONA_MALIK
See Also:
Constant Field Values

PENALIZATION_TICHONOV

public static final int PENALIZATION_TICHONOV
See Also:
Constant Field Values

USE_AUTO_PARAMS

public static final int USE_AUTO_PARAMS
See Also:
Constant Field Values

USE_EQUALIZE_HIST

public static final int USE_EQUALIZE_HIST
See Also:
Constant Field Values

USE_INITIAL_DISPARITY

public static final int USE_INITIAL_DISPARITY
See Also:
Constant Field Values

USE_MEDIAN_FILTERING

public static final int USE_MEDIAN_FILTERING
See Also:
Constant Field Values

USE_SMART_ID

public static final int USE_SMART_ID
See Also:
Constant Field Values
Constructor Detail

StereoVar

public StereoVar()

The constructor

The first constructor initializes StereoVar with all the default parameters. So, you only have to set StereoVar.maxDisp and / or StereoVar.minDisp at minimum. The second constructor enables you to set each parameter to a custom value.

See Also:
org.opencv.contrib.StereoVar.StereoVar

StereoVar

public StereoVar(int levels,
                 double pyrScale,
                 int nIt,
                 int minDisp,
                 int maxDisp,
                 int poly_n,
                 double poly_sigma,
                 float fi,
                 float lambda,
                 int penalization,
                 int cycle,
                 int flags)

The constructor

The first constructor initializes StereoVar with all the default parameters. So, you only have to set StereoVar.maxDisp and / or StereoVar.minDisp at minimum. The second constructor enables you to set each parameter to a custom value.

Parameters:
levels - The number of pyramid layers, including the initial image. levels=1 means that no extra layers are created and only the original images are used. This parameter is ignored if flag USE_AUTO_PARAMS is set.
pyrScale - Specifies the image scale (<1) to build the pyramids for each image. pyrScale=0.5 means the classical pyramid, where each next layer is twice smaller than the previous. (This parameter is ignored if flag USE_AUTO_PARAMS is set).
nIt - The number of iterations the algorithm does at each pyramid level. (If the flag USE_SMART_ID is set, the number of iterations will be redistributed in such a way, that more iterations will be done on more coarser levels.)
minDisp - Minimum possible disparity value. Could be negative in case the left and right input images change places.
maxDisp - Maximum possible disparity value.
poly_n - Size of the pixel neighbourhood used to find polynomial expansion in each pixel. The larger values mean that the image will be approximated with smoother surfaces, yielding more robust algorithm and more blurred motion field. Typically, poly_n = 3, 5 or 7
poly_sigma - Standard deviation of the Gaussian that is used to smooth derivatives that are used as a basis for the polynomial expansion. For poly_n=5 you can set poly_sigma=1.1, for poly_n=7 a good value would be poly_sigma=1.5
fi - The smoothness parameter, ot the weight coefficient for the smoothness term.
lambda - The threshold parameter for edge-preserving smoothness. (This parameter is ignored if PENALIZATION_CHARBONNIER or PENALIZATION_PERONA_MALIK is used.)
penalization - Possible values: PENALIZATION_TICHONOV - linear smoothness; PENALIZATION_CHARBONNIER - non-linear edge preserving smoothness; PENALIZATION_PERONA_MALIK - non-linear edge-enhancing smoothness. (This parameter is ignored if flag USE_AUTO_PARAMS is set).
cycle - Type of the multigrid cycle. Possible values: CYCLE_O and CYCLE_V for null- and v-cycles respectively. (This parameter is ignored if flag USE_AUTO_PARAMS is set).
flags - The operation flags; can be a combination of the following:
  • USE_INITIAL_DISPARITY: Use the input flow as the initial flow approximation.
  • USE_EQUALIZE_HIST: Use the histogram equalization in the pre-processing phase.
  • USE_SMART_ID: Use the smart iteration distribution (SID).
  • USE_AUTO_PARAMS: Allow the method to initialize the main parameters.
  • USE_MEDIAN_FILTERING: Use the median filer of the solution in the post processing phase.
See Also:
org.opencv.contrib.StereoVar.StereoVar

StereoVar

protected StereoVar(long addr)
Method Detail

compute

public void compute(Mat left,
                    Mat right,
                    Mat disp)

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

get_cycle

public int get_cycle()

get_fi

public float get_fi()

get_flags

public int get_flags()

get_lambda

public float get_lambda()

get_levels

public int get_levels()

get_maxDisp

public int get_maxDisp()

get_minDisp

public int get_minDisp()

get_nIt

public int get_nIt()

get_penalization

public int get_penalization()

get_poly_n

public int get_poly_n()

get_poly_sigma

public double get_poly_sigma()

get_pyrScale

public double get_pyrScale()

set_cycle

public void set_cycle(int cycle)

set_fi

public void set_fi(float fi)

set_flags

public void set_flags(int flags)

set_lambda

public void set_lambda(float lambda)

set_levels

public void set_levels(int levels)

set_maxDisp

public void set_maxDisp(int maxDisp)

set_minDisp

public void set_minDisp(int minDisp)

set_nIt

public void set_nIt(int nIt)

set_penalization

public void set_penalization(int penalization)

set_poly_n

public void set_poly_n(int poly_n)

set_poly_sigma

public void set_poly_sigma(double poly_sigma)

set_pyrScale

public void set_pyrScale(double pyrScale)

Official OpenCV 2.4 Documentation