optical_flow2 ( Image1, Image2 : VectorField : Mode, Threshold, Step, SizeWindow, SizeSearch, Weights : )

Calculating the Displacement vector field by correlation methods.

The operator optical_flow2 determines a displacement vector field (DVF) with the help of correlation methods. Simple- and multichannel Images may be used. A window of the size SizeWindow will be moved inside a mask of the size SizeSearch over a second image and there the grayvalues will be compared with the ones from the first image. The correlation showing the slightest error will determine the vector. In case of two vectors having the same weighting, the shorter vector will be prefered. After having processed one image point, the next image point at a distance of Step will be selected. It is therefore not guaranteed to get a dense displacement vector field.

The parameter Threshold specifies the maximal divergence of previously estimated correlations and the best estimation of a displacement vector.

The method used by the procedure is determined by the parameter Mode. If the image has more than one channel the parameter Weights indicates the weighting of the individual channels. For each channel one weight factor must be passed.

For the parameters SizeWindow, SizeSearch and Step optionally two values can be passed: The first value indicates hereby the width (respectively the row), the second value the height (respectively the column).


Parameters

Image1 (input_object)
image(-array) -> object : byte
First input image (optionally with more than one channel).

Image2 (input_object)
image(-array) -> object : byte
Second input image (optionally with more than one channel).
Number of elements: Image2 == Image1

VectorField (output_object)
image(-array) -> object : dvf
Displacement vector field to be calculated.
Number of elements: VectorField == Image1

Mode (input_control)
string -> string
Kind of correlation.
Default value: 'norm3'
List of values: 'norm1', 'norm2', 'norm3', 'binary1', 'binary2', 'simple1', 'simple2', 'mean1', 'mean2'

Threshold (input_control)
integer -> integer
Maximal divergence of the previously estimated correlations and the best estimate of a displacement vector.
Default value: 10
Suggested values: 1, 2, 3, 4, 5, 7, 10, 12, 15, 17, 20
Range of values: 1 <= Threshold <= 300
Minimum increment: 1
Recommended increment: 5

Step (input_control)
integer(-array) -> integer
Step width.
Default value: 10
Suggested values: 1, 2, 3, 5, 7, 10, 15, 20, 30, 50
Range of values: 1 <= Step <= 300
Minimum increment: 1
Recommended increment: 5

SizeWindow (input_control)
integer(-array) -> integer
Size of the correlation window.
Default value: 11
Suggested values: 3, 5, 7, 9, 11, 15, 20, 30
Range of values: 1 <= SizeWindow <= 30
Minimum increment: 1
Recommended increment: 2

SizeSearch (input_control)
integer(-array) -> integer
Size of the area to be searched.
Default value: 20
Suggested values: 3, 5, 7, 10, 20, 30, 40, 50, 60
Range of values: 1 <= SizeSearch <= 60
Minimum increment: 1
Recommended increment: 2

Weights (input_control)
integer(-array) -> integer
Weighting of the channels.
Default value: 1
Suggested values: 1, 3, 5, 7, 10
Range of values: 1 <= Weights <= 10
Minimum increment: 1
Recommended increment: 1


Example
read_image(:B1::) >
mean__(B1:L1:16,16::) >
read_image(:B2::) >
mean__(B2:L2:16,16::) >
optical_flow2(L1,L2:VVF:'norm3',10,10,11,20,1:) >
disp_image(B1:::) >
set_color(::'red':) >
disp_image(VVF:::).

Possible Predecessors

mean__


Possible Successors

fill_image


Alternatives

optical_flow1__


See also

optical_flow1__



Copyright © 1996-1997 MVTec Software GmbH