Compute Harris Corner Detector Response
The Harris Corner Detector identifies interest points by analyzing local image structure through the autocorrelation matrix A. The corner response R is calculated using:
R = det(A) - k × (trace(A))²
where:
- det(A) = Axx × Ayy - Axy²
- trace(A) = Axx + Ayy
Given pre-computed gradient sums Axx, Ayy, Axy, and sensitivity constant k, calculate the Harris response R.
Constraints:
- k = 0.04 (default)
- Axx, Ayy, Axy are non-negative floats
- 0 ≤ Axx, Ayy ≤ 1000
Examples:
| Input | Output | |-------|--------| | Axx=100, Ayy=100, Axy=0, k=0.04 | 9600.0 | | Axx=500, Ayy=500, Axy=10, k=0.04 | 209600.0 |
Example
Axx=100, Ayy=100, Axy=0, k=0.04
8400.0
- First, compute the determinant:
- Then, compute the trace:
- Next, compute the penalty term:
- Finally, compute the Harris response: , which matches the sample output.