Herror ::match_funct_1d_trans (
const HTuple &Function1,
const HTuple &Function2,
const HTuple &Border,
const HTuple &ParamsConst,
const HTuple &UseParams,
HTuple *Params,
HTuple *ChiSquare,
HTuple *Covar
)
Calculate transformation parameters between two functions.
::match_funct_1d_trans calculates the transformation parameters
between two functions given as the tuples Function1 and
Function2 (see ::create_funct_1d_array und
::create_funct_1d_pairs). 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(x[i])-a1*y2(a3*x[i]+a4)+a2) .
----
i=0
The values of the function y2 are obtained by
linear interpolation. The parameter Border determines
the values of the function Function2 outside of its domain.
For Border='zero' these values are set to 0, for
Border='constant' they are set to the
corresponding value at the border, for
Border='mirror' they are mirrored at the border,
and for Border='cyclic' they are continued
cyclically. 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
tuple UseParams to the value 'false'. In this
case, the tuple 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. On output,
::match_funct_1d_trans additionally returns the sum of the
squared errors ChiSquare of the resulting function, i.e.,
the function obtained by transforming the input function with the
transformation parameters, as well as the covariance matrix
Covar of the transformation parameters Params.
These parameters can be used to decide whether a successful matching
of the functions was possible.
Parameters
Function1 (input_control)
|
function_1d-array -> HTuple.double / long
|
|
Function 1. |
Function2 (input_control)
|
function_1d-array -> HTuple.double / long
|
|
Function 2. |
Border (input_control)
|
string -> HTuple.char *
|
|
Border treatment for function 2. |
|
Default value: 'constant' |
|
List of values: 'zero', 'constant', 'mirror', 'cyclic' |
ParamsConst (input_control)
|
number-array -> HTuple.double
|
|
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 -> HTuple.char *
|
|
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 -> HTuple.double *
|
|
Transformation parameters between the functions. |
|
Number of elements: 4 |
ChiSquare (output_control)
|
number -> HTuple.double *
|
|
Quadratic error of the output function. |
Covar (output_control)
|
number-array -> HTuple.double *
|
|
Covariance Matrix of the transformation parameters. |
|
Number of elements: 16 |
Possible Predecessors
::create_funct_1d_array,
::create_funct_1d_pairs
See also
::gray_projections
Module
Tools
Copyright © 1996-2002 MVTec Software GmbH