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

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 struct_elements, store_coord, etc.


Parameters

Region (input_object)
region(-array) -> object
Regions to be processed.

StructElement1 (input_object)
region -> object
Erosion mask for the input regions.

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

RegionHitMiss (output_object)
region(-array) -> object
Result if the hit-or-miss operation.

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

Column (input_control)
point.x -> integer
Column coordinate of the reference point.
Default value: 16
Suggested values: 0, 16, 32, 128, 256
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 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, struct_elements, threshold__, regiongrowing__, connection, union1, watersheds, class_ndim1__


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, store_coord, store_filled_polygon



Copyright © 1996-1997 MVTec Software GmbH