{% extends "base.html" %} {% block title %} cornerHarris {% endblock %} {% block description %}
Harris edge detector.
{% endblock %} {% block signature %}cv2.cornerHarris(src, blockSize, ksize, k[, dst[, borderType]]) → dst{% endblock %} {% block parameters %}
blockSize x blockSize neighborhood.Sobel operator. Must be 1, 3, 5, or 7.CV_32FC1 and the same size as src.cv2.BORDER_*): Pixel extrapolation method. Default is BORDER_DEFAULT. Choose from:
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.
copyMakeBorder, otherwise the default value is set to 0.ksize parameter, other odd, positive values may not cause errors in program execution. However, anything larger than 7 is padded with 0's and is not producing a different result. See Sobel documentation.