Users Guide¶
To estimate the classical Optical Flow using the original technique proposed by Horn & Schunck, use the functor bob.ip.optflow.hornschunck.VanillaFlow
.
In the following example, we assume you provide a pair of gray-scaled images i1
and i2
, represented using a 2D numpy.ndarray
containing numpy.float64
elements:
>>> import bob.ip.optflow.hornschunck
>>> flow = bob.ip.optflow.hornschunck.VanillaFlow(i1.shape)
>>> u, v = flow.estimate(alpha=200, iterations=20, image1=i1, image2=i2)
>>> print(u)
[[...]]
>>> print(v)
[[...]]
If you’d like to estimate the flow for an image, given a triplet, then use the bob.ip.optflow.hornschunck.Flow
instead:
>>> import bob.ip.optflow.hornschunck
>>> flow = bob.ip.optflow.hornschunck.Flow(i1.shape)
>>> u, v = flow.estimate(200, 20, i1, i2, i3)
>>> print(u)
[[...]]
>>> print(v)
[[...]]