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, Alpha and Mean describe a plane above the region:
Image'(r,c) = Alpha*(r-r')+Beta*(c-c')+MeanThus 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'').
|
Regions (input_object) |
region(-array) -> Hobject: HRegion(Array) |
| Regions to be checked. | |
|
Image (input_object) |
image -> Hobject: HImage ( byte / real ) |
| Corresponding gray values. | |
|
MRow (output_control) |
real(-array) -> (HTuple.) double * |
| Mixed moments along a line. | |
|
MCol (output_control) |
real(-array) -> (HTuple.) double * |
| Mixed moments along a column. | |
|
Alpha (output_control) |
real(-array) -> (HTuple.) double * |
| Parameter Alpha of the approximating plane. | |
|
Beta (output_control) |
real(-array) -> (HTuple.) double * |
| Parameter Beta of the approximating plane. | |
|
Mean (output_control) |
real(-array) -> (HTuple.) double * |
| Mean gray value. | |
The operator ::moments_gray_plane returns the value 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.
::draw_region, ::gen_circle, ::gen_ellipse, ::gen_rectangle1, ::gen_rectangle2, ::threshold, ::regiongrowing
::intensity, ::moments_region_2nd
R. Haralick, L. Shapiro; ``Computer and Robot Vision''; Addison-Wesley, 1992, pp 75-76
Image filters