Herror ::thinning (
    Hobject Region,
    Hobject StructElement1,
    Hobject StructElement2,
    Hobject *RegionThin,
    const HTuple &Row,
    const HTuple &Column,
    const HTuple &Iterations
)
HRegion HRegion::Thinning (
    const HRegion &StructElement1,
    const HRegion &StructElement2,
    const HTuple &Row,
    const HTuple &Column,
    const HTuple &Iterations
) const
HRegionArray HRegionArray::Thinning (
    const HRegion &StructElement1,
    const HRegion &StructElement2,
    const HTuple &Row,
    const HTuple &Column,
    const HTuple &Iterations
) const

Remove the result of a hit-or-miss operation from a region.

::thinning performs a thinning of the input regions using morphological operations. The operator first applies a hit-or-miss-transformation to Region (cf.::hit_or_miss), and then removes the detected points from the input region. The parameter Iterations determines the number of iterations performed.

For the choice of the structuring elements StructElement1 and StructElement2, as well as for Row and Column, the same restrictions described under ::hit_or_miss apply.

Structuring elements (StructElement1, StructElement2) can be generated with operators such as ::gen_circle, ::gen_rectangle1, ::gen_rectangle2, ::gen_ellipse, ::draw_region, ::gen_region_polygon, ::gen_region_points, etc.


Parameters

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

StructElement1 (input_object)
region -> Hobject: HRegion
Structuring element for the foreground.

StructElement2 (input_object)
region -> Hobject: HRegion
Structuring element for the background.

RegionThin (output_object)
region(-array) -> Hobject * : HRegion(Array)
Result of the thinning operator.

Row (input_control)
point.y -> HTuple.long
Row coordinate of the reference point.
Default value: 0
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: 0
Typical range of values: 0 <= Column <= 511 (lin)
Minimum increment: 1
Recommended increment: 1

Iterations (input_control)
integer -> HTuple.long
Number of iterations.
Default value: 1
Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 17, 20, 30, 40, 50
Typical range of values: 1 <= Iterations
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(Iterations * sqrt(F) * (sqrt(F1) + sqrt(F2))) .


Result

::thinning 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

::threshold, ::regiongrowing, ::connection, ::union1, ::watersheds, ::class_ndim_norm, ::gen_circle, ::gen_ellipse, ::gen_rectangle1, ::gen_rectangle2, ::draw_region, ::gen_region_points, ::gen_struct_elements, ::gen_region_polygon_filled


Possible Successors

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


Alternatives

::thinning_golay, ::thinning_seq


See also

::hit_or_miss


Module

Morphology



Copyright © 1996-2002 MVTec Software GmbH