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

gray_projectionsT_gray_projectionsgray_projectionsGrayProjectionsGrayProjections (Operator)

Name

gray_projectionsT_gray_projectionsgray_projectionsGrayProjectionsGrayProjections — Calculate horizontal and vertical gray-value projections.

Signature

gray_projections(Region, Image : : Mode : HorProjection, VertProjection)

Herror T_gray_projections(const Hobject Region, const Hobject Image, const Htuple Mode, Htuple* HorProjection, Htuple* VertProjection)

Herror gray_projections(Hobject Region, Hobject Image, const HTuple& Mode, HTuple* HorProjection, HTuple* VertProjection)

HTuple HRegion::GrayProjections(const HImage& Image, const HTuple& Mode, HTuple* VertProjection) const

void HOperatorSetX.GrayProjections(
[in] IHUntypedObjectX* Region, [in] IHUntypedObjectX* Image, [in] VARIANT Mode, [out] VARIANT* HorProjection, [out] VARIANT* VertProjection)

VARIANT HImageX.GrayProjections(
[in] IHRegionX* Region, [in] BSTR Mode, [out] VARIANT* VertProjection)

VARIANT HRegionX.GrayProjections(
[in] IHImageX* Image, [in] BSTR Mode, [out] VARIANT* VertProjection)

static void HOperatorSet.GrayProjections(HObject region, HObject image, HTuple mode, out HTuple horProjection, out HTuple vertProjection)

HTuple HImage.GrayProjections(HRegion region, string mode, out HTuple vertProjection)

HTuple HRegion.GrayProjections(HImage image, string mode, out HTuple vertProjection)

Description

gray_projectionsgray_projectionsgray_projectionsGrayProjectionsGrayProjections calculates the horizontal and vertical gray-value projections, i.e., the mean values in the horizontal and vertical direction of the gray values of the input image ImageImageImageImageimage within the input region RegionRegionRegionRegionregion.

If ModeModeModeModemode = 'simple'"simple""simple""simple""simple" is selected the projection is performed in the direction of the coordinate axes of the image, i.e.:

                                      ----
                                      \
    HorProjection(r)  =  1/n(r+r')    /    Image(r+r',c+c')
                                      ----
                                   (r+r',c+c') in Region

                                      ----
                                      \
    VertProjection(c) =  1/n(c+c')    /    Image(r+r',c+c')
                                      ----
                                   (r+r',c+c') in Region

Here, (r',c') denotes the upper left corner of the smallest enclosing axis-parallel rectangle of the input region (see smallest_rectangle1smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1), and n(x) denotes the number of region points in the corresponding row r+r' or column c+c'. Hence, the horizontal projection returns a one-dimensional function that reflects the vertical gray value changes. Likewise, the vertical projection returns a function that reflects the horizontal gray value changes.

If ModeModeModeModemode = 'rectangle'"rectangle""rectangle""rectangle""rectangle"is selected the projection is performed in the direction of the major axes of the smallest enclosing rectangle of arbitrary orientation of the input region (see smallest_rectangle2smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2). Here, the horizontal projection direction corresponds to the larger axis, while the vertical direction corresponds to the smaller axis. In this mode, all gray values within the smallest enclosing rectangle of arbitrary orientation of the input region are used to compute the projections.

Parallelization

Parameters

RegionRegionRegionRegionregion (input_object)  region objectHRegionHRegionHRegionXHobject

Region to be processed.

ImageImageImageImageimage (input_object)  image objectHImageHImageHImageXHobject (byte / int2 / uint2 / real)

Grayvalues for projections.

ModeModeModeModemode (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Method to compute the projections.

Default value: 'simple' "simple" "simple" "simple" "simple"

List of values: 'simple'"simple""simple""simple""simple", 'rectangle'"rectangle""rectangle""rectangle""rectangle"

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

Horizontal projection.

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

Vertical projection.

Module

1D Metrology


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