HALCON Reference Manual 10.0.2
Table of Contents / Image / Features ClassesClassesClasses | | | Operators

area_center_grayarea_center_grayarea_center_grayAreaCenterGrayAreaCenterGray (Operator)

Name

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

Signature

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)

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

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

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

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

void HOperatorSetX.AreaCenterGray(
[in] IHUntypedObjectX* Regions, [in] IHUntypedObjectX* Image, [out] VARIANT* Area, [out] VARIANT* Row, [out] VARIANT* Column)

VARIANT HImageX.AreaCenterGray(
[in] IHRegionX* Regions, [out] VARIANT* Row, [out] VARIANT* Column)

VARIANT HRegionX.AreaCenterGray(
[in] IHImageX* Image, [out] VARIANT* Row, [out] VARIANT* Column)

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)

Description

area_center_grayarea_center_grayarea_center_grayAreaCenterGrayAreaCenterGray 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_centerarea_centerAreaCenterAreaCenter, 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

Parallelization

Parameters

RegionsRegionsRegionsRegionsregions (input_object)  region(-array) objectHRegionHRegionHRegionXHobject

Region(s) to be examined.

ImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHImageXHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)

Gray value image.

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

Gray value volume of the region.

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

Row coordinate of the gray value center of gravity.

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

Column coordinate of the gray value center of gravity.

Result

area_center_grayarea_center_grayarea_center_grayAreaCenterGrayAreaCenterGray 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>)set_system("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

Alternatives

area_centerarea_centerarea_centerAreaCenterAreaCenter

See also

area_center_xldarea_center_xldarea_center_xldAreaCenterXldAreaCenterXld, elliptic_axis_grayelliptic_axis_grayelliptic_axis_grayEllipticAxisGrayEllipticAxisGray

Module

Foundation


Table of Contents / Image / Features ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH