cornerEigenValsAndVecs

Description

Calculates eigenvalues and eigenvectors of image blocks for corner detection.

Signature

cv2.cornerEigenValsAndVecs(src, blockSize, ksize[, dst[, borderType]]) → dst

Parameters

Explanation

For every pixel p, the function considers a blockSize \(\times\) blockSize neighborhood S(p). It calculates the covariation matrix of derivatives over the neighborhood as: $$M=\left[\begin{matrix}\sum_{S(p)}{(dI/dx)}^2&\sum_{S(p)}{dI/dx\ dI/dy}\\\sum_{S(p)}{dI/dx\ dI/dy}&\sum_{S(p)}{dI/dx\ dI/dy}\\\end{matrix}\right]$$ 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:

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

Notes


References

Created with OpenCV 4.4.0