Professional Documents
Culture Documents
Quantitative Color Optical Flow
Quantitative Color Optical Flow
Quantitative Color Optical Flow
John Barron
Department of Computer Science, University of Western Ontario
London, Ontario, Canada, N6A 5B7, email: barron@csd.uwo.ca
Reinhard Klette
CITR, University of Auckland, Tamaki Campus, Building 731
Auckland, New Zealand, email: r.klette@auckland.ac.nz
1
squares framework. If we assume a constant flow vector in
a /ACBD/EF/ACBD neighbourhood then +>?+ becomes the
least squares Lucas and Kanade optical flow method [1, 7].
We used AGHB for the Lucas and Kanade results reported
here. If all weights were 0 except for the Y channel (with
value 1) then we would have the standard gray value Lucas
and Kanade calculation [1, 7]. If the R, G and B weights are
1 with all other weights 0 we have color Lucas and Kanade.
Lastly, if AIJ , we have the standard Golland and Bruck-
stein method, where the neighbourhood size is 1.
We recast the standard Horn and Schunck regularization
[1, 4, 5] as the minimization of:
K M P M M MRQTS S S S S S
LMON 7 8 = 7 8 7 8
&
$ GU V W
G
X!
M
N M
The weights N importance
indicate the attached M of each Figure 1. Panning flow using the Golland and
channel of image information, e.g.,
Y N J
means channel Bruckstein method on the RGB images.
has absolutely no importance. If all are 0 except the
one corresponding to the Y channel (with value 1) then this S S S S S Sihij
minimization is exactly Horn and Schunck on a gray value 7 8 7 8
image [1, 5]. U G V
G
egf kl
/m!
M M
MOhta [10] derives optical flow in a least squares frame-7 Again, as N for the Horn and Schunck regularization, the
work
8 on channel derivatives in color images. Let
Y and weights indicate the attached importance of each channel
hij
denote the
7[Z and derivatives
in color channel . For of image information and can be set so as to include/exclude
example could be the derivatives in the hue image. any color channel. kl
/ is a directional constraint that
Ohta assumes that there are AW\] optical flow constraints depends on one knowing whether the camera is panning or
S channels.
for the different S For A^ , it follows S that S
F8 _ = F= _8 F= F7 _7 _= zooming. Because the 3D translational direction is known,
S S S S the direction of flow can be computed everywhere using the
C 7 0 8 8 0 7 and
7 0 8 8 0 7 !
< S < S` standard optical flow equations [6] and this can be used to
0 0 F7 _8 M 0 F 8 < F7 0
<
Both equations are solvable if . Let- constrain the minimization. The directional constraint can
Y
ting the error in the -th equation0 be a < , taking 0 the sum of hij j S S j S
be expressed as:
S S
all squared errors for all A equations, calculating its partial k
n IoX Or!
derivatives with respect to and
, and letting these formu-
M we M obtainM [10]M SM M M <qpRp pRp pRp pRp
lae be equal to zero,
7 8 S M 8 S M = 8M M S 7 =
b M M7b M 8 M < b F7 S MFb 8
M M
7 b 8 S M b 7 S M = < b 7 M M S 8 =
b 7b 8 < b 7 b8
b b b
where summations are from 1 to< A . This approach and the
generalized inverse method [3, 8] assume constant weights
for all equations. Our implementation allows us to set arbi-
trary weights for each of the nine RGB, HSI and YIQ color
channels. Note that if all weights are zero except for the
Y channel weight being 1, then in a /AcdBDEW/AcdBD
neighbourhood we again have a standard Lucas and Kanade
[1, 7] least squares calculation.
Barron and Klette [2] recast the standard Horn and
Schunck regularization as the minimization of:
K M P M M MRQ S Figure 2. Panning flow using the Ohta
L M N 7 8 = method on the RGB images.
$
Figure 3. Panning flow using the Lucas and Figure 4. Zooming flow using the Lucas and
Kanade method on the RGB images. Kanade method on the RGB images.
j
7
Because sensor motion is only due to translation, can be and !RBD// . For example, to compute
, we first con-
written as [6]: volve the prefiltering kernel in the dimension, that con-
j
j h S volve the prefiltering kernel on that result in the dimen-
j Wt 7/w 8yxe{ z sion and finally convolve the differentiation kernel in the
s u o o +cv
V
dimension on that result.
pRp pRp
where is an image location, u is the relative depth, i.e. 3. Error Measurement
uG v~ |"w | }w e|"| x , { is the (unknown) sensor translation
|"| z |"|
magnitude, { is the pRp (known)
pp sensor direction of translation We report on quantitative errors for optical flow com-
and T
are the 3D coordinates of some 3D moving puted from color synthetic image sequences using relative
j
point projected onto . Note that since we do not know magnitude error (as a percentage) and angle error (in de-
'
u , is only in the direction of the true optical flow grees). is the correct optical flow and is the estimated
7w 8Dvector
x
and scaled by the u value used. We can write +-v as a optical flow in the equations below. For magnitude error we
E matrix: report:
h S
h t
7w 8Dx S
+-v s '< EgBD^
< pRp pRp
h
< pRp pp
where is the effective focal length (determined empiri- while for angle error we report:
cally to be about 40mm for the used digital video camera). '
Ol m ¡/¢Dr£ o £ m!
2. Differentiation
4. Experimental Results
The choice of the differential kernel is essential to the
accuracy of both image and range flow calculations. We We generated pan and zoom synthetic image sequences
P
used the balanced/matched Q filters for prefiltering and dif- where the correct flow is known. For panning, we simply
ferentiation proposed S by Simoncelli [12]. A simple av- translated an image of the Tamaki campus Computer Sci-
eraging filter 0 0 0 was used to slightly blur the im- ence building to the left by 3 pixels to make each new frame.
ages before prefiltering/differentiation. The prefiltering ker- For zooming, we imaged a poster of downtown Auckland
nel’s coefficients were !"// , r!"i/ , r! // , (the surface structure is planar) and then downscaled it with
!"i and r! /// while the differential kernel’s the ImageMagick program [9] from /$E¤rBy by in the
coefficients were r!BD/ , !"/rB , !" , !"//B dimension and in the dimension for each frame interval
< <
Synthetic Panning Sequence x S x S
Synthetic Zooming Sequence x x
vR¥¦ ¨v §i© Z ¨v §i¦ v¸§i©
Method Data Magnitude Error
m® Angle Error
m°® ° Method Data Magnitude Error
® S Z¹ Angle Error
°® S °
Horn-Schunck RGB
0«ªm¬ ® 0«ªm¬ Zªª ¬ ¯ ° ® ¬ ±² °
Horn-Schunck RGB
0¬ ²® 0«¯X¬ º ¯m¬ ² °Z ® ªX¬ ²l² °
¬ ³l± m® ³X¬ ´D0 m Z±X0¬¬"±0«±¯ °° ® ´DS¬ ° ²D¬"0«ª ® 0 ¬ ± ¬ ±X0 °
Lucas-Kanade RGB
0 ¬"0´
Lucas-Kanade RGB
00l¬ ´² ® 0«ªm¬ ´m¯ ¬ ± ° ® 00S ¬ ²m± ° 0 ¬ ª ® S0«³X¬ ´ºSª ªm¬ ¯ °«®k° 0 S ¬ ²mª
Golland-Bruckstein RGB Golland-Bruckstein RGB
0 Z ¬ ´m² ® 0²y¬ ³Xm0 ¯X¬ ± ° ® 0 Z ¬ ²m°± 0²D¬ S¯l³ ® ªX¬ ²ºª ³mZ ¬ ª²S °® S °
Ohta RGB Ohta RGB
0²y¬ m³ ® 0«¯m¬ ´ ¬ ³ª ° ®¯X¬ ² ° ´S ´D¬"S0µ¯ ® S ´D ¬ ± 0l0¬"0²°® 0 ¬ ³X°0
Horn-Schunck S+Y Horn-Schunck S+Y
¯X¬ Z ® 0´DSS¬"0µ³ Z 0¬ ´mZ³ ° S ¬ S0«±X¬ 0 ® S0 ¬ ¯l¯ S¬ ´ m° 0S´y¬ ¯
Lucas-Kanade S Lucas-Kanade S
Barron-Klette S+Y
0²y¬ ¯ ® 0²y¬" 0 S±X¬ ± m°® ° Barron-Klette S+Y
SSªX¬ S0 ® 0¬"0´Z ±m¬ ±S± ° ® °
0«¯m¬ ³ª ® ¬ m0 ³X¬ ´ °® ZZ ±XS ¬ ²m±° ±X¬ ±«² ® ¬± Z00µ±X¬¬ ³Z ³³° ° ® ® D´ ¬ ³² °
Golland-Bruckstein S Golland-Bruckstein S
0«¯m¬ mªS ²® 0²y¬ Z³Z ¬ ³ª °® ¬"0² ° S ¬ ª ® S0«ªX¬ ºS±m0 00¬ ¯ª°
Horn-Schunck Y Horn-Schunck Y
Lucas-Kanade Y
S¯XZ¬"0 ® 0S0¬ ³ 0S¬ ¯´Z ° S¬ ´ Lucas-Kanade Y
³X¬ ¯ ® 0 S ¬± S ¬± Z ° 0S´y¬ ¯X0
0 ¬ 0 ® 0²y¬ ´ ±X¬"0² ° ® ° 0¬"0² ® ±X¬ ª ±m¬ ±± ° ® °
Barron-Klette Y Barron-Klette Y
to generate each new image. Thus, the second image was and Klette method produces slightly better flows than Horn
the /E
central block of the first image, expanded to and Schunck.
fit the original size of /&EcBy . Similarly, the third image We obtained diverging flows for the real panning and
was the central
E¶ block of the first image, again zooming sequences using Lucas and Kanade, shown in Fig-
expanded to fit the original size of /·EIBD . The correct ure 6, and for Horn and Schunck, shown in Figure 7. The
diverging flow field has corner velocities having a magni- Horn and Schunck flow is slightly worse than the Lucas and
tude of in the dimension and a magnitude of in the Kanade flow. These flows are poor but in the correct general
dimension. Our real image sequence was at Point England direction. Our directional constraint proved to be useful to
on the Tamaki river in Auckland. The scene consists of a obtaining a more feasible flow field for these images, see the
flat lawn in the foreground with water in the background. flow shown in Figure 8. In this case, there is no (or little)
We used UGJ!" , fG3B!" and 100 iterations for the Horn angle error, although clearly there is magnitude error.
and Schunck and Barron and Klette results reported here.
Tables 1 and 2 show some quantitative magnitude and 5. Conclusions
angle errors for the synthetic pan and zoom sequences.
Figures 1, 2 and 3 show synthetic panning flow fields while Color optical flow computed via the three color chan-
Figures 4 and 5 show synthetic zooming flow fields. Be- nels (with weights 1.0) seems better than gray value opti-
cause good directional information is available the Barron
Figure 5. Zooming flow using the Barron and Figure 6. Zooming flow using the Lucas and
Klette method on the RGB images. Kanade method on the RGB images.
References