Compute the area and center of gravity of a region in a gray value image.
area_center_gray computes the area and center of gravity of the regions Regions that have gray values which are defined by the image Image. This operator is similar to area_center, but in contrast to that operator, the gray values of the image are taken into account while computing the area and center of gravity.
The area A of a region R in the image with the gray values g(r,c) is defined as
---
\
A = / g(r,c) .
---
(r,c) in R
This means that the area is defined by the volume of the gray
value function g(r,c). The center of gravity is defined by the
first two normalized moments of the gray values g(r,c), i.e., by
(m10,m01), where
---
1 \ p q
m = - / r c g(r,c) .
p,q A ---
(r,c) in R
|
Regions (input_object) |
region(-array) -> object |
| Region(s) to be examined. | |
|
Image (input_object) |
singlechannelimage -> object : byte / direction / cyclic / int1 / int2 / uint2 / int4 / real |
| Gray value image. | |
|
Area (output_control) |
real(-array) -> real |
| Gray value volume of the region. | |
|
Row (output_control) |
point.y(-array) -> real |
| Row coordinate of the gray value center of gravity. | |
|
Column (output_control) |
point.x(-array) -> real |
| Column coordinate of the gray value center of gravity. | |
area_center_gray returns 2 (H_MSG_TRUE) if all parameters are correct and no error occurs during execution. If the input is empty the behavior can be set via set_system(::'no_object_result',<Result>:). If necessary, an exception handling is raised.
area_center_gray is reentrant and automatically parallelized (on tuple level).
threshold, regiongrowing, connection
area_center_xld, elliptic_axis_gray
Foundation