grey_moments ( Regions, Image : : : MRow, MCol, Alpha, Beta, Mean )

Calculate gray value moments and approximation by a plane.

The operator grey_moments calculates the gray value moments and the parameters of the approximation of the gray values by a plane. The calculation is carried out according to the following formula:

  MRow  = sum((r-r')*(Image(r,c)-Mean))/F^2
  MCol  = sum((c-c')*(Image(r,c)-Mean))/F^2
  Alpha = (MRow*F*m02-m11*MCol*F)/(m20*m02-m11^2)
  Beta  = (m20*MCol*F-MRow*F*m11)/(m20*m02-m11^2)

where F is the plane, r', c' the center, and m11, m20, and m02 the
normalized moments of Regions.
The parameters Alpha, Alpha and Mean describe a plane above the region:
  Image'(r,c) = Alpha*(r-r')+Beta*(c-c')+Mean
Thus Alpha indicates the gradient in the direction of the line axis (``down''), Beta the gradient in the direction of the column axis (to the ``right'').


Parameters

Regions (input_object)
region(-array) -> object
Regions to be checked.

Image (input_object)
image -> object : byte
Corresponding gray values.

MRow (output_control)
real(-array) -> real
Mixed moments along a line.

MCol (output_control)
real(-array) -> real
Mixed moments along a column.

Alpha (output_control)
real(-array) -> real
Parameter Alpha of the approximating plane.

Beta (output_control)
real(-array) -> real
Parameter Beta of the approximating plane.

Mean (output_control)
real(-array) -> real
Mean gray value.


Result

The operator grey_moments returns the value TRUE if an image with the defined gray values (byte) is entered and the parameters are correct. The behavior in case of empty input (no input images available) is set via the operator set_system(::'no_object_result',<Result>:), the behavior in case of empty region is set via set_system(::'empty_region_result',<Result>:). If necessary an exception is raised.


Possible Predecessors

draw_region, circle, ellipse, rectangle1, rectangle2, threshold__, regiongrowing__


Possible Successors

image_plane


See also

intensity__, moments


References

R. Haralick, L. Shapiro; "Computer and Robot Vision"; Addison-Wesley, 1992, Seite 75-76



Copyright © 1996-1997 MVTec Software GmbH