OpenCV  2.4.13.7
Open Source Computer Vision
cv::SVD Class Reference

#include <core.hpp>

Public Types

enum  { MODIFY_A =1, NO_UV =2, FULL_UV =4 }
 

Public Member Functions

 SVD ()
 the default constructor More...
 
 SVD (InputArray src, int flags=0)
 the constructor that performs SVD More...
 
SVDoperator() (InputArray src, int flags=0)
 the operator that performs SVD. The previously allocated SVD::u, SVD::w are SVD::vt are released. More...
 
void backSubst (InputArray rhs, OutputArray dst) const
 performs back substitution, so that dst is the solution or pseudo-solution of m*dst = rhs, where m is the decomposed matrix More...
 

Static Public Member Functions

static void compute (InputArray src, OutputArray w, OutputArray u, OutputArray vt, int flags=0)
 decomposes matrix and stores the results to user-provided matrices More...
 
static void compute (InputArray src, OutputArray w, int flags=0)
 computes singular values of a matrix More...
 
static void backSubst (InputArray w, InputArray u, InputArray vt, InputArray rhs, OutputArray dst)
 performs back substitution More...
 
template<typename _Tp , int m, int n, int nm>
static void compute (const Matx< _Tp, m, n > &a, Matx< _Tp, nm, 1 > &w, Matx< _Tp, m, nm > &u, Matx< _Tp, n, nm > &vt)
 
template<typename _Tp , int m, int n, int nm>
static void compute (const Matx< _Tp, m, n > &a, Matx< _Tp, nm, 1 > &w)
 
template<typename _Tp , int m, int n, int nm, int nb>
static void backSubst (const Matx< _Tp, nm, 1 > &w, const Matx< _Tp, m, nm > &u, const Matx< _Tp, n, nm > &vt, const Matx< _Tp, m, nb > &rhs, Matx< _Tp, n, nb > &dst)
 
static void solveZ (InputArray src, OutputArray dst)
 finds dst = arg min_{|dst|=1} |m*dst| More...
 

Public Attributes

Mat u
 
Mat w
 
Mat vt
 

Detailed Description

Singular Value Decomposition class

The class is used to compute Singular Value Decomposition of a floating-point matrix and then use it to solve least-square problems, under-determined linear systems, invert matrices, compute condition numbers etc.

For a bit faster operation you can pass flags=SVD::MODIFY_A|... to modify the decomposed matrix when it is not necessarily to preserve it. If you want to compute condition number of a matrix or absolute value of its determinant - you do not need SVD::u or SVD::vt, so you can pass flags=SVD::NO_UV|... . Another flag SVD::FULL_UV indicates that the full-size SVD::u and SVD::vt must be computed, which is not necessary most of the time.

Member Enumeration Documentation

§ anonymous enum

anonymous enum
Enumerator
MODIFY_A 
NO_UV 
FULL_UV 

Constructor & Destructor Documentation

§ SVD() [1/2]

cv::SVD::SVD ( )
inline

the default constructor

§ SVD() [2/2]

cv::SVD::SVD ( InputArray  src,
int  flags = 0 
)
inline

the constructor that performs SVD

Member Function Documentation

§ backSubst() [1/3]

static void cv::SVD::backSubst ( InputArray  w,
InputArray  u,
InputArray  vt,
InputArray  rhs,
OutputArray  dst 
)
static

performs back substitution

§ backSubst() [2/3]

template<typename _Tp , int m, int n, int nm, int nb>
void cv::SVD::backSubst ( const Matx< _Tp, nm, 1 > &  w,
const Matx< _Tp, m, nm > &  u,
const Matx< _Tp, n, nm > &  vt,
const Matx< _Tp, m, nb > &  rhs,
Matx< _Tp, n, nb > &  dst 
)
inlinestatic

§ backSubst() [3/3]

void cv::SVD::backSubst ( InputArray  rhs,
OutputArray  dst 
) const

performs back substitution, so that dst is the solution or pseudo-solution of m*dst = rhs, where m is the decomposed matrix

§ compute() [1/4]

static void cv::SVD::compute ( InputArray  src,
OutputArray  w,
OutputArray  u,
OutputArray  vt,
int  flags = 0 
)
static

decomposes matrix and stores the results to user-provided matrices

§ compute() [2/4]

static void cv::SVD::compute ( InputArray  src,
OutputArray  w,
int  flags = 0 
)
static

computes singular values of a matrix

§ compute() [3/4]

template<typename _Tp , int m, int n, int nm>
void cv::SVD::compute ( const Matx< _Tp, m, n > &  a,
Matx< _Tp, nm, 1 > &  w,
Matx< _Tp, m, nm > &  u,
Matx< _Tp, n, nm > &  vt 
)
inlinestatic

§ compute() [4/4]

template<typename _Tp , int m, int n, int nm>
void cv::SVD::compute ( const Matx< _Tp, m, n > &  a,
Matx< _Tp, nm, 1 > &  w 
)
inlinestatic

§ operator()()

SVD& cv::SVD::operator() ( InputArray  src,
int  flags = 0 
)

the operator that performs SVD. The previously allocated SVD::u, SVD::w are SVD::vt are released.

§ solveZ()

void cv::SVD::solveZ ( InputArray  src,
OutputArray  dst 
)
inlinestatic

finds dst = arg min_{|dst|=1} |m*dst|

Member Data Documentation

§ u

Mat cv::SVD::u

§ vt

Mat cv::SVD::vt

§ w

Mat cv::SVD::w

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