# Harris Corner Detection

In Harris Corner detection, is there any particular reason why this function is chosen:

$R=det(M)-k*trace(M)^2$

We want to a function to evaluate how fast E(u,v) fluctuate accross different direction, but can't we use other function such as:

$R=1-(\lambda_1+\lambda_2)^2$

can't we use other function such as: $R=1-(\lambda_1+\lambda_2)^2$
This formula isn't as useful, because it doesn't differentiate between two equally large eigenvalues (a corner) and one twice as large eigenvalue plus one very small one (a straight line). So for example $\lambda_1 = 2, \lambda_2 = 0$ will give the same result as $\lambda_1 = 1, \lambda_2 = 1$, although the former is probably not a corner.
But generally speaking: Yes, the Harris formula isn't the only one. You can for example use the harmonic mean between the eigenvalues, i.e. $2/(1/\lambda_1 + 1/\lambda_2) = 2 det(M)/trace(M)$. Or you can use the smaller eigenvalue directly.
$M$ is the structure tensor. The points where the signal changes in two directions are the points for which both eigenvalues of $M$ are large. $R = det(M) - k*trace^2(M) = \lambda_1\lambda_2 - k(\lambda_1 + \lambda_2)^2$, so $R$ is large when both $\lambda_1$ and $\lambda_2$ are large.