The Gradient (also called the Hamilton operator) is a vector
operator for any N-dimensional scalar function
,
where
is an N-D vector variable. For example,
when
,
may represent temperature, concentration, or pressure
in the 3-D space. The gradient of this N-D function is a vector composed of
components for the
partial derivatives:
![$\displaystyle {\bf g}({\bf x})=\bigtriangledown f({\bf x})=\frac{d}{d{\bf x}}f(...
...bf x})}{\partial x_1},\cdots,
\frac{\partial f({\bf x})}{\partial x_N}\right]^T$](img20.svg) |
(10) |
- The direction
of the gradient vector
is the
direction in the N-D space along which the function
increases
most rapidly.
- The magnitude
of the gradient
is the rate of the
increment.
In image processing we only consider 2-D field:
![$\displaystyle \bigtriangledown=\left[\begin{array}{c}
\frac{\partial}{\partial x}\\ \\ \frac{\partial}{\partial y} \end{array}\right]$](img24.svg) |
(11) |
When applied to a 2-D function
, this operator produces a vector
function:
![$\displaystyle {\bf g}=\bigtriangledown f(x,y)
=\left[ \begin{array}{c}\frac{\pa...
... \end{array} \right]
=\left[ \begin{array}{c} f_x \\ \\ f_y \end{array} \right]$](img26.svg) |
(12) |
where
and
.
The direction and magnitude of
are respectively
 |
(13) |
Now we show that
increases most rapidly along the direction of
and the rate of increment is equal to the magnitude
of
.
Consider the directional derivative of
along an arbitrary
direction
:
 |
(14) |
This directional derivative is a function of
, defined as the
angle between directions
and the positive direction of
. To find
the direction along which
is maximized, we let
 |
(15) |
Solving this for
, we get
 |
(16) |
i.e.,
 |
(17) |
which is indeed the direction
of
.
From
, we can also get
 |
(18) |
Substituting these into the expression of
, we obtain its maximum
magnitude,
 |
(19) |
which is the magnitude of
.