<s>
The	O
Prewitt	B-Algorithm
operator	I-Algorithm
is	O
used	O
in	O
image	B-Algorithm
processing	I-Algorithm
,	O
particularly	O
within	O
edge	B-Algorithm
detection	I-Algorithm
algorithms	O
.	O
</s>
<s>
Technically	O
,	O
it	O
is	O
a	O
discrete	O
differentiation	O
operator	O
,	O
computing	O
an	O
approximation	O
of	O
the	O
gradient	B-Algorithm
of	O
the	O
image	O
intensity	O
function	O
.	O
</s>
<s>
At	O
each	O
point	O
in	O
the	O
image	O
,	O
the	O
result	O
of	O
the	O
Prewitt	B-Algorithm
operator	I-Algorithm
is	O
either	O
the	O
corresponding	O
gradient	B-Algorithm
vector	O
or	O
the	O
norm	O
of	O
this	O
vector	O
.	O
</s>
<s>
The	O
Prewitt	B-Algorithm
operator	I-Algorithm
is	O
based	O
on	O
convolving	O
the	O
image	O
with	O
a	O
small	O
,	O
separable	O
,	O
and	O
integer	O
valued	O
filter	O
in	O
horizontal	O
and	O
vertical	O
directions	O
and	O
is	O
therefore	O
relatively	O
inexpensive	O
in	O
terms	O
of	O
computations	O
like	O
Sobel	B-Algorithm
and	O
Kayyali	O
operators	O
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
the	O
gradient	B-Algorithm
approximation	O
which	O
it	O
produces	O
is	O
relatively	O
crude	O
,	O
in	O
particular	O
for	O
high	O
frequency	O
variations	O
in	O
the	O
image	O
.	O
</s>
<s>
The	O
Prewitt	B-Algorithm
operator	I-Algorithm
was	O
developed	O
by	O
Judith	O
M	O
.	O
S	O
.	O
Prewitt	O
.	O
</s>
<s>
In	O
simple	O
terms	O
,	O
the	O
operator	O
calculates	O
the	O
gradient	B-Algorithm
of	O
the	O
image	O
intensity	O
at	O
each	O
point	O
,	O
giving	O
the	O
direction	O
of	O
the	O
largest	O
possible	O
increase	O
from	O
light	O
to	O
dark	O
and	O
the	O
rate	O
of	O
change	O
in	O
that	O
direction	O
.	O
</s>
<s>
Mathematically	O
,	O
the	O
gradient	B-Algorithm
of	O
a	O
two-variable	O
function	O
(	O
here	O
the	O
image	O
intensity	O
function	O
)	O
is	O
at	O
each	O
image	O
point	O
a	O
2D	O
vector	O
with	O
the	O
components	O
given	O
by	O
the	O
derivatives	B-Algorithm
in	O
the	O
horizontal	O
and	O
vertical	O
directions	O
.	O
</s>
<s>
At	O
each	O
image	O
point	O
,	O
the	O
gradient	B-Algorithm
vector	O
points	O
in	O
the	O
direction	O
of	O
largest	O
possible	O
intensity	O
increase	O
,	O
and	O
the	O
length	O
of	O
the	O
gradient	B-Algorithm
vector	O
corresponds	O
to	O
the	O
rate	O
of	O
change	O
in	O
that	O
direction	O
.	O
</s>
<s>
This	O
implies	O
that	O
the	O
result	O
of	O
the	O
Prewitt	B-Algorithm
operator	I-Algorithm
at	O
an	O
image	O
point	O
which	O
is	O
in	O
a	O
region	O
of	O
constant	O
image	O
intensity	O
is	O
a	O
zero	O
vector	O
and	O
at	O
a	O
point	O
on	O
an	O
edge	O
is	O
a	O
vector	O
which	O
points	O
across	O
the	O
edge	O
,	O
from	O
darker	O
to	O
brighter	O
values	O
.	O
</s>
<s>
Mathematically	O
,	O
the	O
operator	O
uses	O
two	O
3×3	O
kernels	O
which	O
are	O
convolved	B-Language
with	O
the	O
original	O
image	O
to	O
calculate	O
approximations	O
of	O
the	O
derivatives	B-Algorithm
-	O
one	O
for	O
horizontal	O
changes	O
,	O
and	O
one	O
for	O
vertical	O
.	O
</s>
<s>
If	O
we	O
define	O
as	O
the	O
source	O
image	O
,	O
and	O
and	O
are	O
two	O
images	O
which	O
at	O
each	O
point	O
contain	O
the	O
horizontal	O
and	O
vertical	O
derivative	B-Algorithm
approximations	O
,	O
the	O
latter	O
are	O
computed	O
as	O
:	O
</s>
<s>
where	O
here	O
denotes	O
the	O
2-dimensional	O
convolution	B-Language
operation	O
.	O
</s>
<s>
kernel	O
,	O
they	O
compute	O
the	O
gradient	B-Algorithm
with	O
smoothing	O
.	O
</s>
<s>
Therefore	O
,	O
it	O
is	O
a	O
separable	B-Algorithm
filter	I-Algorithm
.	O
</s>
<s>
At	O
each	O
point	O
in	O
the	O
image	O
,	O
the	O
resulting	O
gradient	B-Algorithm
approximations	O
can	O
be	O
combined	O
to	O
give	O
the	O
gradient	B-Algorithm
magnitude	O
,	O
using	O
:	O
</s>
<s>
Using	O
this	O
information	O
,	O
we	O
can	O
also	O
calculate	O
the	O
gradient	B-Algorithm
's	O
direction	O
:	O
</s>
