ClassesClassesClassesClasses | | | | Operators

fit_surface_second_orderfit_surface_second_orderFitSurfaceSecondOrderfit_surface_second_orderFitSurfaceSecondOrderFitSurfaceSecondOrder (Operator)

Name

fit_surface_second_orderfit_surface_second_orderFitSurfaceSecondOrderfit_surface_second_orderFitSurfaceSecondOrderFitSurfaceSecondOrder — Calculate gray value moments and approximation by a second order surface.

Signature

fit_surface_second_order(Regions, Image : : Algorithm, Iterations, ClippingFactor : Alpha, Beta, Gamma, Delta, Epsilon, Zeta)

Herror fit_surface_second_order(const Hobject Regions, const Hobject Image, const char* Algorithm, const Hlong Iterations, double ClippingFactor, double* Alpha, double* Beta, double* Gamma, double* Delta, double* Epsilon, double* Zeta)

Herror T_fit_surface_second_order(const Hobject Regions, const Hobject Image, const Htuple Algorithm, const Htuple Iterations, const Htuple ClippingFactor, Htuple* Alpha, Htuple* Beta, Htuple* Gamma, Htuple* Delta, Htuple* Epsilon, Htuple* Zeta)

Herror fit_surface_second_order(Hobject Regions, Hobject Image, const HTuple& Algorithm, const HTuple& Iterations, const HTuple& ClippingFactor, double* Alpha, double* Beta, double* Gamma, double* Delta, double* Epsilon, double* Zeta)

Herror fit_surface_second_order(Hobject Regions, Hobject Image, const HTuple& Algorithm, const HTuple& Iterations, const HTuple& ClippingFactor, HTuple* Alpha, HTuple* Beta, HTuple* Gamma, HTuple* Delta, HTuple* Epsilon, HTuple* Zeta)

double HRegion::FitSurfaceSecondOrder(const HImage& Image, const HTuple& Algorithm, const HTuple& Iterations, const HTuple& ClippingFactor, double* Beta, double* Gamma, double* Delta, double* Epsilon, double* Zeta) const

HTuple HRegionArray::FitSurfaceSecondOrder(const HImage& Image, const HTuple& Algorithm, const HTuple& Iterations, const HTuple& ClippingFactor, HTuple* Beta, HTuple* Gamma, HTuple* Delta, HTuple* Epsilon, HTuple* Zeta) const

void FitSurfaceSecondOrder(const HObject& Regions, const HObject& Image, const HTuple& Algorithm, const HTuple& Iterations, const HTuple& ClippingFactor, HTuple* Alpha, HTuple* Beta, HTuple* Gamma, HTuple* Delta, HTuple* Epsilon, HTuple* Zeta)

HTuple HImage::FitSurfaceSecondOrder(const HRegion& Regions, const HString& Algorithm, Hlong Iterations, double ClippingFactor, HTuple* Beta, HTuple* Gamma, HTuple* Delta, HTuple* Epsilon, HTuple* Zeta) const

double HImage::FitSurfaceSecondOrder(const HRegion& Regions, const HString& Algorithm, Hlong Iterations, double ClippingFactor, double* Beta, double* Gamma, double* Delta, double* Epsilon, double* Zeta) const

double HImage::FitSurfaceSecondOrder(const HRegion& Regions, const char* Algorithm, Hlong Iterations, double ClippingFactor, double* Beta, double* Gamma, double* Delta, double* Epsilon, double* Zeta) const

HTuple HRegion::FitSurfaceSecondOrder(const HImage& Image, const HString& Algorithm, Hlong Iterations, double ClippingFactor, HTuple* Beta, HTuple* Gamma, HTuple* Delta, HTuple* Epsilon, HTuple* Zeta) const

double HRegion::FitSurfaceSecondOrder(const HImage& Image, const HString& Algorithm, Hlong Iterations, double ClippingFactor, double* Beta, double* Gamma, double* Delta, double* Epsilon, double* Zeta) const

double HRegion::FitSurfaceSecondOrder(const HImage& Image, const char* Algorithm, Hlong Iterations, double ClippingFactor, double* Beta, double* Gamma, double* Delta, double* Epsilon, double* Zeta) const

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

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

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

