Skip to content

eigen

Core and matricesfunctionOpenCV 5.0.0
import { eigen } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSsrc, eigenvalues, eigenvectors
FUNCTIONeigen
RETURN TYPEboolean
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Calculates eigenvalues and eigenvectors of a symmetric matrix.

The function cv::eigen calculates just eigenvalues, or eigenvalues and eigenvectors of the symmetric matrix src:

    src*eigenvectors.row(i).t() = eigenvalues.at<srcType>(i)*eigenvectors.row(i).t()

Note: Use cv::eigenNonSymmetric for calculation of real eigenvalues and eigenvectors of non-symmetric matrix.

See: eigenNonSymmetric, completeSymm, PCA

eigen(src: Mat, eigenvalues: Mat, eigenvectors: Mat): boolean;
2 available overloads
eigen(src: Mat, eigenvalues: Mat): boolean;
eigen(src: Mat, eigenvalues: Mat, eigenvectors: Mat): boolean;
src

input matrix that must have CV_32FC1 or CV_64FC1 type, square size and be symmetrical (src ^T^ == src).

eigenvalues

Output destination, filled by the native operation. output vector of eigenvalues of the same type as src; the eigenvalues are stored in the descending order.

eigenvectors

Output destination, filled by the native operation. output matrix of eigenvectors; it has the same size and type as src; the eigenvectors are stored as subsequent matrix rows, in the same order as the corresponding eigenvalues.

Returns

The boolean result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.