# Scharr Operator

Introduced by Cyrill Stachniss.

-3 & 0 & 3 \\ -10 & 0 & 10 \\ -3 & 0 & 3 \end{bmatrix}$$ $$D_y = \frac{1}{32}\begin{bmatrix} -3 & -10 & -3 \\ 0 & 0 & 0 \\ 3 & 10 & 3 \end{bmatrix}$$ I am not sure about the $\frac{1}{32}$? It is used for normalization. - Does this relate to [[notes/Batch Normalization|BatchNorm]]? > [!question] Why 1/32? > > > > The 1/32 in front of the Scharr operator matrix is for normalization. It ensures that the sum of the absolute values of the coefficients in the matrix is 1. This way, the magnitude of the resulting gradients remains proportional to the original image intensities. Computing the **normalization factor**: - The normalization factor is computed by taking the sum of the absolute values of all the elements in the unnormalized Scharr matrix and then taking its reciprocal. In the case of the Scharr operator, this sum is 3+10+3=16 for each direction (either rows or columns). Since both directions contribute, you would get 16+16=32, hence the normalization factor of 1/32. Umm I think this is wrong... ### Related - [[notes/Sobel Operator|Sobel Operator]]