regress_contours_xld ( Contours : RegressContours : Mode, Iterations : )

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

regress_contours_xld calculates the following parameters for the input XLD contours Contours, 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_col'),
- the mean of the Euclidian distance of the contour points from the
  regression line (attribute: 'regr_mean_dist'),
- the standard deviation of these distances to the regression line
  (attribute: 'regr_dev_dist').
For Mode = '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.

Mode =

'drop':   All contour points further away from the contour than the
          mean distance from the regression line are ignored for the
          calculation of the undistorted regression line.
'gauss':  The distances of the contour points are weighted according
          to their probability of occurence in a Gaussian
          distribution around the normal regression line.
'median': Here, also a normal distribution is assumed for the
          distances to the normal regression line, however with the
          outlier-independent standard deviation
          (median(all dist.)/0.6745).  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 (Iterations).


Parameters

Contours (input_object)
xld_cont-array -> object
Input XLD contours.

RegressContours (output_object)
xld_cont-array -> object
Resulting XLD contours.

Mode (input_control)
string -> string
Type of outlier treatment.
Default value: 'no'
List of values: 'no', 'drop', 'gauss', 'median'

Iterations (input_control)
integer -> integer
Number of iterations for the outlier treatment.
Default value: 1
Suggested values: 1, 2, 3, 5, 10, 20


Parallelization Information

regress_contours_xld is reentrant and processed without parallelization.


Possible Predecessors

gen_contours_skeleton_xld, lines_gauss, lines_facet, edges_sub_pix


Possible Successors

get_regress_params_xld


See also

smooth_contours_xld, get_contour_global_attrib_xld, query_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

Sub-pixel operators



Copyright © 1996-2005 MVTec Software GmbH