area_center_grayarea_center_grayAreaCenterGrayAreaCenterGray (Operator)


area_center_grayarea_center_grayAreaCenterGrayAreaCenterGray — Compute the area and center of gravity of a region in a gray value image.


area_center_gray(Regions, Image : : : Area, Row, Column)

Herror area_center_gray(const Hobject Regions, const Hobject Image, double* Area, double* Row, double* Column)

Herror T_area_center_gray(const Hobject Regions, const Hobject Image, Htuple* Area, Htuple* Row, Htuple* Column)

void AreaCenterGray(const HObject& Regions, const HObject& Image, HTuple* Area, HTuple* Row, HTuple* Column)

HTuple HImage::AreaCenterGray(const HRegion& Regions, HTuple* Row, HTuple* Column) const

double HImage::AreaCenterGray(const HRegion& Regions, double* Row, double* Column) const

HTuple HRegion::AreaCenterGray(const HImage& Image, HTuple* Row, HTuple* Column) const

double HRegion::AreaCenterGray(const HImage& Image, double* Row, double* Column) const

static void HOperatorSet.AreaCenterGray(HObject regions, HObject image, out HTuple area, out HTuple row, out HTuple column)

HTuple HImage.AreaCenterGray(HRegion regions, out HTuple row, out HTuple column)

double HImage.AreaCenterGray(HRegion regions, out double row, out double column)

HTuple HRegion.AreaCenterGray(HImage image, out HTuple row, out HTuple column)

double HRegion.AreaCenterGray(HImage image, out double row, out double column)


area_center_grayarea_center_grayAreaCenterGrayAreaCenterGrayAreaCenterGray computes the area and center of gravity of the regions RegionsRegionsRegionsRegionsregions that have gray values which are defined by the image ImageImageImageImageimage. This operator is similar to area_centerarea_centerAreaCenterAreaCenterAreaCenter, 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 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 , where

Note, that in the case where the AreaAreaAreaAreaarea is zero the row and column coordinates of the center of gravity are also set to zero.


Note that the operator area_center_grayarea_center_grayAreaCenterGrayAreaCenterGrayAreaCenterGray only considers the given RegionsRegionsRegionsRegionsregions and ignores any previously set domain of the input image ImageImageImageImageimage. area_center_grayarea_center_grayAreaCenterGrayAreaCenterGrayAreaCenterGray can be executed on OpenCL devices if the device supports the cl_khr_fp64 and cl_khr_int64_base_atomics OpenCL extensions.

Execution Information


RegionsRegionsRegionsRegionsregions (input_object)  region(-array) objectHRegionHRegionHobject

Region(s) to be examined.

ImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHobject (byte* / direction* / cyclic* / int1* / int2* / uint2* / int4* / real*) *allowed for compute devices

Gray value image.

AreaAreaAreaAreaarea (output_control)  real(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Gray value volume of the region.

RowRowRowRowrow (output_control)  point.y(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Row coordinate of the gray value center of gravity.

ColumnColumnColumnColumncolumn (output_control)  point.x(-array) HTupleHTupleHtuple (real) (double) (double) (double)

Column coordinate of the gray value center of gravity.


area_center_grayarea_center_grayAreaCenterGrayAreaCenterGrayAreaCenterGray 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>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

thresholdthresholdThresholdThresholdThreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowing, connectionconnectionConnectionConnectionConnection



See also

area_center_xldarea_center_xldAreaCenterXldAreaCenterXldAreaCenterXld, elliptic_axis_grayelliptic_axis_grayEllipticAxisGrayEllipticAxisGrayEllipticAxisGray