Operator Reference

regress_contours_xldregress_contours_xldRegressContoursXldRegressContoursXldregress_contours_xld (Operator)

regress_contours_xldregress_contours_xldRegressContoursXldRegressContoursXldregress_contours_xld — Calculate the parameters of a regression line to an XLD contour.

Signature

regress_contours_xld(Contours : RegressContours : Mode, Iterations : )

Herror regress_contours_xld(const Hobject Contours, Hobject* RegressContours, const char* Mode, const Hlong Iterations)

Herror T_regress_contours_xld(const Hobject Contours, Hobject* RegressContours, const Htuple Mode, const Htuple Iterations)

void RegressContoursXld(const HObject& Contours, HObject* RegressContours, const HTuple& Mode, const HTuple& Iterations)

HXLDCont HXLDCont::RegressContoursXld(const HString& Mode, Hlong Iterations) const

HXLDCont HXLDCont::RegressContoursXld(const char* Mode, Hlong Iterations) const

HXLDCont HXLDCont::RegressContoursXld(const wchar_t* Mode, Hlong Iterations) const   ( Windows only)

static void HOperatorSet.RegressContoursXld(HObject contours, out HObject regressContours, HTuple mode, HTuple iterations)

HXLDCont HXLDCont.RegressContoursXld(string mode, int iterations)

def regress_contours_xld(contours: HObject, mode: str, iterations: int) -> HObject

Description

regress_contours_xldregress_contours_xldRegressContoursXldRegressContoursXldregress_contours_xld calculates the following parameters for the input XLD contours ContoursContoursContourscontourscontours, and stores them with the resulting contours as global attributes:

  • the coordinates of the normal vector of the regression line, i.e., the least-squares approximating line, of all contour points; the normal vector always points from the origin to the line (attributes: 'regr_norm_row'"regr_norm_row""regr_norm_row""regr_norm_row""regr_norm_row", 'regr_norm_col'"regr_norm_col""regr_norm_col""regr_norm_col""regr_norm_col"),

  • the mean of the Euclidean distance of the contour points from the regression line (attribute: 'regr_mean_dist'"regr_mean_dist""regr_mean_dist""regr_mean_dist""regr_mean_dist"),

  • the standard deviation of these distances to the regression line (attribute: 'regr_dev_dist'"regr_dev_dist""regr_dev_dist""regr_dev_dist""regr_dev_dist"),

  • the distance of the regression line from the origin (attribute: 'regr_dist'"regr_dist""regr_dist""regr_dist""regr_dist").

See get_contour_global_attrib_xldget_contour_global_attrib_xldGetContourGlobalAttribXldGetContourGlobalAttribXldget_contour_global_attrib_xld for further information about global contour attributes.

For ModeModeModemodemode = 'no'"no""no""no""no", the parameters of the regression line are calculated for all points of the contour. In addition, three different kinds of outlier treatment can be applied. Outliers are contour points which do not lie on the general contour direction in an “obvious” manner, and thus “distort” the resulting regression line.

ModeModeModemodemode =

  • 'drop'"drop""drop""drop""drop": All contour points further away from the contour than the mean distance to the regression line are ignored for the calculation of the undistorted regression line.

  • 'gauss'"gauss""gauss""gauss""gauss": The distances of the contour points are weighted according to their probability of occurrence in a Gaussian distribution around the normal regression line.

  • 'median'"median""median""median""median": Here, also a normal distribution is assumed for the distances to the normal regression line, however with the outlier-independent standard deviation , with : median of all distances. Again, the distances are weighted, and points further away than a certain distance are ignored for the undistorted regression line.

The calculation of the undistorted regression line can be iterated several times (IterationsIterationsIterationsiterationsiterations).

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

ContoursContoursContourscontourscontours (input_object)  xld_cont-array objectHXLDContHObjectHObjectHobject

Input XLD contours.

RegressContoursRegressContoursRegressContoursregressContoursregress_contours (output_object)  xld_cont-array objectHXLDContHObjectHObjectHobject *

Resulting XLD contours.

ModeModeModemodemode (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Type of outlier treatment.

Default: 'no' "no" "no" "no" "no"

List of values: 'drop'"drop""drop""drop""drop", 'gauss'"gauss""gauss""gauss""gauss", 'median'"median""median""median""median", 'no'"no""no""no""no"

IterationsIterationsIterationsiterationsiterations (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of iterations for the outlier treatment.

Default: 1

Suggested values: 1, 2, 3, 5, 10, 20

Possible Predecessors

gen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXldgen_contours_skeleton_xld, lines_gausslines_gaussLinesGaussLinesGausslines_gauss, lines_facetlines_facetLinesFacetLinesFacetlines_facet, edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixedges_sub_pix

Possible Successors

get_regress_params_xldget_regress_params_xldGetRegressParamsXldGetRegressParamsXldget_regress_params_xld

See also

smooth_contours_xldsmooth_contours_xldSmoothContoursXldSmoothContoursXldsmooth_contours_xld, get_contour_global_attrib_xldget_contour_global_attrib_xldGetContourGlobalAttribXldGetContourGlobalAttribXldget_contour_global_attrib_xld, query_contour_global_attribs_xldquery_contour_global_attribs_xldQueryContourGlobalAttribsXldQueryContourGlobalAttribsXldquery_contour_global_attribs_xld

References

H. Suesse, K. Voss: “Adaptive Ausgleichsrechnung und Ausreißerproblematik für die digitale Bildverarbeitung”; Proc. 15. DAGM Symposium, Springer Verlag, Lübeck 1993
R. Haralick, L. Shapiro: “Computer and Robot Vision” Vol. 2; Kapitel 14.9, Addison-Wesley 1992

Module

Foundation