Calculates eigenvalues and eigenvectors of image blocks for corner detection.
cv2.cornerEigenValsAndVecs(src, blockSize, ksize[, dst[, borderType]]) → dst
src
and the type CV_32FC. cv2.BORDER_*
): Pixel extrapolation method. Default is BORDER_DEFAULT. One of the following:
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:
borderType
.copyMakeBorder
, otherwise the default value is set to 0.ksize
, when ksize
is larger than 7, it only pads the kernel with zeros (Source).