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

Calculate gray value moments and approximation by a plane.

The operator moments_gray_plane 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, Beta 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 / direction / cyclic / uint2 / real
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 moments_gray_plane returns the value 2 (H_MSG_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 handling is raised.


Parallelization Information

moments_gray_plane is reentrant and automatically parallelized (on tuple level).


Possible Predecessors

draw_region, gen_circle, gen_ellipse, gen_rectangle1, gen_rectangle2, threshold, regiongrowing


See also

intensity, moments_region_2nd


References

R. Haralick, L. Shapiro; ``Computer and Robot Vision''; Addison-Wesley, 1992, pp 75-76


Module

Image filters



Copyright © 1996-2005 MVTec Software GmbH