Game Development Reference
In-Depth Information
5.3
Flow-Guided Smoothing
Let v :
R 2 R 2 be a vector field, and let ( a, b )beanopeninterval. Acurve
γ :( a, b ) R 2 satisfying γ ( t )= v ( γ ( t )) for all t ( a, b ) is called an integral
curve or stream line of the vector field v . Taken together, the minor eigenvectors
of the smoothed structure tensors at each pixel define a vector field, which is
smooth up to a change of sign and closely aligned to image features. The general
idea behind the flow-guided smoothing is to perform a filtering operation by
following the minor eigenvectors through tracing the corresponding stream line.
In contrast to the isophote curves of the image, the stream lines defined by the
smoothed structure tensor are much smoother, and smoothing along them results
in a regularization of the geometry of the isophote curves. The next section
discusses the computation of the stream lines. Then, filtering along them will be
examined. Finally, how to adjust adaptively the length of the stream lines used
for filtering will be discussed.
5.3.1 Streamline Integration
Formally, finding the stream line γ :( a, b )
passing through a point x 0 of a vec-
tor field v can be described as solving the system of ordinary differential equations
γ ( t )= v ( γ ( t )), t
R
( a, b ). Sev-
eral numerical techniques are available tosolvesuchasystem. Forthepresented
algorithm, the second-order Runge-Kutta method is used, since it is simple to
implement, achieves high-quality results, and has reasonable computational com-
plexity. For pedagogical reasons, the simpler first-order Euler integration method
is explained first. Taking the initial condition as a starting point, both methods
operate iteratively, adding a new point with every step. Since for the computa-
tion of the smoothing operation at a point, a stream line passing through it is
required, the integration has to be performed in forward and backward directions,
as shown in Figure 5.8.
If the considered vector field is given by the minor eigenvectors, special atten-
tion must be paid to their sign, since the structure tensor defines only orientation
but no particular direction. This is due to the quadratic nature of the structure
tensor. A straightforward way to define the sign of the minor eigenvectors is to
( a, b ) with initial condition γ ( t 0 )= x 0
for t 0
t + ( x 2 )
+
t + ( x 1 )
+
t 0 + ( x 0 )
+
x +
t 0 ( x 0 )
x +
+
t 2 (x 2 )
t 1 ( x 1 )
x 1
x 0
x 3
x 2
x 1
Figure 5.8. Integration of a stream line passing through a point x 0
is performed itera-
tively in forward and backward directions.