The Kirsch operator is a non-linear edge detector that delivers the most pronounced gradient direction as the edge strength of a pixel. Only eight discrete directions are considered, starting from 0 °, in 45 ° steps.
Analytical description
An analytical description is possible as follows:
H
n
,
m
=
m
a
x
z
=
1
,
...
,
8th
∑
i
=
-
1
1
∑
j
=
-
1
1
G
i
j
(
z
)
⋅
f
n
+
i
,
m
+
j
{\ displaystyle h_ {n, m} = {\ rm {{max} _ {z = 1, \ ldots, 8} \ sum _ {i = -1} ^ {1} \ sum _ {j = -1} ^ {1} g_ {ij} ^ {(z)} \ cdot f_ {n + i, m + j}}}}
,
where the component denotes in the (i + 2) row and the (j + 2) column of the matrix .
G
i
j
(
z
)
{\ displaystyle {\ rm {g_ {ij} ^ {(z)}}}}
G
(
z
)
{\ displaystyle {\ rm {g ^ {(z)}}}}
The matrices are the direction
templates
G
(
z
)
{\ displaystyle {\ rm {g ^ {(z)}}}}
G
(
1
)
=
[
+
5
+
5
+
5
-
3
0
-
3
-
3
-
3
-
3
]
,
G
(
2
)
=
[
+
5
+
5
-
3
+
5
0
-
3
-
3
-
3
-
3
]
,
G
(
3
)
=
[
+
5
-
3
-
3
+
5
0
-
3
+
5
-
3
-
3
]
,
G
(
4th
)
=
[
-
3
-
3
-
3
+
5
0
-
3
+
5
+
5
-
3
]
{\ displaystyle \ mathbf {g ^ {(1)}} = {\ begin {bmatrix} + 5 & + 5 & + 5 \\ - 3 & 0 & -3 \\ - 3 & -3 & -3 \ end {bmatrix}}, \ \ mathbf {g ^ {(2)}} = {\ begin {bmatrix} + 5 & + 5 & -3 \\ + 5 & 0 & -3 \\ - 3 & -3 & -3 \ end {bmatrix}}, \ \ mathbf {g ^ {(3)}} = {\ begin {bmatrix} + 5 & -3 & -3 \\ + 5 & 0 & -3 \\ + 5 & -3 & -3 \ end {bmatrix}}, \ \ mathbf {g ^ {(4) }} = {\ begin {bmatrix} -3 & -3 & -3 \\ + 5 & 0 & -3 \\ + 5 & + 5 & -3 \ end {bmatrix}}}
etc.
example Pictures
Maximum gradient of the 8 directions
<img src="https://de.wikipedia.org//de.wikipedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" title="" width="1" height="1" style="border: none; position: absolute;">