As far as I understand, the structure tensor is:
$$ M = \sum_{(x,y) \in W} \begin{bmatrix} I_x^2 & I_xI_y \\ I_xI_y & I_y^2 \end{bmatrix} = \begin{bmatrix} \sum_{(x,y) \in W} I_x^2 & \sum_{(x,y) \in W} I_xI_y \\ \sum_{(x,y) \in W} I_xI_y & \sum_{(x,y) \in W} I_y^2 \end{bmatrix} $$
How do I compute $I_x^2, I_y^2, I_xI_y$. I used Hadamard product for compute $I_x^2, I_y^2, I_xI_y$. But if I use Hadamard product, I will get $\det(M) = 0$. I'm stuck in here for too long. Can anyone help?