HALCON Reference Manual 10.0.2
Table of Contents / Image / Features ClassesClassesClasses | | | Operators

fit_surface_first_orderfit_surface_first_orderfit_surface_first_orderFitSurfaceFirstOrderFitSurfaceFirstOrder (Operator)

Name

fit_surface_first_orderfit_surface_first_orderfit_surface_first_orderFitSurfaceFirstOrderFitSurfaceFirstOrder — Calculate gray value moments and approximation by a first order surface (plane).

Signature

fit_surface_first_order(Regions, Image : : Algorithm, Iterations, ClippingFactor : Alpha, Beta, Gamma)

Herror fit_surface_first_order(const Hobject Regions, const Hobject Image, const char* Algorithm, const Hlong Iterations, double ClippingFactor, double* Alpha, double* Beta, double* Gamma)

Herror T_fit_surface_first_order(const Hobject Regions, const Hobject Image, const Htuple Algorithm, const Htuple Iterations, const Htuple ClippingFactor, Htuple* Alpha, Htuple* Beta, Htuple* Gamma)

Herror fit_surface_first_order(Hobject Regions, Hobject Image, const HTuple& Algorithm, const HTuple& Iterations, const HTuple& ClippingFactor, double* Alpha, double* Beta, double* Gamma)

Herror fit_surface_first_order(Hobject Regions, Hobject Image, const HTuple& Algorithm, const HTuple& Iterations, const HTuple& ClippingFactor, HTuple* Alpha, HTuple* Beta, HTuple* Gamma)

double HRegion::FitSurfaceFirstOrder(const HImage& Image, const HTuple& Algorithm, const HTuple& Iterations, const HTuple& ClippingFactor, double* Beta, double* Gamma) const

HTuple HRegionArray::FitSurfaceFirstOrder(const HImage& Image, const HTuple& Algorithm, const HTuple& Iterations, const HTuple& ClippingFactor, HTuple* Beta, HTuple* Gamma) const

void HOperatorSetX.FitSurfaceFirstOrder(
[in] IHUntypedObjectX* Regions, [in] IHUntypedObjectX* Image, [in] VARIANT Algorithm, [in] VARIANT Iterations, [in] VARIANT ClippingFactor, [out] VARIANT* Alpha, [out] VARIANT* Beta, [out] VARIANT* Gamma)

VARIANT HImageX.FitSurfaceFirstOrder(
[in] IHRegionX* Regions, [in] BSTR Algorithm, [in] Hlong Iterations, [in] double ClippingFactor, [out] VARIANT* Beta, [out] VARIANT* Gamma)

VARIANT HRegionX.FitSurfaceFirstOrder(
[in] IHImageX* Image, [in] BSTR Algorithm, [in] Hlong Iterations, [in] double ClippingFactor, [out] VARIANT* Beta, [out] VARIANT* Gamma)

static void HOperatorSet.FitSurfaceFirstOrder(HObject regions, HObject image, HTuple algorithm, HTuple iterations, HTuple clippingFactor, out HTuple alpha, out HTuple beta, out HTuple gamma)

HTuple HImage.FitSurfaceFirstOrder(HRegion regions, string algorithm, int iterations, double clippingFactor, out HTuple beta, out HTuple gamma)

double HImage.FitSurfaceFirstOrder(HRegion regions, string algorithm, int iterations, double clippingFactor, out double beta, out double gamma)

HTuple HRegion.FitSurfaceFirstOrder(HImage image, string algorithm, int iterations, double clippingFactor, out HTuple beta, out HTuple gamma)

double HRegion.FitSurfaceFirstOrder(HImage image, string algorithm, int iterations, double clippingFactor, out double beta, out double gamma)

Description

The operator fit_surface_first_orderfit_surface_first_orderfit_surface_first_orderFitSurfaceFirstOrderFitSurfaceFirstOrder calculates the gray value moments and the parameters of the approximation of the gray values by a first order surface. The calculation is done by minimizing the distance between the gray values and the surface. A first order surface is described by the following formula:

ImageImageImageImageimage(r,c) =  AlphaAlphaAlphaAlphaalpha(r-r_center) +
                        BetaBetaBetaBetabeta(c-c_center) +
                        GammaGammaGammaGammagamma

r_center and c_center are the center coordinates of intersection of the input region with the full image domain. By the minimization process the parameters from AlphaAlphaAlphaAlphaalpha to GammaGammaGammaGammagamma is calculated.

The algorithm used for the fitting can be selected via AlgorithmAlgorithmAlgorithmAlgorithmalgorithm:

'regression'

Standard 'least squares' line 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 ClippingFactorClippingFactorClippingFactorClippingFactorclippingFactor (a scaling factor for the standard deviation) controls the amount of damping outliers: The smaller the value chosen for ClippingFactorClippingFactorClippingFactorClippingFactorclippingFactor the more outliers are detected. The detection of outliers is repeated. The parameter IterationsIterationsIterationsIterationsiterations specifies the number of iterations. In the modus 'regression' this value is ignored.

Parallelization

Parameters

RegionsRegionsRegionsRegionsregions (input_object)  region(-array) objectHRegionHRegionHRegionXHobject

Regions to be checked.

ImageImageImageImageimage (input_object)  image objectHImageHImageHImageXHobject (byte / uint2 / direction / cyclic / real)

Corresponding gray values.

AlgorithmAlgorithmAlgorithmAlgorithmalgorithm (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Algorithm for the fitting.

Default value: 'regression' "regression" "regression" "regression" "regression"

List of values: 'regression'"regression""regression""regression""regression", 'huber'"huber""huber""huber""huber", 'tukey'"tukey""tukey""tukey""tukey"

IterationsIterationsIterationsIterationsiterations (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Maximum number of iterations (unused for 'regression').

Default value: 5

Restriction: Iterations >= 0

ClippingFactorClippingFactorClippingFactorClippingFactorclippingFactor (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

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

AlphaAlphaAlphaAlphaalpha (output_control)  real(-array) HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Parameter Alpha of the approximating surface.

BetaBetaBetaBetabeta (output_control)  real(-array) HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Parameter Beta of the approximating surface.

GammaGammaGammaGammagamma (output_control)  real(-array) HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Parameter Gamma of the approximating surface.

Result

The operator fit_surface_second_orderfit_surface_second_orderfit_surface_second_orderFitSurfaceSecondOrderFitSurfaceSecondOrder returns the value 2 (H_MSG_TRUE) if an image with the defined gray values ('byte'"byte""byte""byte""byte") is entered and the parameters are correct. If necessary an exception is raised.

See also

moments_gray_planemoments_gray_planemoments_gray_planeMomentsGrayPlaneMomentsGrayPlane, fit_surface_second_orderfit_surface_second_orderfit_surface_second_orderFitSurfaceSecondOrderFitSurfaceSecondOrder

Module

Foundation


Table of Contents / Image / Features ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH