match_functions ( : : Function1, Function2, ParamsConst, UseParams : Params )

Calculating the transformation parameters between two functions.

match_functions calculates the transformation parameters between two functions given as the tuplets Function1 and Function2. The tuplets are interpreted as the values of the respective function at integer x coordinates starting at 0. The following model is used for the transformation between the two functions:

    y1(x) = a1*y2(a3*x+a4)+a2 .
The transformation parameters are determined by a least-squares minimization of the following function:
    n-1
    ----
    \                            2
    /   (y1(i)-a1*y2(a3*i+a4)+a2)
    ----
    i=0
Here, the values of the function y2 are obtained by linear interpolation, and are set to 0 outside of the valid range. The calculated transformation parameters are returned as a 4-tuple in Params. If some of the parameter values are known, the respective parameters can be excluded from the least-squares adjustment by setting the corresponding value in the tuplet UseParams to the value 'false'. In this case, the tuplet ParamsConst must contain the known value of the respective parameter. If a parameter is used for the adjustment (UseParams = 'true'), the corresponding parameter in ParamsConst is ignored.


Parameters

Function1 (input_control)
number-array -> real
Function 1 (as a tuplet of floating point numbers).

Function2 (input_control)
number-array -> real
Function 2 (as a tuplet of floating point numbers).

ParamsConst (input_control)
number-array -> real
Values of the parameters to remain constant.
Default value: '[1.0,0.0,1.0,0.0]'
Number of elements: 4

UseParams (input_control)
string-array -> string
Should a parameter be adapted for it?
Default value: '['true','true','true','true']'
List of values: 'true', 'false'
Number of elements: 4

Params (output_control)
number-array -> real
Transformation parameters between the functions.
Number of elements: 4


Possible Predecessors

grey_projections



Copyright © 1996-1997 MVTec Software GmbH