HornSchunckFlow.evaluate

Evaluate Horn-Schunck dense optical flow method between two consecutive frames.

class HornSchunckFlow
override
evaluate
(
inout Image f1
,
inout Image f2
,
DenseFlow prealloc = emptySlice!([3], float)
,
bool usePrevious = false
)
in { assert (!f1.empty && !f2.empty && f1.channels == 1 && f1.size == f2.size && f1.depth == f2.depth); if (usePrevious) { assert (prealloc.length!0 == f1.height && prealloc.length!1 == f1.width && prealloc.length!2 == 2); } }

Parameters

f1
Type: Image

First image, i.e. previous frame in the video.

f2
Type: Image

Second image of same size and type as f1, i.e. current frame in the video.

prealloc
Type: DenseFlow

Optional pre-allocated flow buffer. If provided, has to be of same size as input images are, and with 2 channels (u, v).

usePrevious
Type: bool

Should the previous flow be used. If true prealloc is treated as previous flow, and has to satisfy size requirements.

Return Value

Type: DenseFlow

Calculated flow field.

Meta