{% 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 %} {% endblock %} {% block 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.

{% endblock %} {% block notes %}

{% endblock %} {% block references %} {% endblock %}