For computing the Harris corner detector, I want to calculate $I_{xy}$ and $I_{xy}$. Obtaining $I_x$ and $I_y$ are clear for me. But what about the second order derivatives?

This and this and this one posts say I have to do convolution operation twice:

$$ \frac{\partial^2}{\partial x \partial y} f = \frac{\partial}{\partial x} \left( \frac{\partial}{\partial y} f \right) = k_x \ast \left( k_y \ast f \right) = \left( k_x \ast k_y \right) \ast f $$

But here and also here, I saw it can be done by element-wise operations:

Ixx = np.multiply(Ix, Ix) 
Iyy = np.multiply(Iy, Iy)
Ixy = np.multiply(Ix, Iy)

Which one is correct for doing Harris corner detector?


1 Answer 1


$I_{xx}$ is not the same as $I_x^2$, and likewise $I_{xy}$ is not the same as $I_x I_y$. The first is a product of two first order derivatives, the second is a second order derivative.

The Harris corner detector is based on the structure tensor, which is compose of the products of the first order derivatives. Follow the second set of links you found.

The second order derivatives from the Hessian matrix, which can also be used to detect points of interest, but is not used in the Harris corner detector.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.