Class cv::cuda::StereoConstantSpaceBP#

Class computing stereo correspondence using the constant space belief propagation algorithm. : View details

Collaboration diagram for cv::cuda::StereoConstantSpaceBP:

Public Member Functions#

Public Member Functions inherited from cv::cuda::StereoBeliefPropagation

Return

Name

Description

void

compute(
    InputArray data,
    OutputArray disparity,
    Stream & stream = Stream::Null() )

Enables the stereo correspondence operator that finds the disparity for the specified data cost.

void

compute(
    InputArray left,
    InputArray right,
    OutputArray disparity,
    Stream & stream )

double

getDataWeight()

data weight

double

getDiscSingleJump()

discontinuity single jump

double

getMaxDataTerm()

truncation of data cost

double

getMaxDiscTerm()

truncation of discontinuity cost

int

getMsgType()

type for messages (CV_16SC1 or CV_32FC1)

int

getNumIters()

number of BP iterations on each level

int

getNumLevels()

number of levels

void

setDataWeight(double data_weight)

void

setDiscSingleJump(double disc_single_jump)

void

setMaxDataTerm(double max_data_term)

void

setMaxDiscTerm(double max_disc_term)

void

setMsgType(int msg_type)

void

setNumIters(int iters)

void

setNumLevels(int levels)

Public Member Functions inherited from cv::Algorithm

Return

Name

Description

Algorithm()

~Algorithm()

void

clear()

Clears the algorithm state.

bool

empty()

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read.

String

getDefaultName()

void

read(const FileNode & fn)

Reads algorithm parameters from a file storage.

void

save(const String & filename)

void

write(
    const Ptr< FileStorage > & fs,
    const String & name = String() )

void

write(FileStorage & fs)

Stores algorithm parameters in a file storage.

void

write(
    FileStorage & fs,
    const String & name )

Static Public Member Functions#

Static Public Member Functions inherited from cv::cuda::StereoBeliefPropagation

Return

Name

Description

static void

estimateRecommendedParams(
    int width,
    int height,
    int & ndisp,
    int & iters,
    int & levels )

Uses a heuristic method to compute the recommended parameters ( ndisp, iters and levels ) for the specified image size ( width and height ).

Static Public Member Functions inherited from cv::Algorithm

Return

Name

Description

static Ptr< _Tp >

load(
    const String & filename,
    const String & objname = String() )

Loads algorithm from the file.

static Ptr< _Tp >

loadFromString(
    const String & strModel,
    const String & objname = String() )

Loads algorithm from a String.

static Ptr< _Tp >

read(const FileNode & fn)

Reads algorithm from the file node.

Additional Inherited Members#

Protected Member Functions inherited from cv::Algorithm

Return

Name

Description

void

writeFormat(FileStorage & fs)

Detailed Description#

Class computing stereo correspondence using the constant space belief propagation algorithm. :

The class implements algorithm described in Yang2010 . StereoConstantSpaceBP supports both local minimum and global minimum data cost initialization algorithms. For more details, see the paper mentioned above. By default, a local algorithm is used. To enable a global algorithm, set use_local_init_data_cost to false .

StereoConstantSpaceBP uses a truncated linear model for the data cost and discontinuity terms:

\[DataCost = data \_ weight \cdot \min ( \lvert I_2-I_1 \rvert , max \_ data \_ term)\]

\[DiscTerm = \min (disc \_ single \_ jump \cdot \lvert f_1-f_2 \rvert , max \_ disc \_ term)\]

For more details, see Yang2010 .

By default, StereoConstantSpaceBP uses floating-point arithmetics and the CV_32FC1 type for messages. But it can also use fixed-point arithmetics and the CV_16SC1 message type for better performance. To avoid an overflow in this case, the parameters must satisfy the following requirement:

\[10 \cdot 2^{levels-1} \cdot max \_ data \_ term < SHRT \_ MAX\]

Member Function Documentation#

getNrPlane()#

int cv::cuda::StereoConstantSpaceBP::getNrPlane()

number of active disparity on the first level

getUseLocalInitDataCost()#

bool cv::cuda::StereoConstantSpaceBP::getUseLocalInitDataCost()

setNrPlane()#

void cv::cuda::StereoConstantSpaceBP::setNrPlane(int nr_plane)

setUseLocalInitDataCost()#

void cv::cuda::StereoConstantSpaceBP::setUseLocalInitDataCost(bool use_local_init_data_cost)

estimateRecommendedParams()#

static void cv::cuda::StereoConstantSpaceBP::estimateRecommendedParams(
int width,
int height,
int & ndisp,
int & iters,
int & levels,
int & nr_plane )

Uses a heuristic method to compute parameters (ndisp, iters, levelsand nrplane) for the specified image size (widthand height).

Source file#

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