Skip to content

cornerEigenValsAndVecs

Image processingfunctionOpenCV 5.0.0
import { cornerEigenValsAndVecs } from '@banou/opencv-wasm'

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

ARGUMENTSsrc, dst, blockSize, ksize
FUNCTIONcornerEigenValsAndVecs
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

example: samples/python/snippets/texture_flow.py An example using cornerEigenValsAndVecs in python Calculates eigenvalues and eigenvectors of image blocks for corner detection.

For every pixel p , the function cornerEigenValsAndVecs considers a blockSize \times blockSize neighborhood S(p) . It calculates the covariation matrix of derivatives over the neighborhood as:

M =  \begin{bmatrix} \sum _{S(p)}(dI/dx)^2 &  \sum _{S(p)}dI/dx dI/dy  \\ \sum _{S(p)}dI/dx dI/dy &  \sum _{S(p)}(dI/dy)^2 \end{bmatrix}

where the derivatives are computed using the Sobel operator.

After that, it finds eigenvectors and eigenvalues of M and stores them in the destination image as (\lambda_1, \lambda_2, x_1, y_1, x_2, y_2) where

  • \lambda_1, \lambda_2 are the non-sorted eigenvalues of M
  • x_1, y_1 are the eigenvectors corresponding to \lambda_1
  • x_2, y_2 are the eigenvectors corresponding to \lambda_2

The output of the function can be used for robust edge or corner detection.

See: cornerMinEigenVal, cornerHarris, preCornerDetect

cornerEigenValsAndVecs(src: Mat, dst: Mat, blockSize: number, ksize: number, borderType: number): void;
2 available overloads
cornerEigenValsAndVecs(src: Mat, dst: Mat, blockSize: number, ksize: number): void;
cornerEigenValsAndVecs(src: Mat, dst: Mat, blockSize: number, ksize: number, borderType: number): void;
src

Input single-channel 8-bit or floating-point image.

dst

Output destination, filled by the native operation. Image to store the results. It has the same size as src and the type CV_32FC(6) .

blockSize

Neighborhood size (see details below).

ksize

Aperture parameter for the Sobel operator.

borderType

Pixel extrapolation method. See #BorderTypes. #BORDER_WRAP is not supported.

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.