cornerHarris

Description

Harris edge detector.

Signature

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

Parameters

Explanation

The function runs the Harris corner detector on the image. Similarly to cornerMinEigenVal and cornerEigenValsAndVecs, for each pixel \((x,y)\) it calculates a \(2 \times 2\) gradient covariance matrix \(M(x,y)\) over a blockSize x blockSize neighborhood. Then, it computes the following characteristic: $$\text{dst}(x,y) = \det(M^{(x,y)})-k \cdot \left(\text{tr}(M^{(x,y)})\right)^2$$ Corners in the image can be found as the local maxima of this response map.

Notes


References

Created with OpenCV 4.4.0