@Namespace(value="cv")
@NoOffset
public static class opencv_core.SVD
extends org.bytedeco.javacpp.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
| 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.GpuMat src) |
SVD(opencv_core.GpuMat src,
int flags) |
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(org.bytedeco.javacpp.Pointer p)
Pointer cast constructor.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zeropublic static final int MODIFY_A
public static final int NO_UV
public static final int FULL_UV
public SVD(org.bytedeco.javacpp.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. The depth has to be CV_32F or CV_64F.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 SVD(@ByVal
opencv_core.GpuMat src,
int flags)
public SVD(@ByVal
opencv_core.GpuMat src)
public opencv_core.SVD position(long position)
position in class org.bytedeco.javacpp.Pointer@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. The depth has to be CV_32F or CV_64F.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)
@ByRef @Name(value="operator ()") public opencv_core.SVD apply(@ByVal opencv_core.GpuMat src, int flags)
@ByRef @Name(value="operator ()") public opencv_core.SVD apply(@ByVal opencv_core.GpuMat 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 matrix. The depth has to be CV_32F or CV_64F.w - calculated singular valuesu - calculated left singular vectorsvt - transposed matrix of right singular vectorsflags - operation flags - see SVD::Flags.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.GpuMat src,
@ByVal
opencv_core.GpuMat w,
@ByVal
opencv_core.GpuMat u,
@ByVal
opencv_core.GpuMat vt,
int flags)
public static void compute(@ByVal
opencv_core.GpuMat src,
@ByVal
opencv_core.GpuMat w,
@ByVal
opencv_core.GpuMat u,
@ByVal
opencv_core.GpuMat vt)
public static void compute(@ByVal
opencv_core.Mat src,
@ByVal
opencv_core.Mat w,
int flags)
src - decomposed matrix. The depth has to be CV_32F or CV_64F.w - 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 compute(@ByVal
opencv_core.GpuMat src,
@ByVal
opencv_core.GpuMat w,
int flags)
public static void compute(@ByVal
opencv_core.GpuMat src,
@ByVal
opencv_core.GpuMat 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 backSubst(@ByVal
opencv_core.GpuMat w,
@ByVal
opencv_core.GpuMat u,
@ByVal
opencv_core.GpuMat vt,
@ByVal
opencv_core.GpuMat rhs,
@ByVal
opencv_core.GpuMat 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 static void solveZ(@ByVal
opencv_core.GpuMat src,
@ByVal
opencv_core.GpuMat 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)
public void backSubst(@ByVal
opencv_core.GpuMat rhs,
@ByVal
opencv_core.GpuMat 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 © 2018. All rights reserved.