static void HOperatorSet.FitSurfaceSecondOrder(HObject regions, HObject image, HTuple algorithm, HTuple iterations, HTuple clippingFactor, out HTuple alpha, out HTuple beta, out HTuple gamma, out HTuple delta, out HTuple epsilon, out HTuple zeta)

HTuple HImage.FitSurfaceSecondOrder(HRegion regions, string algorithm, int iterations, double clippingFactor, out HTuple beta, out HTuple gamma, out HTuple delta, out HTuple epsilon, out HTuple zeta)

double HImage.FitSurfaceSecondOrder(HRegion regions, string algorithm, int iterations, double clippingFactor, out double beta, out double gamma, out double delta, out double epsilon, out double zeta)

HTuple HRegion.FitSurfaceSecondOrder(HImage image, string algorithm, int iterations, double clippingFactor, out HTuple beta, out HTuple gamma, out HTuple delta, out HTuple epsilon, out HTuple zeta)

double HRegion.FitSurfaceSecondOrder(HImage image, string algorithm, int iterations, double clippingFactor, out double beta, out double gamma, out double delta, out double epsilon, out double zeta)

Description

The operator fit_surface_second_orderfit_surface_second_orderFitSurfaceSecondOrderfit_surface_second_orderFitSurfaceSecondOrderFitSurfaceSecondOrder 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:

ImageImageImageImageImageimage(r,c) =  AlphaAlphaAlphaAlphaAlphaalpha(r - r_center)**2 
             + BetaBetaBetaBetaBetabeta(c - c_center)**2 
             + GammaGammaGammaGammaGammagamma(r - r_center)*(c - c_center) 
             + DeltaDeltaDeltaDeltaDeltadelta(r - r_center) 
             + EpsilonEpsilonEpsilonEpsilonEpsilonepsilon(c - c_center) 
             + ZetaZetaZetaZetaZetazeta

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

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

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

Attention

Note that the operator fit_surface_second_orderfit_surface_second_orderFitSurfaceSecondOrderfit_surface_second_orderFitSurfaceSecondOrderFitSurfaceSecondOrder only considers the given RegionsRegionsRegionsRegionsRegionsregions and ignores any previously set domain of the input image ImageImageImageImageImageimage.

Parallelization

Parameters

RegionsRegionsRegionsRegionsRegionsregions (input_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject

Regions to be checked.

ImageImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHImageHImageXHobject (byte / uint2 / direction / cyclic / real)

Corresponding gray values.

AlgorithmAlgorithmAlgorithmAlgorithmAlgorithmalgorithm (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Algorithm for the fitting.

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

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

IterationsIterationsIterationsIterationsIterationsiterations (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

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

Default value: 5

Restriction: Iterations >= 0

ClippingFactorClippingFactorClippingFactorClippingFactorClippingFactorclippingFactor (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (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

AlphaAlphaAlphaAlphaAlphaalpha (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Parameter Alpha of the approximating surface.

BetaBetaBetaBetaBetabeta (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Parameter Beta of the approximating surface.

GammaGammaGammaGammaGammagamma (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Parameter Gamma of the approximating surface.

DeltaDeltaDeltaDeltaDeltadelta (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Parameter Delta of the approximating surface.

EpsilonEpsilonEpsilonEpsilonEpsilonepsilon (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Parameter Epsilon of the approximating surface.

ZetaZetaZetaZetaZetazeta (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Parameter Zeta of the approximating surface.

Result

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

Possible Successors

gen_image_surface_second_ordergen_image_surface_second_orderGenImageSurfaceSecondOrdergen_image_surface_second_orderGenImageSurfaceSecondOrderGenImageSurfaceSecondOrder

See also

moments_gray_planemoments_gray_planeMomentsGrayPlanemoments_gray_planeMomentsGrayPlaneMomentsGrayPlane, fit_surface_first_orderfit_surface_first_orderFitSurfaceFirstOrderfit_surface_first_orderFitSurfaceFirstOrderFitSurfaceFirstOrder

Module

Foundation


ClassesClassesClassesClasses | | | | Operators