What does structure matrix do can anybody explain to me what does structure matrix exactly do in image processing? What happens to the pixels?

By structure matrix I mean:

$$S_w[p] = \begin{pmatrix} \sum_{r}w(r)[I_x(p-r)]^2 &amp; \sum_{r}w(r)[I_x(p-r) I_y(p-r)]  \\ \sum_{r}w(r)[I_x(p-r) I_y(p-r)] &amp; \sum_{r}w(r)[I_y(p-r)]^2 \end{pmatrix}$$
At each pixel $p$, this $2\times 2$ matrix summarizes the local behavior  of the image (structure) inside a neighborhood of pixel $p$ (a neighborhood weighted by function $w$.

From this matrix, different quantities can be computed, that provide interesting attributes for image analysis. Structure tensors, or second-order matrices, have been used for image segmentation, especially with geodesic or level-set methods, as they can provide insights to image textures or orientations.