Skip to content

fit_surface_second_orderFitSurfaceSecondOrderFitSurfaceSecondOrderfit_surface_second_orderfit_surface_second_order๐Ÿ”—

Short description๐Ÿ”—

fit_surface_second_orderFitSurfaceSecondOrderFitSurfaceSecondOrderfit_surface_second_orderfit_surface_second_order โ€” Calculate gray value moments and approximation by a second order surface.

Signature๐Ÿ”—

fit_surface_second_order( region Regions, image Image, string Algorithm, integer Iterations, real ClippingFactor, out real Alpha, out real Beta, out real Gamma, out real Delta, out real Epsilon, out real Zeta )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 )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 )def fit_surface_second_order( regions: HObject, image: HObject, algorithm: str, iterations: int, clipping_factor: float ) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float]]

def fit_surface_second_order_s( regions: HObject, image: HObject, algorithm: str, iterations: int, clipping_factor: float ) -> Tuple[float, float, float, float, float, float]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 )

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

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

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

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

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_orderFitSurfaceSecondOrder 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:

\[\begin{eqnarray*} \textrm{Image}(r,c) & = & \textrm{Alpha}(r - r_{center})^2\\ & + & \textrm{Beta}(c - c_{center})^2\\ & + & \textrm{Gamma}(r - r_{center})*(c - c_{center})\\ & + & \textrm{Delta}(r - r_{center})\\ & + & \textrm{Epsilon}(c - c_{center})\\ & + & \textrm{Zeta} \end{eqnarray*}\]

\(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 Alphaalphaalpha to Zetazetazeta is calculated.

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

  • 'regression'"regression" Standard โ€˜least squaresโ€™ fitting.

  • 'huber'"huber" Weighted โ€˜least squaresโ€™ fitting, where the impact of outliers is decreased based on the approach of Huber.

  • 'tukey'"tukey" Weighted โ€˜least squaresโ€™ fitting, where outliers are ignored based on the approach of Tukey.

The parameter ClippingFactorclippingFactorclipping_factor (a scaling factor for the standard deviation) controls the amount of damping outliers: The smaller the value chosen for ClippingFactorclippingFactorclipping_factor the more outliers are detected. The detection of outliers is repeated. The parameter Iterationsiterationsiterations specifies the number of iterations. If 'regression'"regression" is set for Algorithmalgorithmalgorithm Iterationsiterationsiterations is ignored.

Attention๐Ÿ”—

Note that the operator fit_surface_second_orderFitSurfaceSecondOrder only considers the given Regionsregionsregions and ignores any previously set domain of the input image Imageimageimage.

Execution information๐Ÿ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on internal data level.

Parameters๐Ÿ”—

Regionsregionsregions (input_object) region(-array) โ†’ objectHObjectHRegionHObjectHobject

Regions to be checked.

Imageimageimage (input_object) singlechannelimage โ†’ object (byte / uint2 / direction / cyclic / real)HObject (byte / uint2 / direction / cyclic / real)HImage (byte / uint2 / direction / cyclic / real)HObject (byte / uint2 / direction / cyclic / real)Hobject (byte / uint2 / direction / cyclic / real)

Corresponding gray values.

Algorithmalgorithmalgorithm (input_control) string โ†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Algorithm for the fitting.

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

Iterationsiterationsiterations (input_control) integer โ†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Maximum number of iterations (unused for โ€˜regressionโ€™).

Default: 55
Restriction: Iterations >= 0

ClippingFactorclippingFactorclipping_factor (input_control) real โ†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Clipping factor for the elimination of outliers.

Default: 2.02.0
List of values: 1.0, 1.5, 2.0, 2.5, 3.01.0, 1.5, 2.0, 2.5, 3.0
Restriction: ClippingFactor > 0

Alphaalphaalpha (output_control) real(-array) โ†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Parameter Alpha of the approximating surface.

Betabetabeta (output_control) real(-array) โ†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Parameter Beta of the approximating surface.

Gammagammagamma (output_control) real(-array) โ†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Parameter Gamma of the approximating surface.

Deltadeltadelta (output_control) real(-array) โ†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Parameter Delta of the approximating surface.

Epsilonepsilonepsilon (output_control) real(-array) โ†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Parameter Epsilon of the approximating surface.

Zetazetazeta (output_control) real(-array) โ†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Parameter Zeta of the approximating surface.

Result๐Ÿ”—

The operator fit_surface_second_orderFitSurfaceSecondOrder 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 is raised.

Combinations with other operators๐Ÿ”—

Combinations

Possible successors

gen_image_surface_second_orderGenImageSurfaceSecondOrder

See also

moments_gray_planeMomentsGrayPlane, fit_surface_first_orderFitSurfaceFirstOrder

Module๐Ÿ”—

Foundation