<s>
The	O
Sobel	B-Algorithm
operator	I-Algorithm
,	O
sometimes	O
called	O
the	O
Sobel	B-Algorithm
–	I-Algorithm
Feldman	I-Algorithm
operator	I-Algorithm
or	O
Sobel	B-Algorithm
filter	I-Algorithm
,	O
is	O
used	O
in	O
image	B-Algorithm
processing	I-Algorithm
and	O
computer	B-Application
vision	I-Application
,	O
particularly	O
within	O
edge	B-Algorithm
detection	I-Algorithm
algorithms	O
where	O
it	O
creates	O
an	O
image	O
emphasising	O
edges	O
.	O
</s>
<s>
It	O
is	O
named	O
after	O
Irwin	B-Algorithm
Sobel	I-Algorithm
and	O
Gary	O
Feldman	O
,	O
colleagues	O
at	O
the	O
Stanford	O
Artificial	O
Intelligence	O
Laboratory	O
(	O
SAIL	O
)	O
.	O
</s>
<s>
Sobel	O
and	O
Feldman	O
presented	O
the	O
idea	O
of	O
an	O
"	O
Isotropic	O
3×3	O
Image	B-Algorithm
Gradient	I-Algorithm
Operator	O
"	O
at	O
a	O
talk	O
at	O
SAIL	O
in	O
1968	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
Sobel	B-Algorithm
–	I-Algorithm
Feldman	I-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
Sobel	B-Algorithm
–	I-Algorithm
Feldman	I-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-valued	O
filter	O
in	O
the	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
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
the	O
gradient	B-Algorithm
approximation	O
that	O
it	O
produces	O
is	O
relatively	O
crude	O
,	O
in	O
particular	O
for	O
high-frequency	O
variations	O
in	O
the	O
image	O
.	O
</s>
<s>
The	O
operator	O
uses	O
two	O
33	O
kernels	O
which	O
are	O
convolved	O
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>
kernel	O
,	O
they	O
compute	O
the	O
gradient	B-Algorithm
with	O
smoothing	O
.	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>
<s>
Since	O
the	O
intensity	O
function	O
of	O
a	O
digital	O
image	O
is	O
only	O
known	O
at	O
discrete	O
points	O
,	O
derivatives	B-Algorithm
of	O
this	O
function	O
cannot	O
be	O
defined	O
unless	O
we	O
assume	O
that	O
there	O
is	O
an	O
underlying	O
differentiable	O
intensity	O
function	O
that	O
has	O
been	O
sampled	O
at	O
the	O
image	O
points	O
.	O
</s>
<s>
It	O
turns	O
out	O
that	O
the	O
derivatives	B-Algorithm
at	O
any	O
particular	O
point	O
are	O
functions	O
of	O
the	O
intensity	O
values	O
at	O
virtually	O
all	O
image	O
points	O
.	O
</s>
<s>
The	O
Sobel-Feldman	B-Algorithm
operator	I-Algorithm
represents	O
a	O
rather	O
inaccurate	O
approximation	O
of	O
the	O
image	B-Algorithm
gradient	I-Algorithm
,	O
but	O
is	O
still	O
of	O
sufficient	O
quality	O
to	O
be	O
of	O
practical	O
use	O
in	O
many	O
applications	O
.	O
</s>
<s>
More	O
precisely	O
,	O
it	O
uses	O
intensity	O
values	O
only	O
in	O
a	O
33	O
region	O
around	O
each	O
image	O
point	O
to	O
approximate	O
the	O
corresponding	O
image	B-Algorithm
gradient	I-Algorithm
,	O
and	O
it	O
uses	O
only	O
integer	O
values	O
for	O
the	O
coefficients	O
which	O
weight	O
the	O
image	O
intensities	O
to	O
produce	O
the	O
gradient	B-Algorithm
approximation	O
.	O
</s>
<s>
The	O
Sobel	B-Algorithm
–	I-Algorithm
Feldman	I-Algorithm
operator	I-Algorithm
consists	O
of	O
two	O
separable	O
operations	O
:	O
</s>
<s>
Sobel	O
–	O
Feldman	O
filters	O
for	O
image	B-Algorithm
derivatives	I-Algorithm
in	O
different	O
dimensions	O
with	O
:	O
</s>
<s>
As	O
a	O
consequence	O
of	O
its	O
definition	O
,	O
the	O
Sobel	B-Algorithm
operator	I-Algorithm
can	O
be	O
implemented	O
by	O
simple	O
means	O
in	O
both	O
hardware	O
and	O
software	O
:	O
only	O
eight	O
image	O
points	O
around	O
a	O
point	O
are	O
needed	O
to	O
compute	O
the	O
corresponding	O
result	O
and	O
only	O
integer	O
arithmetic	O
is	O
needed	O
to	O
compute	O
the	O
gradient	B-Algorithm
vector	O
approximation	O
.	O
</s>
<s>
The	O
result	O
of	O
the	O
Sobel	B-Algorithm
–	I-Algorithm
Feldman	I-Algorithm
operator	I-Algorithm
is	O
a	O
2-dimensional	O
map	O
of	O
the	O
gradient	B-Algorithm
at	O
each	O
point	O
.	O
</s>
<s>
It	O
can	O
be	O
processed	O
and	O
viewed	O
as	O
though	O
it	O
is	O
itself	O
an	O
image	O
,	O
with	O
the	O
areas	O
of	O
high	O
gradient	B-Algorithm
(	O
the	O
likely	O
edges	O
)	O
visible	O
as	O
white	O
lines	O
.	O
</s>
<s>
The	O
following	O
images	O
illustrate	O
this	O
,	O
by	O
showing	O
the	O
computation	O
of	O
the	O
Sobel-Feldman	B-Algorithm
operator	I-Algorithm
on	O
a	O
simple	O
image	O
.	O
</s>
<s>
The	O
images	O
below	O
illustrate	O
the	O
change	O
in	O
the	O
direction	O
of	O
the	O
gradient	B-Algorithm
on	O
a	O
grayscale	O
circle	O
.	O
</s>
<s>
When	O
the	O
sign	O
of	O
and	O
are	O
the	O
same	O
the	O
gradient	B-Algorithm
's	O
angle	O
is	O
positive	O
,	O
and	O
negative	O
when	O
different	O
.	O
</s>
<s>
When	O
using	O
gradient	B-Algorithm
angle	O
information	O
for	O
image	B-Algorithm
processing	I-Algorithm
applications	O
effort	O
should	O
be	O
made	O
to	O
remove	O
image	B-Algorithm
noise	I-Algorithm
to	O
reduce	O
this	O
false	O
response	O
.	O
</s>
<s>
thumb|150px|Grayscale	O
image	O
of	O
a	O
black	O
circle	O
with	O
a	O
white	O
background.thumb	O
|180px|The	O
direction	O
of	O
the	O
Sobel	B-Algorithm
operator	I-Algorithm
's	O
gradient	B-Algorithm
.	O
</s>
<s>
The	O
Sobel	B-Algorithm
–	I-Algorithm
Feldman	I-Algorithm
operator	I-Algorithm
,	O
while	O
reducing	O
artifacts	O
associated	O
with	O
a	O
pure	O
central	O
differences	O
operator	O
,	O
does	O
not	O
exhibit	O
a	O
good	O
rotational	O
symmetry	O
(	O
about	O
1°	O
of	O
error	O
)	O
.	O
</s>
<s>
Scharr	O
operators	O
result	O
from	O
an	O
optimization	O
minimizing	O
weighted	O
mean	B-Algorithm
squared	I-Algorithm
angular	O
error	O
in	O
the	O
Fourier	O
domain	O
.	O
</s>
<s>
He	O
showed	O
how	O
first	O
and	O
second	O
order	O
derivatives	B-Algorithm
can	O
be	O
computed	O
correctly	O
using	O
cubic	O
or	O
trigonometric	O
splines	O
by	O
a	O
double	O
filtering	O
approach	O
giving	O
filters	O
of	O
length	O
7	O
.	O
</s>
<s>
Another	O
similar	O
operator	O
that	O
was	O
originally	O
generated	O
from	O
the	O
Sobel	B-Algorithm
operator	I-Algorithm
is	O
the	O
Kayyali	O
operator	O
,	O
a	O
perfect	O
rotational	O
symmetry	O
based	O
convolution	O
filter	O
3x3	O
.	O
</s>
<s>
Here	O
,	O
four	O
different	O
gradient	B-Algorithm
operators	O
are	O
used	O
to	O
estimate	O
the	O
magnitude	O
of	O
the	O
gradient	B-Algorithm
of	O
the	O
test	O
image	O
.	O
</s>
<s>
The	O
above	O
MATLAB	B-Language
code	O
will	O
use	O
an	O
image	O
which	O
is	O
packaged	O
with	O
MATLAB	B-Language
itself	O
( 	O
 '	O
gantrycrane.png	O
'	O
)	O
to	O
demo	O
the	O
Sobel	B-Algorithm
filter	I-Algorithm
.	O
</s>
<s>
There	O
will	O
be	O
outputs	O
with	O
original	O
image	O
,	O
grayscale	O
version	O
of	O
original	O
image	O
and	O
the	O
output	O
from	O
the	O
Sobel	B-Algorithm
filter	I-Algorithm
.	O
</s>
