@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 |
|---|
SVD()
\brief the default constructor
|
SVD(long size)
Native array allocator.
|
SVD(opencv_core.Mat src) |
SVD(opencv_core.Mat src,
int flags)
\overload
initializes an empty SVD structure and then calls SVD::operator()
|
SVD(opencv_core.UMat src) |
SVD(opencv_core.UMat src,
int flags) |
SVD(Pointer p)
Pointer cast constructor.
|
address, asBuffer, asByteBuffer, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, free, hashCode, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, physicalBytes, position, put, realloc, setNull, sizeof, toString, totalBytes, withDeallocator, zeropublic static final int MODIFY_A
public static final int NO_UV
public static final int FULL_UV
public SVD(Pointer p)
Pointer.Pointer(Pointer).public SVD(long size)
Pointer.position(long).public SVD()
initializes an empty SVD structure
public SVD(@ByVal opencv_core.Mat src, int flags)
src - decomposed matrix.flags - operation flags (SVD::Flags)public SVD(@ByVal opencv_core.Mat src)
public SVD(@ByVal opencv_core.UMat src, int flags)
public SVD(@ByVal opencv_core.UMat 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)
@ByRef @Name(value="operator ()") public opencv_core.SVD apply(@ByVal opencv_core.UMat src, int flags)
@ByRef @Name(value="operator ()") public opencv_core.SVD apply(@ByVal opencv_core.UMat 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.UMat src, @ByVal opencv_core.UMat w, @ByVal opencv_core.UMat u, @ByVal opencv_core.UMat vt, int flags)
public static void compute(@ByVal opencv_core.UMat src, @ByVal opencv_core.UMat w, @ByVal opencv_core.UMat u, @ByVal opencv_core.UMat 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 compute(@ByVal opencv_core.UMat src, @ByVal opencv_core.UMat w, int flags)
public static void compute(@ByVal opencv_core.UMat src, @ByVal opencv_core.UMat 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 backSubst(@ByVal opencv_core.UMat w, @ByVal opencv_core.UMat u, @ByVal opencv_core.UMat vt, @ByVal opencv_core.UMat rhs, @ByVal opencv_core.UMat 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 static void solveZ(@ByVal opencv_core.UMat src, @ByVal opencv_core.UMat dst)
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.
public void backSubst(@ByVal opencv_core.UMat rhs, @ByVal opencv_core.UMat dst)
@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 © 2017. All rights reserved.