A structure tensor is a matrix formed from outer products of image gradient vectors
to describe local directional variation. For a real scalar
image ,
write
for its gradient. The pointwise structure tensor is
, where the superscript
denotes the transpose.
A neighborhood-averaged version is
where
is a neighborhood and
are weights with
(Schultz et al. 2009).
The structure tensor is a real symmetric matrix and a positive semidefinite matrix. Its eigenvectors identify principal directions of intensity variation, and the corresponding eigenvalues measure variation in those directions. The two-dimensional case used in corner detection is the Harris matrix.