\( \newcommand{\matr}[1] {\mathbf{#1}} \newcommand{\vertbar} {\rule[-1ex]{0.5pt}{2.5ex}} \newcommand{\horzbar} {\rule[.5ex]{2.5ex}{0.5pt}} \newcommand{\E} {\mathrm{E}} \)
abstract banner
Show Question
\( \newcommand{\cat}[1] {\mathrm{#1}} \newcommand{\catobj}[1] {\operatorname{Obj}(\mathrm{#1})} \newcommand{\cathom}[1] {\operatorname{Hom}_{\cat{#1}}} \newcommand{\multiBetaReduction}[0] {\twoheadrightarrow_{\beta}} \newcommand{\betaReduction}[0] {\rightarrow_{\beta}} \newcommand{\betaEq}[0] {=_{\beta}} \newcommand{\string}[1] {\texttt{"}\mathtt{#1}\texttt{"}} \newcommand{\symbolq}[1] {\texttt{`}\mathtt{#1}\texttt{'}} \newcommand{\groupMul}[1] { \cdot_{\small{#1}}} \newcommand{\groupAdd}[1] { +_{\small{#1}}} \newcommand{\inv}[1] {#1^{-1} } \newcommand{\bm}[1] { \boldsymbol{#1} } \newcommand{\qed} { {\scriptstyle \Box} } \require{physics} \require{ams} \require{mathtools} \)
Math and science::Algebra

Sobel operator

The Sobel operator is a first-difference applied after a smoothing. It can be thought of as a solution to problem that the first difference can be too sensitive to noise.

Convolution matrices, horizontal and vertical

\[ S_x \;=\; \begin{bmatrix} -1 & 0 & +1 \\ -2 & 0 & +2 \\ -1 & 0 & +1 \end{bmatrix}, \quad S_y = \begin{bmatrix} -1 & -2 & -1 \\ 0 & \;\;0 & 0 \\ +1 & +2 & +1 \end{bmatrix} \]

Factorized as \( \text{derivative} \circ \text{smoothing}(v) \)

\[ S_x = \begin{bmatrix} 1 \\ 2 \\ 1 \end{bmatrix}_{\text{smooth}} \begin{bmatrix} -1 & 0 & +1 \end{bmatrix}_{\text{derivative}} \]

Note that this outer-product creates the convolution kernel, and the order of operations is the opposite of what you would expect from matrix operation order.

The order satisfies:

\[ \bigl(S_y \otimes D_x\bigr) * f \;=\; D_x * \bigl(S_y * f\bigr) \qquad \text{(smooth in $y$, then differentiate in $x$)}. \]

A motivating perspective can be to ask: what matrix can we use to shift an image by an arbitrary sub-pixel amount? Peyman Milanfar:



undefinedundefined


Source

https://x.com/docmilanfar/status/1995729198866968762?s=20