fit_surface_second_order ( Regions, Image : : Algorithm, Iterations, ClippingFactor : Alpha, Beta, Gamma, Delta, Epsilon, Zeta )
Calculate gray value moments and approximation by a second order surface.
The operator fit_surface_second_order calculates the gray value
moments and the parameters of the approximation of the gray values
by a second order surface. The calculation is done by minimizing the
distance between the gray values and the surface. A second order surface is
described by the following formula:
Image(r,c) = Alpha(r-r_center)**2 +
Beta(c-c_center)**2 +
Gamma(r- r_center)*(c-c_center) +
Delta(r- r_center) +
Epsilon(c- c_center) +
Zeta
r_center and c_center are the coordinates of the center of the input region.
By the minimization process the parameters from Alpha to
Zeta is calculated.
The algorithm used for the fitting can be selected via
Algorithm:
'regression':
Standard 'least squares' fitting.
'huber':
Weighted 'least squares' fitting, where the impact of outliers
is decreased based on the approach of Huber.
'tukey':
Weighted 'least squares' fitting, where the impact of outliers
is decreased based on the approach of Tukey.
The parameter ClippingFactor (a scaling factor for the standard
deviation) controls the amount of damping outliers: The smaller the
value chosen for ClippingFactor the more outliers are
detected. The detection of outliers is repeated. The parameter
Iterations specifies the number of iterations. In the modus
'regression' this value is ignored.
Parameters
Regions (input_object)
|
region(-array) -> object
|
|
Regions to be checked. |
Image (input_object)
|
image -> object : byte / uint2 / direction / cyclic / real
|
|
Corresponding gray values. |
Algorithm (input_control)
|
string -> string
|
|
Algorithm for the fitting. |
|
Default value: 'regression' |
|
List of values: 'regression', 'tukey', 'huber' |
Iterations (input_control)
|
integer -> integer
|
|
Maximum number of iterations (unused for 'regression'). |
|
Default value: 5 |
|
Restriction: Iterations >= 0 |
ClippingFactor (input_control)
|
real -> real
|
|
Clipping factor for the elimination of outliers. |
|
Default value: 2.0 |
|
List of values: 1.0, 1.5, 2.0, 2.5, 3.0 |
|
Restriction: ClippingFactor > 0 |
Alpha (output_control)
|
real(-array) -> real
|
|
Parameter Alpha of the approximating surface. |
Beta (output_control)
|
real(-array) -> real
|
|
Parameter Beta of the approximating surface. |
Gamma (output_control)
|
real(-array) -> real
|
|
Parameter Gamma of the approximating surface. |
Delta (output_control)
|
real(-array) -> real
|
|
Parameter Deltaa of the approximating surface. |
Epsilon (output_control)
|
real(-array) -> real
|
|
Parameter Epsilon of the approximating surface. |
Zeta (output_control)
|
real(-array) -> real
|
|
Parameter Zeta of the approximating surface. |
Result
The operator fit_surface_second_order returns the
value 2 (H_MSG_TRUE) if an
image with the defined gray values (byte) is entered and
the parameters are correct.
If necessary an exception handling is raised.
Parallelization Information
fit_surface_second_order is reentrant and automatically parallelized (on tuple level).
See also
moments_gray_plane,
fit_surface_first_order
Module
Image filters
Copyright © 1996-2005 MVTec Software GmbH