Skip to content

fit_surface_first_orderFitSurfaceFirstOrderFitSurfaceFirstOrderfit_surface_first_orderfit_surface_first_order🔗

Short description🔗

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

Signature🔗

fit_surface_first_order( region Regions, image Image, string Algorithm, integer Iterations, real ClippingFactor, out real Alpha, out real Beta, out real Gamma )void FitSurfaceFirstOrder( const HObject& Regions, const HObject& Image, const HTuple& Algorithm, const HTuple& Iterations, const HTuple& ClippingFactor, HTuple* Alpha, HTuple* Beta, HTuple* Gamma )static void HOperatorSet.FitSurfaceFirstOrder( HObject regions, HObject image, HTuple algorithm, HTuple iterations, HTuple clippingFactor, out HTuple alpha, out HTuple beta, out HTuple gamma )def fit_surface_first_order( regions: HObject, image: HObject, algorithm: str, iterations: int, clipping_factor: float ) -> Tuple[Sequence[float], Sequence[float], Sequence[float]]

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

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

double HImage::FitSurfaceFirstOrder( const HRegion& Regions, const HString& Algorithm, Hlong Iterations, double ClippingFactor, double* Beta, double* Gamma ) const

double HImage::FitSurfaceFirstOrder( const HRegion& Regions, const char* Algorithm, Hlong Iterations, double ClippingFactor, double* Beta, double* Gamma ) const

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

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

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

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

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

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

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

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

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

  • ‘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 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_first_orderFitSurfaceFirstOrder 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.

Result🔗

The operator fit_surface_first_orderFitSurfaceFirstOrder 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_first_orderGenImageSurfaceFirstOrder

See also

moments_gray_planeMomentsGrayPlane, fit_surface_second_orderFitSurfaceSecondOrder

Module🔗

Foundation