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

Hit-or-miss operation for regions.

::hit_or_miss performs the hit-or-miss-transformation. First, an erosion with the structuring element StructElement1 is done on the input region Region. Then an erosion with the structuring element StructElement2 is performed on the complement of the input region. The intersection of the two resulting regions is the result RegionHitMiss of ::hit_or_miss.

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

Structuring elements (StructElement1, StructElement2) can be generated by calling operators like ::gen_struct_elements, ::gen_region_points, etc.


Parameters

Region (input_object)
region(-array) -> Hobject: HRegion(Array)
Regions to be processed.

StructElement1 (input_object)
region -> Hobject: HRegion
Erosion mask for the input regions.

StructElement2 (input_object)
region -> Hobject: HRegion
Erosion mask for the complements of the input regions.

RegionHitMiss (output_object)
region(-array) -> Hobject * : HRegion(Array)
Result of the hit-or-miss operation.

Row (input_control)
point.y -> HTuple.long
Row coordinate of the reference point.
Default value: 16
Suggested values: 0, 16, 32, 128, 256
Typical range of values: 0 <= Row <= 511 (lin)
Minimum increment: 1
Recommended increment: 1

Column (input_control)
point.x -> HTuple.long
Column coordinate of the reference point.
Default value: 16
Suggested values: 0, 16, 32, 128, 256
Typical range of values: 0 <= 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_miss returns H_MSG_TRUE if all parameters are correct. The behavior in case of empty or no input region can be set via:

  a) no region:    set_system('no_object_result',<RegionResult>)
  b) empty region: set_system('empty_region_result',<RegionResult>)
Otherwise, an exception is raised.


Possible Predecessors

::golay_elements, ::gen_struct_elements, ::threshold, ::regiongrowing, ::connection, ::union1, ::watersheds, ::class_ndim_norm


Possible Successors

::difference, ::reduce_domain, ::select_shape, ::area_center, ::connection


Alternatives

::hit_or_miss_golay, ::hit_or_miss_seq, ::erosion2, ::dilation2


See also

::thinning, ::thickening, ::gen_region_points, ::gen_region_polygon_filled


Module

Morphology



Copyright © 1996-2002 MVTec Software GmbH