next up previous
Next: Digital Gradient Up: gradient Previous: High-boost filtering

The Gradient Operator

The Gradient (also called the Hamilton operator) is a vector operator for any n-dimensional scalar function $f(x_1,\cdots, x_n)$ (temperature, concentration, pressure, etc.). The gradient vector represents (a) the direction in the n-D space along which the function increases most rapidly, and (b) the rate of the increment. Here we only consider 2D field:

\begin{displaymath}\bigtriangledown\stackrel{\triangle}{=}\frac{\partial}{\partial x}
\vec{i}+\frac{\partial}{\partial y} \vec{j}
\end{displaymath}

When applied to a 2D function $f(x,y)$, this operator produces a vector function:

\begin{displaymath}\vec{g}(x,y)\stackrel{\triangle}{=}\bigtriangledown f(x,y)
=...
...artial}{\partial y} \vec{j}) f(x,y)
=f_x \vec{i}+f_y \vec{j}
\end{displaymath}

Now we show that $f(x,y)$ increases most rapidly along the direction of $\vec{g}(x,y)$ with the rate of increment rate is equal to the magnitude of $\vec{g}(x,y)$.

Consider the directional derivative of $f(x,y)$ along an arbitrary direction $r$:

\begin{displaymath}\frac{d}{dr}f(x,y)=
\frac{\partial f}{\partial x}\frac{dx}{d...
...l f}{\partial y}\frac{dy}{dr}
=f_x cos \theta+f_y\sin\theta
\end{displaymath}

This directional derivative is a function of $\theta$, defined as the angle between directions $r$ and $x$. To find the direction along which $df/dr$ is maximized, we let

\begin{displaymath}\frac{d}{d\theta} \frac{df(x,y)}{dr}=
\frac{d}{d\theta} (f_x cos \theta+f_y\sin\theta)=
-f_x sin\theta +f_y cos (\theta)=0 \end{displaymath}

Solving this for $\theta$, we get

\begin{displaymath}f_x sin\theta=f_y cos \theta \end{displaymath}

i.e.,

\begin{displaymath}\theta =tan^{-1} \frac{f_y}{f_x} \end{displaymath}

which is the direction of $\vec{g}(x,y)$.

From $tan  \theta=f_y/f_x$, we can also get

\begin{displaymath}sin\theta=\frac{f_y}{\sqrt{f_x^2+f_y^2}},\;\;\;\;
cos \theta=\frac{f_x}{\sqrt{f_x^2+f_y^2}}
\end{displaymath}

Substituting these into the expression of $df/dr$, we obtain its maximum magnitude,

\begin{displaymath}\left. \frac{d}{dr}f(x,y) \right\vert _{max}
=\frac{f_x^2+f_y^2}{\sqrt{f_x^2+f_y^2}}=\sqrt{f_x^2+f_y^2} \end{displaymath}

which is the magnitude of $\vec{g}(x,y)$.

gradient_direction.gif


next up previous
Next: Digital Gradient Up: gradient Previous: High-boost filtering
Ruye Wang 2009-09-20