@Namespace(value="cv") @NoOffset public static class opencv_core.SVD extends Pointer
Class for computing Singular Value Decomposition of a floating-point matrix. The Singular Value Decomposition is used to solve least-square problems, under-determined linear systems, invert matrices, compute condition numbers, and so on.
If you want to compute a condition number of a matrix or an absolute value of
its determinant, you do not need u and vt. You can pass
flags=SVD::NO_UV|... . Another flag SVD::FULL_UV indicates that full-size u
and vt must be computed, which is not necessary most of the time.
\sa invert, solve, eigen, determinant
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator| Modifier and Type | Field and Description |
|---|---|
static int |
FULL_UV
enum cv::SVD::Flags
|
static int |
MODIFY_A
enum cv::SVD::Flags
|
static int |
NO_UV
enum cv::SVD::Flags
|
| Constructor and Description |
|---|
opencv_core.SVD()
\brief the default constructor
|
opencv_core.SVD(long size)
Native array allocator.
|
opencv_core.SVD(opencv_core.Mat src) |
opencv_core.SVD(opencv_core.Mat src,
int flags)
\overload
initializes an empty SVD structure and then calls SVD::operator()
|
opencv_core.SVD(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
opencv_core.SVD |
apply(opencv_core.Mat src) |
opencv_core.SVD |
apply(opencv_core.Mat src,
int flags)
\brief the operator that performs SVD.
|
void |
backSubst(opencv_core.Mat rhs,
opencv_core.Mat dst)
\brief performs a singular value back substitution.
|
static void |
backSubst(opencv_core.Mat w,
opencv_core.Mat u,
opencv_core.Mat vt,
opencv_core.Mat rhs,
opencv_core.Mat dst)
\brief performs back substitution
|
static void |
compute(opencv_core.Mat src,
opencv_core.Mat w) |
static void |
compute(opencv_core.Mat src,
opencv_core.Mat w,
int flags)
\overload
computes singular values of a matrix
|
static void |
compute(opencv_core.Mat src,
opencv_core.Mat w,
opencv_core.Mat u,
opencv_core.Mat vt) |
static void |
compute(opencv_core.Mat src,
opencv_core.Mat w,
opencv_core.Mat u,
opencv_core.Mat vt,
int flags)
\brief decomposes matrix and stores the results to user-provided matrices
|
opencv_core.SVD |
position(long position) |
static void |
solveZ(opencv_core.Mat src,
opencv_core.Mat dst)
\brief solves an under-determined singular linear system
|
opencv_core.Mat |
u()
\todo document
|
opencv_core.SVD |
u(opencv_core.Mat u) |
opencv_core.Mat |
vt() |
opencv_core.SVD |
vt(opencv_core.Mat vt) |
opencv_core.Mat |
w() |
opencv_core.SVD |
w(opencv_core.Mat w) |
address, asBuffer, asByteBuffer, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, hashCode, isNull, limit, limit, maxBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, position, put, setNull, sizeof, toString, totalBytes, withDeallocator, zeropublic static final int MODIFY_A
public static final int NO_UV
public static final int FULL_UV
public opencv_core.SVD(Pointer p)
Pointer.Pointer(Pointer).public opencv_core.SVD(long size)
Pointer.position(long).public opencv_core.SVD()
initializes an empty SVD structure
public opencv_core.SVD(@ByVal opencv_core.Mat src, int flags)
src - decomposed matrix.flags - operation flags (SVD::Flags)public opencv_core.SVD(@ByVal opencv_core.Mat src)
public opencv_core.SVD position(long position)
@ByRef @Name(value="operator ()") public opencv_core.SVD apply(@ByVal opencv_core.Mat src, int flags)
The operator performs the singular value decomposition of the supplied
matrix. The u,vt , and the vector of singular values w are stored in
the structure. The same SVD structure can be reused many times with
different matrices. Each time, if needed, the previous u,vt , and w
are reclaimed and the new matrices are created, which is all handled by
Mat::create.
src - decomposed matrix.flags - operation flags (SVD::Flags)@ByRef @Name(value="operator ()") public opencv_core.SVD apply(@ByVal opencv_core.Mat src)
public static void compute(@ByVal opencv_core.Mat src, @ByVal opencv_core.Mat w, @ByVal opencv_core.Mat u, @ByVal opencv_core.Mat vt, int flags)
The methods/functions perform SVD of matrix. Unlike SVD::SVD constructor and SVD::operator(), they store the results to the user-provided matrices:
{.cpp}
Mat A, w, u, vt;
SVD::compute(A, w, u, vt);
src - decomposed matrixw - calculated singular valuesu - calculated left singular vectorsvt - transposed matrix of right singular valuesflags - operation flags - see SVD::SVD.public static void compute(@ByVal opencv_core.Mat src, @ByVal opencv_core.Mat w, @ByVal opencv_core.Mat u, @ByVal opencv_core.Mat vt)
public static void compute(@ByVal opencv_core.Mat src, @ByVal opencv_core.Mat w, int flags)
src - decomposed matrixw - calculated singular valuesflags - operation flags - see SVD::Flags.public static void compute(@ByVal opencv_core.Mat src, @ByVal opencv_core.Mat w)
public static void backSubst(@ByVal opencv_core.Mat w, @ByVal opencv_core.Mat u, @ByVal opencv_core.Mat vt, @ByVal opencv_core.Mat rhs, @ByVal opencv_core.Mat dst)
public static void solveZ(@ByVal opencv_core.Mat src, @ByVal opencv_core.Mat dst)
The method finds a unit-length solution x of a singular linear system A\*x = 0. Depending on the rank of A, there can be no solutions, a single solution or an infinite number of solutions. In general, the algorithm solves the following problem: \f[dst = \arg \min _{x: \| x \| =1} \| src \cdot x \|\f]
src - left-hand-side matrix.dst - found solution.public void backSubst(@ByVal opencv_core.Mat rhs, @ByVal opencv_core.Mat dst)
The method calculates a back substitution for the specified right-hand side:
\f[\texttt{x} = \texttt{vt} ^T \cdot diag( \texttt{w} )^{-1} \cdot \texttt{u} ^T \cdot \texttt{rhs} \sim \texttt{A} ^{-1} \cdot \texttt{rhs}\f]
Using this technique you can either get a very accurate solution of the convenient linear system, or the best (in the least-squares terms) pseudo-solution of an overdetermined linear system.
rhs - right-hand side of a linear system (u\*w\*v')\*dst = rhs to
be solved, where A has been previously decomposed.
dst - found solution of the system.
\note Explicit SVD with the further back substitution only makes sense if you need to solve many linear systems with the same left-hand side (for example, src ). If all you need is to solve a single system (possibly with multiple rhs immediately available), simply call solve add pass DECOMP_SVD there. It does absolutely the same thing.
@ByRef public opencv_core.Mat u()
public opencv_core.SVD u(opencv_core.Mat u)
@ByRef public opencv_core.Mat w()
public opencv_core.SVD w(opencv_core.Mat w)
@ByRef public opencv_core.Mat vt()
public opencv_core.SVD vt(opencv_core.Mat vt)
Copyright © 2016. All rights reserved.