HALCON Reference Manual 10.0.2
Table of Contents / Regions / Creation ClassesClassesClasses | | | Operators

label_to_regionlabel_to_regionlabel_to_regionLabelToRegionLabelToRegion (Operator)

Name

label_to_regionlabel_to_regionlabel_to_regionLabelToRegionLabelToRegion — Extract regions with equal gray values from an image.

Signature

label_to_region(LabelImage : Regions : : )

Herror label_to_region(const Hobject LabelImage, Hobject* Regions)

Herror T_label_to_region(const Hobject LabelImage, Hobject* Regions)

Herror label_to_region(Hobject LabelImage, Hobject* Regions)

HRegionArray HImage::LabelToRegion() const

HRegionArray HImageArray::LabelToRegion() const

void HOperatorSetX.LabelToRegion(
[in] IHUntypedObjectX* LabelImage, [out] IHUntypedObjectX*Regions)

IHRegionX* HImageX.LabelToRegion()

static void HOperatorSet.LabelToRegion(HObject labelImage, out HObject regions)

HRegion HImage.LabelToRegion()

Description

label_to_regionlabel_to_regionlabel_to_regionLabelToRegionLabelToRegion segments an image into regions of equal gray value. One output region is generated for each gray value occuring in the image. This is similar to calling thresholdthresholdthresholdThresholdThreshold multiple times, and accumulating the results with concat_objconcat_objconcat_objConcatObjConcatObj. Another related operator is regiongrowingregiongrowingregiongrowingRegiongrowingRegiongrowing. However, label_to_regionlabel_to_regionlabel_to_regionLabelToRegionLabelToRegion does not perform a connectionconnectionconnectionConnectionConnection operation on the resulting regions, i.e., they may be disconnected. A typical application of label_to_regionlabel_to_regionlabel_to_regionLabelToRegionLabelToRegion is the segmentation of label images, hence its name.

The number of output regions is limited by the system parameter 'max_outp_obj_par', which can be read via

get_system(::'max_outp_obj_par':<Anzahl>) .

Attention

label_to_regionlabel_to_regionlabel_to_regionLabelToRegionLabelToRegion is not implemented for images of type 'real'. The input images must not contain negative gray values.

Parallelization

Parameters

LabelImageLabelImageLabelImageLabelImagelabelImage (input_object)  image(-array) objectHImageHImageHImageXHobject (byte / int2 / int4 / int8)

Label image.

RegionsRegionsRegionsRegionsregions (output_object)  region-array objectHRegionHRegionArrayHRegionXHobject *

Regions having a constant gray value.

Complexity

Let x1 be the minimum x-coordinate, x2 the maximum x-coordinate, y1 be the minimum y-coordinate, and y2 the maximum y-coordinate of a particular gray value. Furthermore, let N be the number of different gray values in the image. Then the runtime complexity is O(N * (x2 - x1 + 1) * (y2 - y1 + 1))

Result

label_to_regionlabel_to_regionlabel_to_regionLabelToRegionLabelToRegion returns 2 (H_MSG_TRUE) if the gray values lie within a correct range. The behavior with respect to the input images and output regions can be determined by setting the values of the flags 'no_object_result'"no_object_result""no_object_result""no_object_result""no_object_result", 'empty_region_result'"empty_region_result""empty_region_result""empty_region_result""empty_region_result", and 'store_empty_region'"store_empty_region""store_empty_region""store_empty_region""store_empty_region" with set_systemset_systemset_systemSetSystemSetSystem. If necessary, an exception is raised.

Possible Predecessors

min_max_graymin_max_graymin_max_grayMinMaxGrayMinMaxGray, sobel_ampsobel_ampsobel_ampSobelAmpSobelAmp, binomial_filterbinomial_filterbinomial_filterBinomialFilterBinomialFilter, gauss_imagegauss_imagegauss_imageGaussImageGaussImage, reduce_domainreduce_domainreduce_domainReduceDomainReduceDomain, diff_of_gaussdiff_of_gaussdiff_of_gaussDiffOfGaussDiffOfGauss

Possible Successors

connectionconnectionconnectionConnectionConnection, dilation1dilation1dilation1Dilation1Dilation1, erosion1erosion1erosion1Erosion1Erosion1, openingopeningopeningOpeningOpening, closingclosingclosingClosingClosing, rank_regionrank_regionrank_regionRankRegionRankRegion, shape_transshape_transshape_transShapeTransShapeTrans, skeletonskeletonskeletonSkeletonSkeleton

See also

thresholdthresholdthresholdThresholdThreshold, concat_objconcat_objconcat_objConcatObjConcatObj, regiongrowingregiongrowingregiongrowingRegiongrowingRegiongrowing, region_to_labelregion_to_labelregion_to_labelRegionToLabelRegionToLabel

Module

Foundation


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