cornerEigenValsAndVecs
import { cornerEigenValsAndVecs } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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_2are the non-sorted eigenvalues ofMx_1, y_1are the eigenvectors corresponding to\lambda_1x_2, y_2are 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;srcInput single-channel 8-bit or floating-point image.
dstOutput destination, filled by the native operation. Image to store the results. It has the same size as src and the type CV_32FC(6) .
blockSizeNeighborhood size (see details below).
ksizeAperture parameter for the Sobel operator.
borderTypePixel 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.