HALCON Reference Manual 10.0.2
Table of Contents / Morphology / Region ClassesClassesClasses | | | Operators

hit_or_misshit_or_misshit_or_missHitOrMissHitOrMiss (Operator)

Name

hit_or_misshit_or_misshit_or_missHitOrMissHitOrMiss — Hit-or-miss operation for regions.

Signature

hit_or_miss(Region, StructElement1, StructElement2 : RegionHitMiss : Row, Column : )

Herror hit_or_miss(const Hobject Region, const Hobject StructElement1, const Hobject StructElement2, Hobject* RegionHitMiss, const Hlong Row, const Hlong Column)

Herror T_hit_or_miss(const Hobject Region, const Hobject StructElement1, const Hobject StructElement2, Hobject* RegionHitMiss, const Htuple Row, const Htuple Column)

Herror hit_or_miss(Hobject Region, Hobject StructElement1, Hobject StructElement2, Hobject* RegionHitMiss, const HTuple& Row, const HTuple& Column)

HRegion HRegion::HitOrMiss(const HRegion& StructElement1, const HRegion& StructElement2, const HTuple& Row, const HTuple& Column) const

HRegionArray HRegionArray::HitOrMiss(const HRegion& StructElement1, const HRegion& StructElement2, const HTuple& Row, const HTuple& Column) const

void HOperatorSetX.HitOrMiss(
[in] IHUntypedObjectX* Region, [in] IHUntypedObjectX* StructElement1, [in] IHUntypedObjectX* StructElement2, [out] IHUntypedObjectX*RegionHitMiss, [in] VARIANT Row, [in] VARIANT Column)

IHRegionX* HRegionX.HitOrMiss(
[in] IHRegionX* StructElement1, [in] IHRegionX* StructElement2, [in] Hlong Row, [in] Hlong Column)

static void HOperatorSet.HitOrMiss(HObject region, HObject structElement1, HObject structElement2, out HObject regionHitMiss, HTuple row, HTuple column)

HRegion HRegion.HitOrMiss(HRegion structElement1, HRegion structElement2, int row, int column)

Description

hit_or_misshit_or_misshit_or_missHitOrMissHitOrMiss performs the hit-or-miss-transformation. First, an erosion with the structuring element StructElement1StructElement1StructElement1StructElement1structElement1 is done on the input region RegionRegionRegionRegionregion. Then an erosion with the structuring element StructElement2StructElement2StructElement2StructElement2structElement2 is performed on the complement of the input region. The intersection of the two resulting regions is the result RegionHitMissRegionHitMissRegionHitMissRegionHitMissregionHitMiss of hit_or_misshit_or_misshit_or_missHitOrMissHitOrMiss.

The hit-or-miss-transformation selects precisely the points for which the conditions given by the structuring elements StructElement1StructElement1StructElement1StructElement1structElement1 and StructElement2StructElement2StructElement2StructElement2structElement2 are fulfilled. StructElement1StructElement1StructElement1StructElement1structElement1 determines the condition for the foreground pixels, while StructElement2StructElement2StructElement2StructElement2structElement2 determines the condition for the background pixels. In order to obtain sensible results, StructElement1StructElement1StructElement1StructElement1structElement1 and StructElement2StructElement2StructElement2StructElement2structElement2 must fit like key and lock. In any case, StructElement1StructElement1StructElement1StructElement1structElement1 and StructElement2StructElement2StructElement2StructElement2structElement2 must be disjunct. RowRowRowRowrow and ColumnColumnColumnColumncolumn determine the reference point of the structuring elements.

Structuring elements (StructElement1StructElement1StructElement1StructElement1structElement1, StructElement2StructElement2StructElement2StructElement2structElement2) can be generated by calling operators like gen_struct_elementsgen_struct_elementsgen_struct_elementsGenStructElementsGenStructElements, gen_region_pointsgen_region_pointsgen_region_pointsGenRegionPointsGenRegionPoints, etc.

Parallelization

Parameters

RegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHRegionXHobject

Regions to be processed.

StructElement1StructElement1StructElement1StructElement1structElement1 (input_object)  region objectHRegionHRegionHRegionXHobject

Erosion mask for the input regions.

StructElement2StructElement2StructElement2StructElement2structElement2 (input_object)  region objectHRegionHRegionHRegionXHobject

Erosion mask for the complements of the input regions.

RegionHitMissRegionHitMissRegionHitMissRegionHitMissregionHitMiss (output_object)  region(-array) objectHRegionHRegionHRegionXHobject *

Result of the hit-or-miss operation.

RowRowRowRowrow (input_control)  point.y HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Row coordinate of the reference point.

Default value: 16

Suggested values: 0, 16, 32, 128, 256

Typical range of values: 0 ≤ Row Row Row Row row ≤ 511 (lin)

Minimum increment: 1

Recommended increment: 1

ColumnColumnColumnColumncolumn (input_control)  point.x HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Column coordinate of the reference point.

Default value: 16

Suggested values: 0, 16, 32, 128, 256

Typical range of values: 0 ≤ Column Column Column Column column ≤ 511 (lin)

Minimum increment: 1

Recommended increment: 1

Complexity

Let F be the area of an input region, F1 the area of the structuring element 1, and F2 the area of the structuring element 2. Then the runtime complexity for one object is:

      O(sqrt(F) * (sqrt(F1) + sqrt(F2))) .

Result

hit_or_misshit_or_misshit_or_missHitOrMissHitOrMiss returns 2 (H_MSG_TRUE) if all parameters are correct. The behavior in case of empty or no input region can be set via:

Otherwise, an exception is raised.

Possible Predecessors

golay_elementsgolay_elementsgolay_elementsGolayElementsGolayElements, gen_struct_elementsgen_struct_elementsgen_struct_elementsGenStructElementsGenStructElements, thresholdthresholdthresholdThresholdThreshold, regiongrowingregiongrowingregiongrowingRegiongrowingRegiongrowing, connectionconnectionconnectionConnectionConnection, union1union1union1Union1Union1, watershedswatershedswatershedsWatershedsWatersheds, class_ndim_normclass_ndim_normclass_ndim_normClassNdimNormClassNdimNorm

Possible Successors

differencedifferencedifferenceDifferenceDifference, reduce_domainreduce_domainreduce_domainReduceDomainReduceDomain, select_shapeselect_shapeselect_shapeSelectShapeSelectShape, area_centerarea_centerarea_centerAreaCenterAreaCenter, connectionconnectionconnectionConnectionConnection

Alternatives

hit_or_miss_golayhit_or_miss_golayhit_or_miss_golayHitOrMissGolayHitOrMissGolay, hit_or_miss_seqhit_or_miss_seqhit_or_miss_seqHitOrMissSeqHitOrMissSeq, erosion2erosion2erosion2Erosion2Erosion2, dilation2dilation2dilation2Dilation2Dilation2

See also

thinningthinningthinningThinningThinning, thickeningthickeningthickeningThickeningThickening, gen_region_pointsgen_region_pointsgen_region_pointsGenRegionPointsGenRegionPoints, gen_region_polygon_filledgen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilled

Module

Foundation


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