- Source: Generalized structure tensor
In image analysis, the generalized structure tensor (GST) is an extension of the Cartesian structure tensor to curvilinear coordinates. It is mainly used to detect and to represent the "direction" parameters of curves, just as the Cartesian structure tensor detects and represents the direction in Cartesian coordinates. Curve families generated by pairs of locally orthogonal functions have been the best studied.
It is a widely known method in applications of image and video processing including computer vision, such as biometric identification by fingerprints, and studies of human tissue sections.
GST in 2D and locally orthogonal bases
Let the term image represent a function
f
(
ξ
(
x
,
y
)
,
η
(
x
,
y
)
)
{\displaystyle f(\xi (x,y),\eta (x,y))}
where
x
,
y
{\displaystyle x,y}
are real variables and
ξ
,
η
{\displaystyle \xi ,\eta }
, and
f
{\displaystyle f}
, are real valued functions. GST represents the direction along which the image
f
{\displaystyle f}
can undergo an infinitesimal translation with minimal (total least squares) error, along the "lines" fulfilling the following conditions:
1. The "lines" are ordinary lines in the curvilinear coordinate basis
ξ
,
η
{\displaystyle \xi ,\eta }
cos
(
θ
)
ξ
(
x
,
y
)
+
sin
(
θ
)
η
(
x
,
y
)
=
constant
{\displaystyle \cos(\theta )\xi (x,y)+\sin(\theta )\eta (x,y)={\text{constant}}}
which are curves in Cartesian coordinates as depicted by the equation above. The error is measured in the
L
2
{\displaystyle L^{2}}
sense and the minimality of the error refers thereby to L2 norm.
2. The functions
ξ
(
x
,
y
)
,
η
(
x
,
y
)
{\displaystyle \xi (x,y),\eta (x,y)}
constitute a harmonic pair, i.e. they fulfill Cauchy–Riemann equations,
∂
ξ
∂
x
=
−
∂
η
∂
y
,
∂
ξ
∂
y
=
∂
η
∂
x
.
{\displaystyle {\begin{aligned}&{\frac {\partial \xi }{\partial x}}=-{\frac {\partial \eta }{\partial y}},\\[4pt]&{\frac {\partial \xi }{\partial y}}={\frac {\partial \eta }{\partial x}}.\end{aligned}}}
Accordingly, such curvilinear coordinates
ξ
,
η
{\displaystyle \xi ,\eta }
are locally orthogonal.
Then GST consists in
G
S
T
=
(
λ
m
a
x
−
λ
m
i
n
)
∫
w
(
ξ
,
η
)
[
∂
f
∂
ξ
∂
f
∂
η
]
[
∂
f
∂
ξ
,
∂
f
∂
η
]
d
ξ
d
η
+
λ
m
i
n
I
{\displaystyle GST=(\lambda _{max}-\lambda _{min})\int w(\xi ,\eta )\left[{\begin{array}{c}{\frac {\partial f}{\partial \xi }}\\{\frac {\partial f}{\partial \eta }}\\\end{array}}\right][{\frac {\partial f}{\partial \xi }},{\frac {\partial f}{\partial \eta }}]d\xi d\eta +\lambda _{min}I}
where
0
≤
λ
m
i
n
≤
λ
m
a
x
{\displaystyle 0\leq \lambda _{min}\leq \lambda _{max}}
are errors of (infinitesimal) translation in the best direction (designated by the angle
θ
{\displaystyle \theta }
) and the worst direction (designated by
θ
+
π
/
2
{\displaystyle \theta +\pi /2}
). The function
w
(
ξ
,
η
)
{\displaystyle w(\xi ,\eta )}
is the window function defining the "outer scale" wherein the detection of
θ
{\displaystyle \theta }
will be carried out, which can be omitted if it is already included in
f
{\displaystyle f}
or if
f
{\displaystyle f}
is the full image (rather than local). The matrix
I
{\displaystyle I}
is the identity matrix. Using the chain rule, it can be shown that the integration above can be implemented as convolutions in Cartesian coordinates applied to the ordinary structure tensor when
ξ
,
η
{\displaystyle \xi ,\eta }
pair the real and imaginary parts of an analytic function
g
(
z
)
{\displaystyle g(z)}
,
ξ
(
x
,
y
)
=
ℜ
g
(
z
)
η
(
x
,
y
)
=
ℑ
g
(
z
)
{\displaystyle {\begin{array}{c}\xi (x,y)=\Re g(z)\\\eta (x,y)=\Im g(z)\\\end{array}}}
where
z
=
x
+
i
y
{\displaystyle z=x+iy}
. Examples of analytic functions include
g
(
z
)
=
log
z
=
log
(
x
+
i
y
)
{\displaystyle g(z)=\log z=\log(x+iy)}
, as well as monomials
g
(
z
)
=
z
n
=
(
x
+
i
y
)
n
{\displaystyle g(z)=z^{n}=(x+iy)^{n}}
,
g
(
z
)
=
z
n
/
2
=
(
x
+
i
y
)
n
/
2
{\displaystyle g(z)=z^{n/2}=(x+iy)^{n/2}}
, where
n
{\displaystyle n}
is an arbitrary positive or negative integer. The monomials
g
(
z
)
=
z
n
{\displaystyle g(z)=z^{n}}
are also referred to as harmonic functions in computer vision, and image processing.
Thereby, Cartesian Structure tensor is a special case of GST where
ξ
=
x
{\displaystyle \xi =x}
, and
η
=
y
{\displaystyle \eta =y}
, i.e. the harmonic function is simply
g
(
z
)
=
z
=
(
x
+
i
y
)
{\displaystyle g(z)=z=(x+iy)}
. Thus by choosing a harmonic function
g
{\displaystyle g}
, one can detect all curves that are linear combinations of its real and imaginary parts by convolutions on (rectangular) image grids only, even if
ξ
,
η
{\displaystyle \xi ,\eta }
are non-Cartesian. Furthermore, the convolution computations can be done by using complex filters applied to the complex version of the structure tensor. Thus, GST implementations have frequently been done using complex version of the structure tensor, rather than using the (1,1) tensor.
Complex version of GST
As there is a complex version of the ordinary structure tensor, there is also a complex version of the GST
κ
20
=
(
λ
1
−
λ
2
)
exp
(
i
2
θ
)
=
w
∗
(
h
∗
f
)
2
κ
11
=
λ
1
+
λ
2
=
|
w
|
∗
|
h
∗
f
|
2
{\displaystyle {\begin{array}{c}\kappa _{20}=(\lambda _{1}-\lambda _{2})\exp(i2\theta )&=&w*(h*f)^{2}\\\kappa _{11}=\lambda _{1}+\lambda _{2}&=&|w|*|h*f|^{2}\\\end{array}}}
which is identical to its cousin with the difference that
w
{\displaystyle w}
is a complex filter. It should be recalled that, the ordinary structure tensor
w
{\displaystyle w}
is a real filter, usually defined by a sampled and scaled Gaussian to delineate the neighborhood, also known as the outer scale. This simplicity is a reason for why GST implementations have predominantly used the complex version above. For curve families
ξ
,
η
{\displaystyle \xi ,\eta }
defined by analytic functions
g
{\displaystyle g}
, it can be shown that, the neighborhood defining function is complex valued,
w
=
(
x
±
i
y
)
n
exp
(
−
(
x
2
+
y
2
)
/
(
2
σ
2
)
)
∝
(
D
x
±
i
D
y
)
n
exp
(
−
(
x
2
+
y
2
)
/
(
2
σ
2
)
)
{\displaystyle w=(x\pm iy)^{n}\exp(-(x^{2}+y^{2})/(2\sigma ^{2}))\propto (D_{x}\pm iD_{y})^{n}\exp(-(x^{2}+y^{2})/(2\sigma ^{2}))}
,
a so called symmetry derivative of a Gaussian. Thus, the orientation wise variation of the pattern to be looked for is directly incorporated into the neighborhood defining function, and the detection occurs in the space of the (ordinary) structure tensor.
Basic concept for its use in image processing and computer vision
Efficient detection of
θ
{\displaystyle \theta }
in images is possible by image processing for a pair
ξ
{\displaystyle \xi }
,
η
{\displaystyle \eta }
. Complex convolutions (or the corresponding matrix operations) and point-wise non-linear mappings are the basic computational elements of GST implementations. A total least square error estimation of
2
θ
{\displaystyle 2\theta }
is then obtained along with the two errors,
λ
m
a
x
{\displaystyle \lambda _{max}}
and
λ
m
i
n
{\displaystyle \lambda _{min}}
. In analogy with the Cartesian structure tensor, the estimated angle is in double angle representation, i.e.
2
θ
{\displaystyle 2\theta }
is delivered by computations, and can be used as a shape feature whereas
λ
m
a
x
−
λ
m
i
n
{\displaystyle \lambda _{max}-\lambda _{min}}
alone or in combination with
λ
m
a
x
+
λ
m
i
n
{\displaystyle \lambda _{max}+\lambda _{min}}
can be used as a quality (confidence, certainty) measure for the angle estimation.
Logarithmic spirals, including circles, can for instance be detected by (complex) convolutions and non-linear mappings. The spirals can be in gray (valued) images or in a binary image, i.e. locations of edge elements of the concerned patterns, such as contours of circles or spirals, must not be known or marked otherwise.
Generalized structure tensor can be used as an alternative to Hough transform in image processing and computer vision to detect patterns whose local orientations can be modelled, for example junction points. The main differences comprise:
Negative, as well as complex voting are allowed;
With one template multiple patterns belonging to the same family can be detected;
Image binarization is not required.
Physical and mathematical interpretation
The curvilinear coordinates of GST can explain physical processes applied to images. A well known pair of processes consist in rotation, and zooming. These are related to the coordinate transformation
ξ
=
log
(
x
2
+
y
2
)
{\displaystyle \xi =\log({\sqrt {x^{2}+y^{2}}})}
and
η
=
tan
−
1
(
x
,
y
)
{\displaystyle \eta =\tan ^{-1}(x,y)}
.
If an image
f
{\displaystyle f}
consists in iso-curves that can be explained by only
ξ
{\displaystyle \xi }
i.e. its iso-curves consist in circles
f
(
ξ
,
η
)
=
g
(
ξ
)
{\displaystyle f(\xi ,\eta )=g(\xi )}
, where
g
{\displaystyle g}
is any real valued differentiable function defined on 1D, the image is invariant to rotations (around the origin).
Zooming (comprising unzooming) operation is modeled similarly. If the image has iso-curves that look like a "star" or bicycle spokes, i.e.
f
(
ξ
,
η
)
=
g
(
η
)
{\displaystyle f(\xi ,\eta )=g(\eta )}
for some differentiable 1D function
g
{\displaystyle g}
then, the image
f
{\displaystyle f}
is invariant to scaling (w.r.t. the origin).
In combination,
f
(
ξ
,
η
)
=
g
(
cos
(
θ
)
log
(
x
2
+
y
2
)
+
sin
(
θ
)
tan
−
1
(
x
,
y
)
)
{\displaystyle f(\xi ,\eta )=g(\cos(\theta )\log({\sqrt {x^{2}+y^{2}}})+\sin(\theta )\tan ^{-1}(x,y))}
is invariant to a certain amount of rotation combined with scaling, where the amount is precised by the parameter
θ
{\displaystyle \theta }
.
Analogously, the Cartesian structure tensor is a representation of a translation too. Here the physical process consists in an ordinary translation of a certain amount along
x
{\displaystyle x}
combined with translation along
y
{\displaystyle y}
,
cos
(
θ
)
x
+
sin
(
θ
)
y
=
constant
{\displaystyle \cos(\theta )x+\sin(\theta )y={\text{constant}}}
where the amount is specified by the parameter
θ
{\displaystyle \theta }
. Evidently
θ
{\displaystyle \theta }
here represents the direction of the line.
Generally, the estimated
θ
{\displaystyle \theta }
represents the direction (in
ξ
,
η
{\displaystyle \xi ,\eta }
coordinates) along which infinitesimal translations leave the image invariant, in practice least variant. With every curvilinear coordinate basis pair, there is thus a pair of infinitesimal translators, a linear combination of which is a Differential operator. The latter are related to Lie algebra.
Miscellaneous
"Image" in the context of the GST can mean both an ordinary image and an image neighborhood thereof (local image), depending on context. For example, a photograph is an image as is any neighborhood of it.
See also
Structure tensor
Hough transform
Tensor
Gaussian
Corner detection
Edge detection
Affine shape adaptation
Directional derivative
Differential operator
Lie algebra